1. Go to this page and download the library: Download haybea/laravel-trashcan 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/ */
haybea / laravel-trashcan example snippets
'only' => [
App\Models\User::class,
App\Models\Post::class,
// Add your custom models here
],
use Illuminate\Support\Facades\Gate;
/**
* Register the Trashcan gate.
*
* This gate determines who can access Trashcan in non-local environments.
*/
protected function gate(): void
{
Gate::define('viewTrashcan', function ($user) {
return in_array($user->email, [
'[email protected]',
]);
});
}