Laravel create custom directives

Laravel create custom directives Open app\Providers\AppServiceProvider and add in boot method in blade views use directive as @format_currency(‘2456.26’) click for more Laravel codesĀ read aboutĀ laravel extending blade

Laravel force logout user

Laravel force logout user Add force_logout column in users table. Create ForceLogout Middleware in app/Http/Middleware/ForceLogout.php Open up the app/Http/Kernel.php and add ForceLogout middleware click for more Laravel codes read about laravel middleware

Laravel solve cors issue

Laravel solve cors issue Create Cors.php file at app/Http/Middleware/Cors.php Open app/Http/Kernel.php file and add this in $middleware array and $routeMiddleware array. Close routes in middleware in routes.php click for more Laravel codes read about laravel middlewares

Laravel export excel files

Laravel export excel files Download PhpSpreadsheet from official website(use composer method). Paste the downloaded folder at app/Http/Helpers folder. Create a Function in Controller and include and use the downloaded sdk. click for more Laravel codes