whenever i tried to use Auth::User()
i am getting non object property because my Auth::guest()
returns true whenever i use them in service provider
use IlluminateContractsViewView;
use IlluminateSupportServiceProvider;
use IlluminateContractsViewFactory;
use App
elations;
use AppUser;
use DB;
use IlluminateSupportFacadesAuth;
class RelationServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
Auth::User()->id;
$relation_friend_for_logged_user = DB::select( DB::raw("SELECT * FROM users"));
$value = "asd";
// for injecting objct
View()->share('count', $value);
}
but why Auth::guest()
is returning true whether i am logged in
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…