このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
- 2024.01.18 RailsでSSLエラー 以前のリビジョンを復元 (2024/01/18 07:06)
- 31 CentOS5 TLS1.2 created
- 2024.04.12 MySQL BIT Field created
最近の更新
$ php artisan make:auth
app/User.phpが作成される。
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends \TCG\Voyager\Models\User
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}
web.phpが更新される。
下記が追加される
Auth::routes(); Route::get('/home', 'HomeController@index')->name('home');
app/Http/Controllers/HomeController.phpが作成される。
app/Http/Controllers/HomeController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('home');
}
}
┗app ┗Http ┗Controllers ┗Auth ┣ForgotPasswordController.php ┣LoginController.php ┣RegisterController.php ┗ResetPasswordController.php
resources ┗views ┣auth ┃┣passwords ┃┃┣email.blade.php ┃┃┗reset.blade.php ┃┣login.blade.php ┃┗register.blade.php ┣layouts ┃┗app.blade.php ┗home.blade.php
┗database ┗migrations ┣2014_10_12_000000_create_users_table.php ┗2014_10_12_100000_create_password_resets_table.php