Selim Selim - 7 months ago 71
PHP Question

Laravel - sql query with session

I would like to display the table based on SESSION USERNAME and using the following query but I am getting error.

SELECT tb_list.* FROM tb_list
WHERE username = ".Session::get('username')."

Error: Class 'App\Models\Session' not found

Could you please help me



You have to use Session class like:

use Session; 


use Illuminate\Support\Facades\Session;