PHP code example of touhidurabir / laravel-multi-key-route-binding

1. Go to this page and download the library: Download touhidurabir/laravel-multi-key-route-binding library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

touhidurabir / laravel-multi-key-route-binding example snippets


use Touhidurabir\MultiKyeRouteBinding\HasMultipleRouteBindingKeys;
use Illuminate\Database\Eloquent\Model;

class User extends Model {
    
    use HasMultipleRouteBindingKeys;
}

/**
 * The attributes that will be used for multiple key binding on route models
 *
 * @var array
 */
protected $routeBindingKeys = [
    'email',
    'username'
];

/**
 * Get the route key for the model.
 *
 * @return string
 */
public function getRouteKeyName()
{
    return 'slug';
}