Laravel User Profile


/ Published in: PHP
Save to your folder(s)

This is a route that ables the website to show the user's profile to the world.


Copy this code and paste it in your HTML
  1. Route::get('(:any)', function($username){
  2. $user = User::where_username($username)->first();
  3. if ($user) {
  4. return "The user exist, show the profile.";
  5. }
  6. return Response::error('404');
  7. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.