The Blog

Laravel

Laravel Router Helper Function: get

John Koster
John Koster
November 21, 2016

The get function in Laravel is used to register a route that responds to the GET HTTP verb. It takes a URI and an action as parameters, where the URI is the path of the route and the action is what will be executed when the route is matched. The action can be a Closure or a mapping to a controller method. The return value of the get function is an instance of the \Illuminate\Routing\Route class. You can also use the Route facade or resolve the router from the application container to achieve the same results.

Laravel

Laravel Router Helper Function: patch

John Koster
John Koster
November 21, 2016

The patch function in Laravel is used to register a route that responds to the PATCH HTTP verb. You can specify the URI of the route and the action that will be executed when the route is matched. The action can either be a Closure or a mapping to a controller method. You can use the patch function directly or use the Route facade or resolve the router from the application container to achieve the same results.

Laravel

Laravel Router Helper Function: post

John Koster
John Koster
November 21, 2016

The post function in Laravel is used to register a route that responds to the POST HTTP verb. You can specify the URI of the route and the action that will be executed when the route is matched. The action can be a closure or a reference to a controller method. You can also use the Route facade or resolve the router from the application container to achieve the same results.

Laravel

Laravel Router Helper Function: put

John Koster
John Koster
November 21, 2016

The put function is used to register a route that responds to the PUT HTTP verb. You provide the URI of the route and the action that will be executed when the route is matched. The action can be a closure or a mapping to a controller method. The function returns an instance of \Illuminate\Routing\Route. You can also use the Route facade or resolve the router from the application container to achieve the same results.

Laravel

Laravel Router Helper Function: resource

John Koster
John Koster
November 21, 2016

Learn how to register a resource controller with the router using the resource function in PHP. Customize the $name, $controller, and $options of the route during construction. Find out how multiple individual routes are created behind the scenes.

Laravel

Laravel URL Helper Function: action

John Koster
John Koster
November 21, 2016

The action helper function in Laravel can generate a URL to a controller action. You can specify the controller action using the $name parameter and pass any required parameters using the $parameters parameter. By default, the generated URL will be an absolute URL, but you can specify a relative URL by setting the $absolute parameter to false.

Laravel

Laravel URL Helper Function: asset

John Koster
John Koster
November 21, 2016

The asset($path, $secure = null) function in Laravel returns a URI composed of the application's URI and the provided $path. You can specify if the URI should have the https:// or http:// schema by setting the optional $secure parameter. The function is useful for generating asset paths based on the application URI. Examples of different asset paths that can be generated are shown in the code snippet.

Laravel

Laravel URL Helper Function: elixir

John Koster
John Koster
November 21, 2016

The elixir helper function in Elixir is used to retrieve the path to a versioned Elixir file. It takes two arguments: the name of the file and the build directory (which is optional and defaults to 'build'). To get the versioned path for a file, you would call the helper function with the file name as the first argument. Optionally, you can also specify the build directory by passing it as the second argument.

Laravel

Laravel URL Helper Function: route

John Koster
John Koster
November 21, 2016

The route helper function in Laravel generates URLs for named routes. It takes in the route name, optional parameters, and a flag for generating absolute or relative URLs. You can add additional data to the query string by passing parameters in an array. By default, the route function generates fully qualified URLs, but you can change this behavior by setting the $absolute flag to false.

Laravel

Laravel URL Helper Function: secure_asset

John Koster
John Koster
November 21, 2016

The secure_asset function in Laravel returns a URI that combines the application's URI with the given path. It always ensures that the resulting URI uses the https:// protocol. It is equivalent to using the asset function with the $secure parameter set to true. However, if the supplied path contains a protocol, that protocol will be used. The same applies if a domain name is supplied to either function - it will be used instead of the current domain in the request.

Latest posts

Where Things get Good: Moving on to Forte Development Phase 1

Wrapping up Forte Phase 0 with the lexer and parser now in private alpha, and kicking off Phase 1 wi...

Read more
Forte Update: Backtracking, Metadata, HTML Validation, and More

A Forte development update: the parser now supports backtracking, improvements to node metadata, ide...

Read more
Parsing HTML and Blade Attributes in Forte

Wrapping up attribute parsing in Forte's HTML parser, from simple HTML attributes to complex, edge-c...

Read more
Switch Statements and Parser Extensions in Forte

Exploring how Forte's parser extensions can be used to handle complex Blade directives like nested s...

Read more
Parsing Blade Comments in Forte

Digging into parsing Blade and HTML comments while building Forte's HTML parser for Laravel Blade.

Read more
Thoughts on HTML Elements and Blade Components in Forte

This week I’m tackling Forte's HTML parser - consolidating Blade, Flux, and Livewire components into...

Read more