Add a PIREP flag for ready_only; some more METAR cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user