Today we will learn how to use the scopes and permission with API. In our example, we will create 3 different roles (admin, moderator, basic) with different permissions (view, add, edit, and delete). We will use the scope to moderate all the requests.Read More
Laravel 6.0 introduced Lazy Collection. Lazy collection leverages PHP’s Generators to allow you to work with a very large dataset and keeps the memory usages low. Let’s take an example with 60,000 users records.Read More
Middleware in Laravel is a bridge between all the requests and responses. Or we can say that all the requests entering your application can be filtered by middlewares. Laravel has fewer built-in middleware such as VerifyCsrfToken. The VerifyCsrfToken middleware will check the CSRF Token on each and every POST requests and through an error if the CSRF Token missed or mismatched.Read More
REpresentational State Transfer or REST is an architectural style for providing standards between computer systems on the web. We need REST API’s to communicate over various mediums like web, desktop or mobile application through the same database. API’s do not maintain session state between requests, except use tokens to authenticate users requests.Read More
Laravel provides a variety of validation rules that improve productivity. We can easily manage and customize the validation as per the requirement. You can also use the
Rule class while defining the validation rules. Let’s use the exits validation rule.
There are a bunch of ways to handle Form Validation through Laravel. It just depends on the developer. The robust ways to form validation is by creating a form request by the artisan command. It will help to separate the validation logic from the controller. Another way is by adding manual validatation rules within the method.Read More