• Reading time ~ 1 min
  • 05.12.2021

Creating routes for a resource controller works like:

Route::resource(
    '/resource',
    'ResourceController',
    $options
);

where /resource is the string defining the entry point (url) and ResourceController is the name of the required resource controller.

The $options array is an associative array containing any of:

option type(s) description
only array string dynamic Set the methods the controller should apply to
except array string dynamic Set the methods the controller should exclude
names array string Set the route names for controller actions
names.method string Set the route name for a controller action
parameters string array Override the route parameter names
parameters.previous string Override a route parameter’s name
middleware mixed Set a middleware to the resource

These options were derived from the source code.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297