PHP code example of gkalmoukis / laravel-repositories

1. Go to this page and download the library: Download gkalmoukis/laravel-repositories library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gkalmoukis / laravel-repositories example snippets


namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Repositories\Repository;

class DummyController extends Controller {

	/**
     * create a new controller instance
     *
     * @param  \App\Repositories\Repository $repository
     * @return void
     */
    public function __construct(
        protected Repository $repository
    ) {}
}

$repository = new \App\Repositories\Repository(new DummyModel);
bash
php artisan make:repository Repository --model=DummyModel