Laravel Macros Postmortem

20 Jan

Laravel Macros Postmortem Laravel gives you the ability to add methods to a class at runtime by using the Macroable (Illuminate\Support\Traits\Macroable) Trait. You need to use the Macroable trait inside the class in which you want to add methods at run time. Here is an example from the Laravel Documentation. The following code adds a toUpper method to the Collection …

Form Request Validation in Laravel API’s

20 Jan

Form Request Validation in Laravel API’s When we write API’s in Laravel and use Form Requests to validate the requests, the default Laravel behavior is to throw Validation Exception (\Illuminate\Validation\ValidationException) and redirect the user to the previous page. This redirect URL can be configured as well if we want to. As a result of it, we see a response with …

Shopify Theme Development

13 Jan

Shopify Theme Development A theme controls the user interface and feel of the online store. It makes the store functional and interactive with the customers. Store Theme Limitations A store can have only 20 themes installed, and only one of them can be published which customers will see when the store is live. Shopify Theme Kit Shopify provides an online …