This commit is contained in:
2025-07-26 13:25:50 +05:00
commit 69dd14e06c
311 changed files with 50685 additions and 0 deletions

45
app/Models/Brand.php Normal file
View File

@@ -0,0 +1,45 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
/**
* @property int $id
* @property string $name
* @property string $image
* @property boolean $active
* @property \Illuminate\Support\Facades\Date $created_at
* @property \Illuminate\Support\Facades\Date $updated_at
*/
class Brand extends Model
{
/**
* Casts
* @var array<string, string>
*/
protected $casts = [
'active' => 'boolean',
];
/**
* Booted
*/
protected static function booted(): void
{
static::deleted(function ($model) {
if ($model->image) {
Storage::disk('public')->delete($model->image);
}
});
}
/**
* Image url
*/
public function imageUrl(): string
{
return url('/storage/' . $this->image);
}
}

48
app/Models/User.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
}