PHP code example of orchestra / resources

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

    

orchestra / resources example snippets


'providers' => [

    // ...

    Orchestra\Resources\ResourcesServiceProvider::class,
],

'aliases' => [

    // ...

    'Resources' => Orchestra\Resources\Facade::class,
],


use Orchestra\Support\Facades\Foundation;

Event::listen('orchestra.started: admin', function () {
    $robots = Resources::make('robotix', [
        'name'    => 'Robots.txt',
        'uses'    => 'Robotix\ApiController',
        'visible' => function () {
            return (Foundation::acl()->can('manage orchestra'));
        },
    ]);
});

$robots->route('pages', 'resource:Robotix\PagesController');

$robots['pages.comments'] = 'resource:Robotix\Pages\CommentController';