lundi 2 novembre 2015

Laravel 5 pagination send to veiw with other variables

I have this bunch of codes

        $result= AccessControl::getUserAccess("/admin/users/user");
        if($result==1)
         {
             return redirect("/");
         }
         else
         {
           //$user= Users::Tenant((int)session()->get('tenantId'))->get();
           $user= Users::Tenant((int)session()->get('tenantId'))->paginate();
           return response()->json(["Users"=>$user,"Access_level"=>$result]);
         } 

With the above, I kept getting an null for $user object on the front-end. But when I returned the$user object, that contains all expected for the pagination. How do I include Access_level as part of that to the user using json still?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire