lundi 20 janvier 2020

How to use resource option of user page in laravel?

I have tried to use resource instead of get and post in user page .

Url :

  <a href="mybalance"></i><i class="fa fa-user"></i> My Balance</a>

Route :

  Route::resource('mybalance',  'RechargeController');

Controller :

public function index(Request $request)
{   
     $id= $request->user()->id;
     $user = User::find($id);
     //$id = Auth::user()->id;
     //$request = DB::table('users')->where('id', $id)->first();
     //dd($id); exit;
     return view('frontend.balance.index',compact('user'));
}

But the link could not work. How to deals with this error?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire