It's a link how to do that.
<a href="{{ url('/settings/account',Auth::user()->id) }}/edit">Update Account </a>
when I change the route like so:
Route::post('settings/account/{id}/edit','UserController@editProfile ');
then I get this error
MethodNotAllowedHttpException in RouteCollection.php line 219:
You only need to register a second route, and then solve it in the method itself, by checking if you have an user id or not.
if not, you can get it from Auth::user()->id
Or am i wrong?
auth user id should be passed to update method in the controller and it is passed and as you see above at the link,so I want to hide this param I mean should not be displayed in the url.
In your controller set your query by how ever and return the view and data with out using data in the url.
@mke -media yes auth()->user()->Id is an option but auth()->id() is faster.
@jekinney Yeah you are right, but result is the same.
Use auth()->id() instead of the url parameter thats all.
Please sign in or create an account to participate in this conversation.