class Order extends Model
{
public function sms()
{
return $this->belongsToMany('App\Sms')->using('App\OrderSms')->withTimestamps();
}
}
class Sms extends Model
{
public $timestamps = false;
protected $fillable = ['subject', 'template'];
}
class OrderSms extends Pivot
{
protected $table = 'order_sms';
}
OrderSms::where('red_sms_id', $smsId)->update([
'status' => $status
]);
As result is Call to a member function getUpdatedAtColumn() on null
.
I have to use:
DB::table('order_sms')->where('red_sms_id', $smsId)->update([
'status' => $status,
'updated_at' => Carbon::now()
]);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community