PHP code example of amdadulhaq / route-resource-paths-laravel
1. Go to this page and download the library: Download amdadulhaq/route-resource-paths-laravel 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/ */
amdadulhaq / route-resource-paths-laravel example snippets
Route::resourcePaths([
'create' => 'add',
'edit' => 'change',
]);
Route::resource('posts', PostController::class);
Route::resources([
'photos' => PhotoController::class,
'posts' => PostController::class,
])->paths([
'create' => 'add',
'edit' => 'change',
]);
Route::resource('users', UserController::class)->paths([
'create' => 'add',
'edit' => 'change',
]);
use App\Http\Controllers\UserController;
Route::resource('users', UserController::class)->paths([
'create' => 'add',
'edit' => 'change',
]);
Route::singletonPaths([
'create' => 'setup',
'edit' => 'modify',
]);
Route::singleton('profile', ProfileController::class)->creatable()->paths([
'create' => 'setup',
'edit' => 'modify',
]);