feat: implement flight show blade and comments flight
This commit is contained in:
+43
-20
@@ -6,40 +6,63 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\CommentStatus;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Comment
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int|null $user_id
|
||||
* @property int|null $flight_id
|
||||
* @property int|null $tour_id
|
||||
* @property string|null $guest_name
|
||||
* @property string|null $guest_email
|
||||
* @property string $comment
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
*
|
||||
* @property User $user
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @property User|null $user
|
||||
* @property Flight|null $flight
|
||||
* @property Tour|null $tour
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Comment extends Model
|
||||
{
|
||||
protected $table = 'comments';
|
||||
public $timestamps = false;
|
||||
protected $table = 'comments';
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'flight_id' => 'int',
|
||||
'tour_id' => 'int',
|
||||
'status' => CommentStatus::class,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'comment',
|
||||
'status'
|
||||
];
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'flight_id',
|
||||
'tour_id',
|
||||
'guest_name',
|
||||
'guest_email',
|
||||
'comment',
|
||||
'status',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function flight()
|
||||
{
|
||||
return $this->belongsTo(Flight::class, 'flight_id');
|
||||
}
|
||||
|
||||
public function tour()
|
||||
{
|
||||
return $this->belongsTo(Tour::class, 'tour_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user