feat:implement RegisterController.php

This commit is contained in:
2026-08-16 10:50:53 -07:00
parent aea85618fc
commit 279375a19e
12 changed files with 758 additions and 12 deletions
+48
View File
@@ -0,0 +1,48 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class City
*
* @property int $id
* @property int $province_id
* @property string $name
*
* @property Province $province
* @property Collection|User[] $users
*
* @package App\Models
*/
class City extends Model
{
protected $table = 'cities';
public $timestamps = false;
public static $snakeAttributes = false;
protected $casts = [
'province_id' => 'int'
];
protected $fillable = [
'province_id',
'name'
];
public function province()
{
return $this->belongsTo(Province::class);
}
public function users()
{
return $this->hasMany(User::class);
}
}
+42
View File
@@ -0,0 +1,42 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Province
*
* @property int $id
* @property string $name
*
* @property Collection|City[] $cities
* @property Collection|User[] $users
*
* @package App\Models
*/
class Province extends Model
{
protected $table = 'provinces';
public $timestamps = false;
public static $snakeAttributes = false;
protected $fillable = [
'name'
];
public function cities()
{
return $this->hasMany(City::class);
}
public function users()
{
return $this->hasMany(User::class);
}
}
+19 -6
View File
@@ -26,15 +26,16 @@ use Illuminate\Foundation\Auth\User as Authenticated;
* @property int|null $file_id
* @property string $username
* @property string $password
* @property string $password_confirmation
* @property string $user_Province
* @property string $user_city
* @property int $province_id
* @property int $city_id
* @property int $status
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Carbon $deleted
*
* @property File|null $file
* @property Province $province
* @property City $city
* @property Collection|Booking[] $bookings
* @property Collection|Comment[] $comments
*
@@ -43,11 +44,14 @@ use Illuminate\Foundation\Auth\User as Authenticated;
class User extends Authenticated
{
protected $table = 'users';
public static $snakeAttributes = false;
protected $casts = [
'gender' => 'int',
'marital_status' => 'int',
'file_id' => 'int',
'province_id' => 'int',
'city_id' => 'int',
'status' => 'int',
'deleted' => 'datetime'
];
@@ -68,9 +72,8 @@ class User extends Authenticated
'file_id',
'username',
'password',
'password_confirmation',
'user_Province',
'user_city',
'province_id',
'city_id',
'status',
'deleted'
];
@@ -80,6 +83,16 @@ class User extends Authenticated
return $this->belongsTo(File::class);
}
public function province()
{
return $this->belongsTo(Province::class);
}
public function city()
{
return $this->belongsTo(City::class);
}
public function bookings()
{
return $this->hasMany(Booking::class);