Showing 10 of 2,133 results.

Laravel MessageBag Public API: any

The any method returns a boolean value indicating if the MessageBag instance actually has any messages. The method returns true if the instance has messages, otherwise it returns false . The following code examples demonstrate the usage of this...

Creating the Meerkat Helper File | Advanced Filtering

Meerkat will look for a meerkat/filters.php file when it starts. If you do not have this directory and file, feel free to create it now before we continue. The directory structure should look similar to this once done: 1 project-rooot/ 2 ├── app/...

Laravel Paginator Pretty URLs

I recently published a series of articles about creating a custom pagination view where users can enter the page number in a text box. On the second post I received a comment asking how to do pretty URLs with Laravel's paginator. Well here we go,...

Example Use | Laravel 5 Fluent API: The Public API

The following method calls are equivalent: 1 $ testObject = new stdClass ; 2 $ testObject -> method = function ( ) { 3 return ' Hello, world! ' ; 4 } ; 5 6 $ fluent = new Fluent ( $ testObject ) ; 7 8 // Using the `getAttributes` method. 9 $...

Laravel: Implementing a CRYPT_EXT_DES Hasher

In this article we will create an implementation of Illuminate\Contracts\Hashing\Hasher using PHP's crypt function and the CRYPT_EXT_DES hashing function. Like in the previous section, we will examine each method before looking at the full...

Title | Open Graph Metadata

The title method queues a <meta property="og:title" content="..."> tag. By default it binds to the $title variable. 1 <?php 2 3 use Stillat \ StatamicSiteEssentials \ Support \ Facades \ Metadata ; 4 5 // Adjusting the returned variable. 6...

Site Name | Open Graph Metadata

The siteName method queues a <meta name="site_name" property="og:site_name" content="..."> tag. By default it binds to the $meta_site_name variable. 1 <?php 2 3 use Stillat \ StatamicSiteEssentials \ Support \ Facades \ Metadata ; 4 5 // Adjusting...

jQuery: Checking if an Item is an Array

When writing JavaScript, I am usually using the jQuery library. I also seem to work with arrays a lot. Most of the time I only care if an item is an existing array or not. That's pretty simple to do with jQuery, and looks like this: 1 2 // First,...

withCoreValidators | Validating Blade

Adds all the core validator instances to the current BladeValidator instance. 1 <?php 2 3 use Stillat \ BladeParser \ Validation \ BladeValidator ; 4 5 public function withCoreValidators ( ) : BladeValidator ;