You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
545 B
26 lines
545 B
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ContactMessage extends Model
|
|
{
|
|
protected $fillable = ['business_id', 'subject', 'name', 'email', 'phone_number', 'text', 'data'];
|
|
|
|
public function setDataAttribute($value)
|
|
{
|
|
$this->attributes['data'] = json_encode($value, JSON_UNESCAPED_UNICODE);
|
|
}
|
|
|
|
public function getDataAttribute()
|
|
{
|
|
return json_decode($this->attributes['data']);
|
|
}
|
|
|
|
public function business()
|
|
{
|
|
return $this->belongsTo('App\Business');
|
|
}
|
|
}
|