使用php artisan make:auth
然後:
要從用戶更改默認的表,使用用戶模型 你必須導航到:config/auth.php
而做出這些改變
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\UsersTable::class, //put the right model name here or you can use database driver
],
],
若要更改表雄辯的模型,你可以做到這一點
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class UsersTable extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'UsersTable';
}
從電子郵件更改默認的登錄憑證用戶名,只需將其添加到Authcontroller通過laravel產生現在
class AuthController extends Controller
{
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
protected $redirectTo = '/home';
protected $username = 'username'; // you can put whatever column you want here from your table
編輯laravel生成視圖和更改電子郵件輸入名稱name="username"
然後延長main.blade.php
,做一些造型,你是好去我猜
編輯:不要忘記更改驗證的東西
謝謝!密碼字段怎麼樣?我可以做$ password ='PassWordField'嗎? – srakrn
嗯,我真的不知道這可是給它一個鏡頭,並順便說一句,如果這個工作適合你,請根據投票部分滴答作響的綠色標記爲已回答宣佈了這個問題 –