i try to get the user id in ServiceProvider but Auth::user() return null after successfully login where is the problem ?
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use View;
use App\Offer;
use Auth;
class MasterPageProfileServiceProvider extends ServiceProvider
{
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
dd(Auth::user()); // => null
$offersTrashed = Offer::onlyTrashed()->where('user_id',Auth::user()->id)->get();
View::share('offersTrashed', $offersTrashed);
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire