The Blog

Laravel 5

Laravel String Pattern Matching - Laravel 5.5 String Helper Method: "is"

John Koster
John Koster
November 30, 2017

The is helper method in Laravel's Illuminate\Support\Str class checks if a given value matches a given pattern. It returns true if the value matches the pattern and false otherwise. The method does not support traditional regular expressions. Laravel also provides a global str_is helper function that is a shortcut to calling Str::is.

Laravel 5

Making Sure Strings Start With a Given Value in Laravel - Laravel 5.5 String Helper Method: start

John Koster
John Koster
November 30, 2017

The start helper method ensures that a given value begins with exactly one occurrence of a prefix. It can be useful for generating absolute URLs from relative paths. The prefix can be any string value. Additionally, there is a global str_start helper function that provides a shortcut for calling Str::start.

Laravel 5

Laravel 5.5 String Helper Function: after

John Koster
John Koster
November 27, 2017

Learn how to use the after method in Laravel's Illuminate\Support\Str class to extract a substring after the first occurrence of a specified character. This method is useful for parsing URL query strings or quickly finding substrings based on a certain character. Use the provided signature and example to get started.

Laravel 5

Laravel 5.5 String Helper Function: before

John Koster
John Koster
November 27, 2017

The before method in Laravel's Illuminate\Support\Str class allows you to retrieve a portion of a string before the first occurrence of a specified character. It is useful for parsing URL query strings or extracting substrings. For example, Str::before('https://stillat.com?ref=newsletter', '?') would return "https://stillat.com".

Laravel 5

Laravel 5.5 String Helper Function: camel_case

John Koster
John Koster
November 27, 2017

The camel method in Laravel's Str class converts a string to camel case, where each word starts with a capitalized letter, except the first character, which is lowercased. It ignores special characters and spaces. The camel_case function is a shorthand for using Str::camel globally.

Laravel 5

Laravel 5.5 String Helper Function: studly

John Koster
John Koster
November 27, 2017

Learn how to format text using studly caps in Laravel. Studly caps removes word separators and capitalizes the first letter of each word. See examples of how the studly method works and how it can be used to generate Pascal Cased style strings. Also, find out about the global studly_case helper function that calls the Str::studly method.

Laravel 5

Laravel 5.5 String Helper Function: ascii

John Koster
John Koster
November 27, 2017

The ascii helper method converts a string in UTF-8 encoding into its ASCII equivalent. It is useful when communicating with software platforms that require ASCII or complying with formatting protocols. The method accepts a language parameter, and in Laravel 5.5, it supports Bulgarian and German in addition to English. The method can be used by passing a string to it and will return the ASCII representation of that string.

Development Resources

Installing Linguistics for Adobe Brackets

John Koster
John Koster
October 31, 2017

In this guide we are going to look at how to install the Linguistics for Adobe Brackets plugin, an offline as-you-type spell checking plugin. The first step to ...

Statamic

Building a Simple Statamic Request Addon

John Koster
John Koster
September 29, 2017

In the root directory of your site, issue the following command to have Statamic generate the scaffolding we will need to build our custom tag. This will ...

Development Resources

Image Resources for Applications and Blogs

John Koster
John Koster
September 24, 2017

Download 1065+ authentic unstock hi-res images. Curated & handpicked stockphotos. Use them anyway you want. Forever.

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