reconstruction of the project

This commit is contained in:
root
2026-03-08 16:33:24 -04:00
parent 23b7db1107
commit c8de5f7edc
9157 changed files with 77877 additions and 1073823 deletions
+18 -20
View File
@@ -2,15 +2,15 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\BaseModel;
class AuthorizedUser extends Model
class AuthorizedUser extends BaseModel
{
use HasFactory;
protected $table = 'authorized_users'; // Table name
protected $primaryKey = 'id';
public $incrementing = true;
protected $table = 'authorized_users';
// ✅ auto-manage created_at / updated_at
public $timestamps = true;
protected $fillable = [
'user_id',
'authorized_user_id',
@@ -26,24 +26,22 @@ class AuthorizedUser extends Model
'updated_at',
];
// Laravel manages created_at + updated_at automatically
public $timestamps = true;
protected $casts = [
'user_id' => 'integer',
'user_id' => 'integer',
'authorized_user_id' => 'integer',
'email' => 'string',
'firstname' => 'string',
'lastname' => 'string',
'phone_number' => 'string',
'relation_to_user' => 'string',
'token' => 'string',
'status' => 'string',
];
// Relationship: Each authorized user belongs to a user
/* =========================
* Relationships (optional)
* ========================= */
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
}
public function authorizedUser()
{
return $this->belongsTo(User::class, 'authorized_user_id');
}
}