PHP code example of eolica / laravel-content-tools

1. Go to this page and download the library: Download eolica/laravel-content-tools 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/ */

    

eolica / laravel-content-tools example snippets

 php
'providers' => [
    ...

    /*
    * Package Service Providers...
    */
    Eolica\LaravelContentTools\ContentToolsServiceProvider::class,

    ...
],
 bash
php artisan vendor:publish --tag=content-tools:assets --force
 json
"scripts": {
    "post-autoload-dump": [
        "@php artisan vendor:publish --tag=content-tools:assets --force --ansi"
    ]
}
 bash
php artisan vendor:publish --tag=content-tools:config
 php
namespace App\Providers;

use Eolica\LaravelContentTools\PermissionHandler\AuthGuardCheckPermissionHandler;
use Eolica\LaravelContentTools\PermissionHandler\PermissionHandler;

final class AppServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        if (!$this->app->isLocal()) {
            $this->app->bind(PermissionHandler::class, function ($app): PermissionHandler {
                return new AuthGuardCheckPermissionHandler(
                    $app->make('auth')->guard('backend')
                );
            });
        }
    }

    ...
}
 php
namespace Eolica\LaravelContentTools\PermissionHandler;

interface PermissionHandler
{
    public function check(): bool;
}