prefix
:
$router->group([
'prefix' => 'admin',
'namespace' => 'Admin',
'middleware' => 'auth',
], function () {
resource('post', 'PostController');
resource('tag', 'TagController');
});
" ". , . , , .
, \vendor\laravel\framework\src\Illuminate\Routing\ResourceRegistrar.php
, :
protected $resourceDefaults = ['index', 'create', 'store', 'show', 'edit', 'update', 'destroy'];
'register':
public function register($name, $controller, array $options = [])
{
if (Str::contains($name, '/')) {
$this->prefixedResource($name, $controller, $options);
return;
}
$base = $this->getResourceWildcard(last(explode('.', $name)));
$defaults = $this->resourceDefaults;
foreach ($this->getResourceMethods($defaults, $options) as $m) {
$this->{'addResource'.ucfirst($m)}($name, $base, $controller, $options);
}
}
admin/tag/
:
if (Str::contains($name, '/')) { }
( ), , 99% - explode/implode
( " " - . , ) = > , .. ( 404).