PHP code example of elaborate-code / laravel-resource-routes

1. Go to this page and download the library: Download elaborate-code/laravel-resource-routes 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/ */

    

elaborate-code / laravel-resource-routes example snippets


ResourceRoute::index('resources', ResourceController::class);
// Equivelent to:
// Route::ressource('resources', ResourceController::class)->only('index');

ResourceRoute::create('resources', ResourceController::class);
ResourceRoute::store('resources', ResourceController::class);
// Equivelent to:
// Route::ressource('resources', ResourceController::class)->only(['create', 'store']);

ResourceRoute::show('resources', ResourceController::class);

Route::middleware('can:update')->group(function () {
    ResourceRoute::edit('resources', ResourceController::class);
    ResourceRoute::update('resources', ResourceController::class);
});

ResourceRoute::destroy('resources', ResourceController::class);