Search

Laravel Router Helper Function: resource

November 21, 2016 —John Koster

resource($name, $controller, array $options = [])

The resource function is a shortcut that is used to register a resource controller with the router. It accepts the $name of the route to create, the name of the $controller and an array of $options that should be used when constructing the routes. Internally, there many individual routes that are created when calling the resource function.