mirror of
https://github.com/robonen/metr.git
synced 2026-03-20 02:44:42 +00:00
All models
This commit is contained in:
36
backend/app/Models/Offer.php
Normal file
36
backend/app/Models/Offer.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Offer extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'owner_id',
|
||||
'name',
|
||||
'type',
|
||||
'price',
|
||||
'rooms',
|
||||
'yandex_mark',
|
||||
'text',
|
||||
'is_group',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
// 'is_group' => 'boolean',
|
||||
];
|
||||
}
|
||||
21
backend/app/Models/OfferPhoto.php
Normal file
21
backend/app/Models/OfferPhoto.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OfferPhoto extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'offer_id',
|
||||
'file',
|
||||
];
|
||||
}
|
||||
35
backend/app/Models/Order.php
Normal file
35
backend/app/Models/Order.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'offer_id',
|
||||
'user_id',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'price',
|
||||
'discount',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'start_date' => 'datetime',
|
||||
'end_date' => 'datetime',
|
||||
];
|
||||
}
|
||||
23
backend/app/Models/Review.php
Normal file
23
backend/app/Models/Review.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Review extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'offer_id',
|
||||
'user_id',
|
||||
'comment',
|
||||
'rating',
|
||||
];
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
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;
|
||||
@@ -18,8 +17,12 @@ class User extends Authenticatable
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'middle_name',
|
||||
'email',
|
||||
'phone',
|
||||
'photo',
|
||||
'password',
|
||||
];
|
||||
|
||||
@@ -30,7 +33,6 @@ class User extends Authenticatable
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -38,7 +40,7 @@ class User extends Authenticatable
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
// protected $casts = [
|
||||
// 'email_verified_at' => 'datetime',
|
||||
// ];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user