I'm new to Laravel, and after running php artisan make:auth, the associated home.blade.php file uses a call to check for and display session('status').
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="card">
<div class="card-header">Dashboard</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div>
@endif
You are logged in!
</div>
</div>
</div>
@endsection
Does this actually do anything? I've searched and drilled through many files and can't find out if this is actually used.
Sessions are used to store information about the user across the requests. Laravel provides various drivers like file, cookie, apc, array, Memcached, Redis, and database to handle session data. By default, file driver is used because it is lightweight.
The session "driver" defines where session data will be stored for each request. Laravel ships with several great drivers out of the box: file - sessions will be stored in storage/framework/sessions . cookie - sessions will be stored in secure, encrypted cookies.
If you just want to see contents of session, try dd() : dd(session()->all()); If not, just use this to get all info: $data = session()->all();
The correct syntax for this is: Session::set('variableName', $value); For Laravel 5.4 and later, the correct method to use is put : Session::put('variableName', $value);
Inside Laravel's core files ( inside vendor )
vendor\laravel\framework\src\Illuminate\Foundation\Auth\ResetsPasswords.php
it is used.
Look for the function,
protected function sendResetResponse($response)
It returns the status with success string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With