2017-08-02 23:17:54 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2019-07-16 03:44:31 +08:00
|
|
|
use App\Contracts\Model;
|
2018-03-20 09:50:40 +08:00
|
|
|
|
2017-08-02 23:17:54 +08:00
|
|
|
/**
|
2020-04-01 13:05:09 +08:00
|
|
|
* @property string $pirep_id
|
|
|
|
* @property int $user_id
|
|
|
|
* @property Pirep $pirep
|
|
|
|
* @property User $user
|
2017-08-02 23:17:54 +08:00
|
|
|
*/
|
2018-03-20 09:50:40 +08:00
|
|
|
class PirepComment extends Model
|
2017-08-02 23:17:54 +08:00
|
|
|
{
|
|
|
|
public $table = 'pirep_comments';
|
|
|
|
|
2018-03-21 08:40:19 +08:00
|
|
|
protected $fillable = [
|
2018-01-04 05:27:56 +08:00
|
|
|
'pirep_id',
|
|
|
|
'user_id',
|
|
|
|
'comment',
|
|
|
|
];
|
2017-08-02 23:17:54 +08:00
|
|
|
|
2018-01-04 05:27:56 +08:00
|
|
|
public static $rules = [
|
|
|
|
'comment' => 'required',
|
|
|
|
];
|
2017-08-02 23:17:54 +08:00
|
|
|
|
|
|
|
public function pirep()
|
|
|
|
{
|
2018-01-08 23:22:12 +08:00
|
|
|
return $this->belongsTo(Pirep::class, 'pirep_id');
|
2017-08-02 23:17:54 +08:00
|
|
|
}
|
2018-01-04 05:27:56 +08:00
|
|
|
|
|
|
|
public function user()
|
|
|
|
{
|
2018-01-08 23:22:12 +08:00
|
|
|
return $this->belongsTo(User::class, 'user_id');
|
2018-01-04 05:27:56 +08:00
|
|
|
}
|
2017-08-02 23:17:54 +08:00
|
|
|
}
|