-1

Greetings guys can you point to me what is the problem here?

This is the code that produces the error. That is in my views:

<h7 id="header-label">Welcome, {{ $fname }} |</h7>

This is the controller:

class ProfileController extends BaseController {


    public function showProfile() {
        $items = DB::table('item_tbl')->get();
     //     Auth::check();

     //     if (Auth::check())
        // {
        //     return "true";
        // } else {
        //  return "false";
        // }
        //$fname = Auth::user()->[firstname];
        // var_dump(Session::get('fname'));
        return View::make('profile')->with('items', $items);
    }
}

and this is the model:

if (Auth::attempt(array('username' => $data['username'], 'password' => $data['password'])))
        {   
            $fname = Auth::user()->firstname;
            return Redirect::to('profile');
            //return View::make('profile')->with('name', $fname);
            //return Redirect::to('profile')->with('name', $fname);
            // $fname =;

        } else {
            return Redirect::back()
                ->with('message', 'Invalid username/password');
        }

This is my route:

Route::get('profile', 'ProfileController@showProfile');

I break those codes down. I found out that; when i use the Session::get('fname') it returns null.

Names of the Controller and Views
Controller - ProfileController
Views - profile.blade.php

4
Contributors
6
Replies
26
Views
2 Years
Discussion Span
Last Post by pritaeas
0

And also it always return false when i use

Auth::check()

0

yeah cause i posted it on the wrong forum but it's not actually solved.

0

For the future, please flag the article, someone will move it for you. Cereal posted a potential answer for you in the other thread.

Multiple threads may/can be confusing for members and also cause disjointed discussions.

0

Sorry for that XD. But can i request to delete this post XD?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.