<?php namespace App\Pivots; use Illuminate\Database\Eloquent\Relations\Pivot; class ViaPivot extends Pivot { protected $casts = [ 'datetime' => 'datetime', ]; }