Posts

Debug request in laravel

$request->all();

bash: cake: command not found

Add ./ befor cake example: ./cake bake all

Install plugin from git if version is not known

Add ":*" at the end of command Example: "composer require dereuromark/cakephp-queue:*"

Template literals (Template strings) Js

Template literals are enclosed by the backtick (` `) (grave accent) character instead of double or single quotes // Untagged, these create strings: `string text` `string text line 1 `string text ${expression} string text`

Policies in laravel

Create policy using artisan command: 1. php artisan make:policy PostPolicy 2. php artisan make:policy PostPolicy --model=Post here PostPolicy is poilcy name and Post is model name

Laravel Seeders

Run Seeders 1. This command runs the Database\Seeders\DatabaseSeeder class, which may in turn invoke other seed classes: php artisan db:seed 2. --class option to specify a specific seeder class to run individually: php artisan db:seed --class=UserSeeder 3. Fresh Migrate and seed to delete all tables and recreate with data: php artisan migrate:fresh --seed Create Seeders 1. php artisan make:seeder seederclassname Example: php artisan make:seeder UserSeeder

How to authenticate request postman

Add header Authorization: Bearer token here