PHP code example of unamatasanatarai / lara-repositories

1. Go to this page and download the library: Download unamatasanatarai/lara-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/ */

    

unamatasanatarai / lara-repositories example snippets


//config/app.php
App\Providers\RepositoryServiceProvider::class,



namespace App\Providers;

use App\Repositories\Contracts\RealestateRepositoryInterface;
use App\Repositories\RealestateRepository;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class RepositoryServiceProvider extends ServiceProvider
{

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        $this->app->bind(RealestateRepositoryInterface::class, RealestateRepository::class);
    }
}


    public function save(Request $request, RealestateRepositoryInterface $repo)
    {
        dd($repo->create([]));