Created
September 11, 2019 12:41
-
-
Save MrAtiebatie/bf647e982f5b45e56dee3c0e4d5e96e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* In your routes/web.php | |
*/ | |
$router->get('/', function (\App\Repositories\ProductRepository $productRepo) { | |
// Use any Eloquent feature directly | |
$productRepo->all()->dd(); | |
// Use your custom repository methods | |
echo $productRepo->findBySku(12345)->name; | |
// You can even query relations | |
echo $productRepo->first()->category; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment