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/ */
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;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.