Loading .gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -15,3 +15,4 @@ yarn-error.log /.vscode server.php index.php resources/view/test.blade.php app/Models/User.php +7 −29 Original line number Diff line number Diff line Loading @@ -7,38 +7,16 @@ use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; use Illuminate\Database\Eloquent\Model; class User extends Authenticatable class User extends Model { use HasApiTokens, HasFactory, Notifiable; use HasFactory, Notifiable, HasApiTokens; /** * The attributes that are mass assignable. * * @var array<int, string> */ protected $fillable = [ 'name', 'email', 'password', ]; protected $table = 'CAR_USER'; /** * The attributes that should be hidden for serialization. * * @var array<int, string> */ protected $hidden = [ 'password', 'remember_token', ]; protected $primaryKey = 'US_ID'; /** * The attributes that should be cast. * * @var array<string, string> */ protected $casts = [ 'email_verified_at' => 'datetime', ]; } ?> resources/views/test.blade.php 0 → 100644 +12 −0 Original line number Diff line number Diff line <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> {{$user->US_NAME}} </body> </html> routes/web.php +8 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,14 @@ | */ use App\Models\User; Route::get('/', function () { return view('welcome'); }); Route::get('/', function() { return view('test', ['user' => User::find(1)]); }); Loading
.gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -15,3 +15,4 @@ yarn-error.log /.vscode server.php index.php resources/view/test.blade.php
app/Models/User.php +7 −29 Original line number Diff line number Diff line Loading @@ -7,38 +7,16 @@ use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; use Illuminate\Database\Eloquent\Model; class User extends Authenticatable class User extends Model { use HasApiTokens, HasFactory, Notifiable; use HasFactory, Notifiable, HasApiTokens; /** * The attributes that are mass assignable. * * @var array<int, string> */ protected $fillable = [ 'name', 'email', 'password', ]; protected $table = 'CAR_USER'; /** * The attributes that should be hidden for serialization. * * @var array<int, string> */ protected $hidden = [ 'password', 'remember_token', ]; protected $primaryKey = 'US_ID'; /** * The attributes that should be cast. * * @var array<string, string> */ protected $casts = [ 'email_verified_at' => 'datetime', ]; } ?>
resources/views/test.blade.php 0 → 100644 +12 −0 Original line number Diff line number Diff line <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> {{$user->US_NAME}} </body> </html>
routes/web.php +8 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,14 @@ | */ use App\Models\User; Route::get('/', function () { return view('welcome'); }); Route::get('/', function() { return view('test', ['user' => User::find(1)]); });