Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel controller return message

#In Controller
use Session;
       
Session::flash('message', "Special message goes here");
return Redirect::back();

#In View
@if (Session::has('message'))
   <div class="alert alert-info">{{ Session::get('message') }}</div>
@endif
Comment

message get with return action laravel

return back()->with('message', 'WORKS!');

@if(session()->has('message'))
    <div class="alert alert-success">
        {{ session()->get('message') }}
    </div>
@endif
Comment

PREVIOUS NEXT
Code Example
Php :: job with queue name 
Php :: laravel request has 
Php :: do artisan laravel in code 
Php :: how to create 404 page in php website 
Php :: collection get first element laravel 
Php :: validate columns laravel excel 
Php :: get file request in laravel 
Php :: Difference in seconds between datetime 
Php :: get pages with template wp php 
Php :: wp rest api acf fields 
Php :: php class file upload 
Php :: update checkbox value in laravel 
Php :: laravel model set new attribute 
Php :: wordpress enable post thumbnail 
Php :: get git branch by php 
Php :: laravel factory in custom namespace 
Php :: eloquent first 
Php :: like %% inside the string php 
Php :: php if time is greater than 
Php :: php mysql prepared statements 
Php :: laravel has many with ids 
Php :: how-to-generate-an-xlsx-using-php 
Php :: Doctor Strange 
Php :: login page in php 
Php :: php date 
Php :: Laravel run seed table 
Php :: -store() laravel change name 
Php :: append in php 
Php :: php get country code from country name 
Php :: how to determine if file is empty in php 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =