Commit 4119edbd authored by Waterfox's avatar Waterfox
Browse files

Add User model

parent bd19dc07
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,3 +15,4 @@ yarn-error.log
/.vscode
server.php
index.php
resources/view/test.blade.php
+7 −29
Original line number Diff line number Diff line
@@ -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',
    ];
}

?>
+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>
+8 −0
Original line number Diff line number Diff line
@@ -13,6 +13,14 @@
|
*/

use App\Models\User;

Route::get('/', function () {
    return view('welcome');
});

Route::get('/', function()
{
    return view('test', ['user' => User::find(1)]);
});