PHP code example of rakib-587 / laravel-make-repository

1. Go to this page and download the library: Download rakib-587/laravel-make-repository 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/ */

    

rakib-587 / laravel-make-repository example snippets


'providers' => [
    Rakib\MakeRepository\MakeRepositoryServiceProvider::class,
],

// app/Repositories/OrderRepository.php

namespace App\Repositories;

use App\Models\Order;
use Rakib\MakeRepository\Repository;

class OrderRepository extends Repository
{
    public static function model()
    {
        return Order::class;
    }
}
bash
php artisan make:repository User
bash
php artisan make:repository Customer --model=User
bash
php artisan make:model Product --repo
bash
php artisan vendor:publish --tag=make-repository-stubs
bash
php artisan make:repository Order