Laravel CheatSheet

Laravel CheatSheet

App key php artisan key:generate Migration: Create foreign key $table->foreignIdFor(OtherClass::class); Create full entity php artisan make:model -mc MyNewModel Base libraries spatie/laravel-query-builder rbdwllr/reallysimplejwt nannehuiges/jsend guzzlehttp/guzzle defuse/php-encryption cviebrock/eloquent-taggable php artisan vendor:publish --pro...
read more
Laravel: Generate IDE helpers

Laravel: Generate IDE helpers

Add a composer command in the scripts section, so you can run composer run laravel:helper to update all Laravel IDE helpers: "scripts": { "laravel:helper": "php artisan ide-helper:generate && php artisan ide-helper:meta && php artisan ide-helpe...
read more
Lumen Middleware – JSON + gzip Response

Lumen Middleware – JSON + gzip Response

<?php namespace App\Http\Middleware; use Closure; class responseHeadersMiddleware { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $...
read more