PHP code example of irfan-chowdhury / repository-maker

1. Go to this page and download the library: Download irfan-chowdhury/repository-maker 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/ */

    

irfan-chowdhury / repository-maker example snippets

bash
$ php artisan make:contract UserContract
bash
$ php artisan make:contract-base
bash
$ php artisan make:contract-extends UserContract
bash
$ php artisan make:repository UserRepository
bash
$ php artisan make:repository-base
bash
$ php artisan make:repository-extends UserRepository
bash
$ php artisan make:service UserService
bash
use App\Contracts\UserContract;
...

public function __construct(public UserContract $userContract){}

public function index()
{
    return $userContract->latest()->first();
}