vendredi 24 juin 2016

My alert is not showing in laravel 5

this is my PostController.php,

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Depress;
use App\Http\Requests;

class PostController extends Controller
{
    public function createPost(Request $request)
    {

        $depress = new Depress();
        $depress->depression = $request['depression'];
        if($request['name'])
            $depress->name = $request['name'];
        else
            $depress->name = "Depressed Anonymous";
        $depress->save();
        \Session::flash('info','Success');
        return redirect()->route('home');

    }
}

And This is my alert.blade.php,

@if(Session::has('info'))
    <div class="alert alert-success alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        
    </div>
    <br>
@endif

And, I have included it in my layout.blade.php

But, no alert shows up...

thanks in advance



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/28Svi5t
via IFTTT

Aucun commentaire:

Enregistrer un commentaire