Fix PIREP submission and field slug problems on PIREP edit

This commit is contained in:
Nabeel Shahzad
2018-05-30 14:00:20 -05:00
parent b7a6cb4fbc
commit a083f9c671
13 changed files with 102 additions and 47 deletions

View File

@@ -18,11 +18,21 @@ class FlightFieldValue extends Model
protected $fillable = [
'flight_id',
'name',
'slug',
'value',
];
public static $rules = [];
/**
* @param $name
*/
public function setNameAttribute($name): void
{
$this->attributes['name'] = $name;
$this->attributes['slug'] = str_slug($name);
}
/**
* Relationships
*/