Belich Facade: Routes


It will return the last value of the route function, that is, the action that is taking place in the Controller of the package. It will return four states by default:

index, edit, create and show.


It generates a direct link for an action, from any of the four supported actions. The format would be as follows:

Belich::actionRoute($controllerAction, $data)

As an example:


We would return a link to the index of the current resource. The second parameter $data, we can pass it in two ways:

  • As an object, obtaining the ID from it.
  • As an integer, using the ID directly.

As an example:

Belich::actionRoute('edit', $model)
Belich::actionRoute('edit', 201)


Belich's paths are automatically generated in the following format: dashboard.resource.action. Now let's imagine that our current route is dashboard.users.index. The route () method will return an array with the three values of the route: