for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Spatie\Activitylog\Traits\LogsActivity;
class Site extends Model
{
use LogsActivity;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name'
];
* The attributes to ignore in the Activity Log
protected static $ignoreChangedAttributes = ['updated_at'];
* The attributes to log in the Activity Log
protected static $logAttributes = [
* Only log those that have actually changed after the update.
protected static $logOnlyDirty = true;
* Update the updated_at and created_at timestamps?
public $timestamps = true;
* Get the locations for the site.
public function locations()
return $this->hasMany('App\Location');
}
* Get the devices for the site.
public function devices()
return $this->hasManyThrough('App\Device', 'App\Location');