| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App;
- /**
- * Class Address
- * @property int $id
- * @property string $address_1
- * @property string $address_2
- * @property string $city
- * @property string $county
- * @property string $postal_code
- * @property string $state
- * @property string $country
- * @property float $latitude
- * @property float $longitude
- */
- class Address extends Model {
- protected static $table = "address";
- protected static $idField = "id";
- protected static $fillableFields = ["address_1", "address_2", "city", "county", "postal_code", "state", "country", "latitude", "longitude"];
- // Static methods
- public static function getCountryOptions(): array {
- return [
- "FR" => __("France"),
- "DE" => __("Germany"),
- "JP" => __("Japan"),
- "ES" => __("Spain"),
- "GB" => __("United Kingdom"),
- ];
- }
- // Object methods
- public function hasGeolocation(): bool {
- return isset($this->latitude, $this->longitude);
- }
- }
|