clear session laravel
# ref: https://laravel.io/forum/02-06-2014-session-destroy
Session::forget('yourKeyGoesHere') // Removes a specific variable
//store multipal data
Session::put('user', ['first_name' => $request->get('first_name'), 'user_role' => Auth::user()->user_role, 'city' => Auth::user()->city]);
//in blade template
<p>
{{Session::get('user')['city']}}
</p>
@foreach (Session::get('user') as $user)
{{$user}}
@endforeach
//condtion check
@if(Session::has('user'))
@foreach (Session::get('user') as $user)
{{ $user }}
@endforeach
@endif
// condition check using ternary operator
{{ (Session::has('user')) ? 45 : 55}}
//delete session
Session::forget('customer');
//@sujay//Updated Dec 2020
//laravel artisan clear cache
php artisan view:clear
php artisan cache:clear
php artisan route:clear
php artisan config:clear
Also in PHP:
- echo today date in php
- customizing php time format based on location usa europe
- convert date to timestamp in php
- datetime format laravel
- catch multiple exceptions php 5
- array_push php
- Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:cer
- STR_TO_Time('" . $purchaseDate . "', '%Y-%m-%d %H:%i:%s'), php
- date ('n')
- Your requirements could not be resolved to an installable set of packages. Problem 1 - phpunit/phpunit 9.5.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
- actual link php
- ErrorException without try catch
- @ in php db connect
- add number of days in date php
- check if array has index php
- array only get duplicates
- Tests\Feature\BlogTest > user can delete post 162 Illuminate\Encryption\MissingAppKeyException No application encryption key has been specified.
- add header image to woocomerce shop page
- debug bar laravel print array
- create a blank page wordpress
- clear application cache in LARAVEL
- date('hms'
- array_reverse php
- catch get error php