Add a PIREP flag for ready_only; some more METAR cleanup

This commit is contained in:
Nabeel Shahzad
2018-04-09 22:04:59 -05:00
parent 4a19f609fc
commit f54f19100c
13 changed files with 170 additions and 313 deletions

View File

@@ -39,6 +39,7 @@ use PhpUnitsOfMeasure\Exception\NonStringUnitName;
* @property Carbon submitted_at
* @property Carbon created_at
* @property Carbon updated_at
* @property bool state
* @package App\Models
*/
class Pirep extends Model
@@ -174,6 +175,14 @@ class Pirep extends Model
}
}
/**
* Return if this PIREP can be edited or not
*/
public function getReadOnlyAttribute(): bool
{
return $this->state !== PirepState::PENDING;
}
/**
* Return a new Fuel unit so conversions can be made
* @return int|Fuel