Store the Data in a session in laravel
use session helper or put method $request->session()->put(‘key’, ‘value’); session([‘key’ => ‘value’]); Click here for more interview questions
use session helper or put method $request->session()->put(‘key’, ‘value’); session([‘key’ => ‘value’]); Click here for more interview questions
flash used to store the session for the next request. Data stored in the session for the subsequent request,this is used for short living message. $request->session()->flash(‘status’, ‘Task was successful!’); Click here for more interview questions
Session id Regeneration is doing in laravel to avoid session fixation attack problems. if you are using built in Logincontroller then sessionid will automaticaly regenerate. For manual generation use the below code $request->session()->regenerate(); Click here for more interview questions
forget method to remove piece of data from the session. $request->session()->forget(‘key’); remove data completely from the session we can use flush method $request->session()->flush(); Click here for more interview questions
Contracts are set of interfaces that provide core service and developer can write loosely typed code. For example mailer contract for sending mails in laravel Illuminate\Contracts\Mail\Mailer Click here for more interview questions
its field in the user table(or tables used for login purpose) it stores a string in this column For implementing remember me feature,you need to pass boolean value as the second parameter if (Auth::attempt([’email’ => $email, ‘password’ => $password], $remember)) { } This feature will keep the user aunthenticated undefinitely or untill they manually log… Read More »
Html form do not support PUT,PATCH,DELETE options. PUT,PATCH,DELETE routes that are called from an html form, this time we need to add a hidden _method field in the form Click here for more interview questions
Service provider will bootstrap all of the framework component such as database,queue,validation,routing components All of the service providers are configured in the config/app.php provider array. register() and boot() method will be called on all service providers,after this request will dispatch to route and controller Default service providers are stored in the app/Providers folder Click here… Read More »
Click here for more interview questions Two types of kernel available in laravel, Http kernel- app/http/kernel.php Console kernel- console/kernel.php Kernel defines the list of midddleware and middleware will handle session,aunthentication,verifycsrftoken etc. Kernel extends base class- Illuminate\Foundation\Http\Kernel it defines bootstrappers .Thesse bootstrapers configure error handling,logging,detecting application environment Click here for more interview questions
Click here for more interview questions Middleware acts as bridge between request and response. Middleware verifies the user is authenticated or not depends on this it is redirect to home and login page. command to create middleware php artisan make:middleware Two types of middleware in laravel global middleware- run on every http request routemiddleware-assigned to… Read More »