PHP code example of cwsps154 / my-gallery

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

    

cwsps154 / my-gallery example snippets


use CWSPS154\UsersRolesPermissions\MyGalleryPlugin;

$panel->plugins([MyGalleryPlugin::make()]);

use CWSPS154\UsersRolesPermissions\MyGalleryPlugin;

MyGalleryPlugin::make()
    ->canViewAny(function () {
        return true;
    })
    ->canCreate(function () {
        return true;
    })
    ->canEdit(function () {
        return true;
    })
    ->canDelete(function () {
        return true;
    })

use CWSPS154\MyGallery\Models\Gallery;
use CWSPS154\UsersRolesPermissions\MyGalleryPlugin;
use CWSPS154\UsersRolesPermissions\UsersRolesPermissionsServiceProvider;

MyGalleryPlugin::make()
    ->canViewAny(UsersRolesPermissionsServiceProvider::HAVE_ACCESS_GATE, Gallery::VIEW_GALLERY)
    ->canCreate(UsersRolesPermissionsServiceProvider::HAVE_ACCESS_GATE, Gallery::CREATE_GALLERY)
    ->canEdit(UsersRolesPermissionsServiceProvider::HAVE_ACCESS_GATE, Gallery::EDIT_GALLERY)
    ->canDelete(UsersRolesPermissionsServiceProvider::HAVE_ACCESS_GATE, Gallery::DELETE_GALLERY),

return [
    'settings-page' => \CWSPS154\AppSettings\Page\AppSettings::class,
];
shell
php artisan my-gallery:install
php artisan filament:assets
shell
php artisan vendor:publish --tag=my-gallery-config
shell
php artisan queue:work