Dependency Injection with laravel

This i called table data gateway pattern where a tables responsibility is handled by a Repository(data gateway)

First download toad from MySql freeware for browsing DB.
If you use phpmyadmin Ui then XDebug will create different problem including auto debug point …So be sure to use Toad ;;koc

–Make a model in app\Http\Models

php artisan make:model Http/Models/Test

and specify your table

Create a TestRepository in App\Http\Repositories folder

and finally inject it to Controller as much you as want. Separate all model with repository for

**Aditional Info

php artisan make:controller HelloController


//Create a dummy repository for copy and paste

Leave a Reply

Your email address will not be published. Required fields are marked *