Showing 10 of 1,322 results.

The Goal | Laravel Paginator Pretty URLs

When use the paginator in Laravel, we get URLs like this: 1 http://localhost:8000/users?page=1 and we want URLs like this 1 http://localhost:8000/users/page/1 because why not? When digging through the code for the paginator class, I found that the...

Creating the Route | Laravel Paginator Pretty URLs

We are going to paginate a list of users. We want to display users with the URL format: http://localhost:8000/users/page/{page} . We are going to use a function called getShowResults in our UsersController . We can express this in our routes.php...

Laravel 5: Accessing Validation Features With validator

…dator ( ) -> make ( request ( ) -> all ( ) , [ 11 ' title ' => ' required|unique:posts|max:255 ' , 12 ' body ' => ' required ' 13 ] ) ; The second example above can be shortened even further. You can supply the arguments for the make instance...

Formatting Front Matter | Formatting

The Antlers formatter will attempt to format your template's front matter by default. If the front matter contains syntax errors, the front matter will not be formatted. To stop the formatter from attempting to format your front matter, disable...

Laravel String Helper Function: ucfirst

The ucfirst helper method is used to uppercase the first letter of a string. It defines only one parameter— $string —which is the string that should have its first letter upper cased. This helper method differs from PHP's ucfirst function because...

getFileCount | Workspaces

Returns the number of template files discovered in the workspace. 1 <?php 2 3 public function getFileCount ( ) : int ;

getRootStructures | Workspaces

Returns the direct workspace structures. This method automatically performs structural analysis. Only structures that are at the root of a document, without any parent node, will be returned. 1 <?php 2 3 use Illuminate \ Support \ Collection ; 4 5...

getRootSwitchStatements | Workspaces

Returns all the direct switch statements. This method automatically performs structural analysis. Only @switch statements that appear at the root of a document, without any parent nodes, will be returned. 1 <?php 2 3 use Illuminate \ Support \...

getRootForElse | Workspaces

Returns the direct for-else blocks. This method automatically performs structural analysis. Only nodes that appear at the root of a document, without any parent nodes, will be returned. 1 <?php 2 3 use Illuminate \ Support \ Collection ; 4 5...