Category: PHP

PHP articles.

observer in laravel

Using Laravel Model Observers

Laravel Model Observers is a great feature. Observers are used to group event listeners for a model. Observers classes method names refer to the Eloquent event you want to listen for. These methods receive the model as their only argument....

/ February 19, 2018

Laravel 5.5 and Dropzone.js: Uploading Images with removal links

Dropzone is the most popular, free and open source library that provides drag and drop file uploads with image previews. In this tutorial, we will be using dropzone in our Laravel project to upload files. Furthermore, we will be writing some...

/ February 14, 2018
Laravel 5.6 dynamic rate limiting

Laravel 5.6 Dynamic Rate Limiting

Starting from Laravel 5.6, you can use dynamic rate limiting to specify maximum number of requests based on the attribute of the authenticated User model. When specifying a rate limit on a group of routes in previous versions of Laravel, you had...

/ February 4, 2018
Laravel 5.6 collision package

Laravel 5.6 adds collision package for command line error reporting

Collision created and maintained by nunomaduro is an error handler package for PHP command line applications. Starting with Laravel 5.6, applications will contain a dev composer dependency for Collision package. This package gives you beautiful error reporting when interacting with your Laravel...

/ February 1, 2018
php artisan optimize

Laravel 5.6 Removed Artisan Optimize Command

php artisan optimize command was deprecated in Laravel 5.5. Now, after the official release of Laravel 5.6, it is removed. In Laravel 5.5, use of optimize command in the post-install-cmd and post-update-cmd scripts was no longer available. Now with Laravel 5.6, you cannot use...

/ January 30, 2018
Blade directives in laravel 5.6

Laravel 5.6 Two new blade directives

Laravel 5.6 will include two new blade directives. One for adding cross-site request forgery (CSRF) token in your forms and the other for defining form method. In Laravel 5.5 and below, you do the following at the top of the forms...

/ January 29, 2018
Laravel 5.4 specified key was too long error

Laravel 5.4: Specified key was too long error

Laravel 5.4 and higher uses utf8mb4 character set by default, which also includes support for storing emojis. It only affects new applications and as long as you are running MySQL higher than 5.7.7 release or MariaDB higher than 10.2.2 release. If you are...

/ January 12, 2018
Model Factories in Laravel

Learn to Use Model Factories in Laravel

Laravel has a feature called model factories that allows you to build fake data for your models. It is very useful for testing and seeding fake data into your database to see your code in action before any real user...

/ January 11, 2018
Laravel Packages

Top 10 packages for extending Laravel

Laravel is a free and open source PHP framework for creating web applications. At the time of writing, it is undoubtedly the most popular PHP framework. It offers a lot of features such as authentication, routing, model-view-controller architecture, eloquent and...

/ January 9, 2018