Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use \DateTimeInterface;
- class Position extends Model
- {
- use HasFactory;
- public $table = 'positions';
- protected $dates = [
- 'created_at',
- 'updated_at',
- 'deleted_at',
- ];
- protected $fillable = [
- 'position',
- 'banner_id',
- 'created_at',
- 'updated_at',
- 'deleted_at',
- ];
- protected function serializeDate(DateTimeInterface $date)
- {
- return $date->format('Y-m-d H:i:s');
- }
- public function banner()
- {
- return $this->belongsTo(Banner::class, 'banner_id');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment