Set fields to pireps in prefile/update calls
This commit is contained in:
@@ -2,11 +2,8 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class PirepField
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class PirepField extends BaseModel
|
||||
@@ -49,4 +46,14 @@ class PirepField extends BaseModel
|
||||
$model->slug = str_slug($model->name);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* When setting the name attribute, also set the slug
|
||||
* @param $name
|
||||
*/
|
||||
public function setNameAttribute($name)
|
||||
{
|
||||
$this->attributes['name'] = $name;
|
||||
$this->attributes['slug'] = str_slug($name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user