PHP code example of scrumble-nl / laravel-csr

1. Go to this page and download the library: Download scrumble-nl/laravel-csr 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/ */

    

scrumble-nl / laravel-csr example snippets




declare(strict_types=1);

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Services\Holiday\PictureService;
use App\Repositories\Holiday\PictureRepository;
use App\Interfaces\Services\Holiday\IPictureService;
use App\Interfaces\Repositories\Holiday\IPictureRepository;

class AppServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        app()->bind(IPictureService::class, PictureService::class);
        app()->bind(IPictureRepository::class, PictureRepository::class);
    }
}




declare(strict_types=1);

namespace App\Http\Controllers\Holiday;

use App\Http\Controllers\Controller;
use App\Interfaces\Services\Holiday\IPictureService;

class PictureController extends Controller
{
    /**
     * @var IPictureService
     */
    private $pictureService;

    /**
     * @param IPictureService $pictureService
     */
    public function __construct(IPictureService $pictureService)
    {
        $this->pictureService = $pictureService;
    }
}

php artisan vendor:publish --tag=laravel-csr