Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel 6 use username on url

// using User->username instead of id on url:
public function show($user)
    {
  		// where<YourAtributeName>($param)->firstOrFail()
        $user = User::whereUsername($user)->firstOrFail();
        return view('users.show', ['user'=>$user]);
    }
Comment

PREVIOUS NEXT
Code Example
Php :: meta_value wordpress 
Php :: pessimistic locking laravel 
Php :: php undefined offset 
Php :: php-array-delete-by-value-not-key 
Php :: rand in codeigniter 
Php :: Detect Mobile Platform On Php 
Php :: artisan new view 
Php :: clear the compiled classes 
Php :: php break and continue 
Php :: Spatie vendor publish 
Php :: multiline string php 
Php :: install laravel scout 
Php :: php in html need .htaccess 
Php :: php functions 
Php :: cakephp 3 make migration 
Php :: Generate Laravel Migrations from an existing database 
Php :: what is isset in php 
Php :: compress video file size php 
Php :: redirect to codeigniter 4 
Php :: php strings 
Php :: laravel wherein like 
Php :: pagination in api laravel 
Php :: laravel email verification laravel 8 tutorial 
Php :: phpspreadsheet 
Php :: auto complete order 
Php :: Check Data Load More Laravel Livewire 
Php :: add line in string column export php 
Php :: where post_type like 
Php :: Include Or Require Multiple Files On 1 Line 
Php :: mysqli_query() expects parameter 1 to be mysqli 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =