Showing 7 of 1,975 result(s)
…ngle day). A large amount of web sites and applications are powered by PHP; therefore an understanding of the PHP language is mandatory to fully understand and accept the power behind popular frameworks (such as Laravel, CodeIgniter or Symfony),...
When use the paginator in Laravel, we get URLs like this: http://localhost:8000/users?page=1 and we want URLs like this http://localhost:8000/users/page/1 because why not? When digging through the code for the paginator class, I found that the...
We can also instruct the pluck method to return an array that contains both a key and a value. We do this by passing in a third argument to the pluck function: the $key . Let's reuse the people array: We can get an array with everyone's firstName...
…enient way to access Laravel's components. Each facade is bound to some component already registered in the service container. Facades are typically used to provide a simpler interface to an complex underlying subsystem. While some facades...
The following code sample is an anonymous function assigned to a variable named $isPostFormat . The following example will use the Str::is helper method to check if a value is of the format /post/* : If a given value satisfies the format, true is...
We can also instruct the pluck method to return an array that contains both a key and a value. We do this by passing in a third argument to the pluck function: the $key . Let's reuse the people array: We can get an array with everyone's firstName...
The put method is used to add a new item to the collection with a given $key and $value . The put method modifies the original Collection instance and returns a reference to it.The following code example highlights the usage of the put method:...