Category Archives: PHP

PHP codes

How to do authorization in laravel 5.2?

Its very simple and can be done very easily.
In this tutorial we will look into followings:
How to define Abilities?
How to check Abilities?

  • Via The Gate Facade
  • Via The User Model
  • Within Blade Templates
  • Within Form Requests


What are policies?

How to check abilities/policies in Controller?

Before going to start tutorial just create Place Controller and Place model

php artisan make:controller PlaceController
php artisan make:model Place

How to define Abilities?
Ability means what user can do, operations permitted by user.
You can define abilities in your AuthServiceProvider boot method as below:
Continue reading How to do authorization in laravel 5.2?

Laravel fields error format as datatables editor plugin

How to handle laravel fields error according to data tables editor plugin create edit Before going to explain lets assume we want to create category and for time being we have one field that is name. And already we have controller,model and route established. For laravel field errors to be compatible with datatables editor Continue reading Laravel fields error format as datatables editor plugin