initial round of changes from Claude
This commit is contained in:
56
app/Models/WeatherPeriod.php
Normal file
56
app/Models/WeatherPeriod.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class WeatherPeriod extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\WeatherPeriodFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'weather_report_id',
|
||||
'period_number',
|
||||
'name',
|
||||
'start_time',
|
||||
'end_time',
|
||||
'is_daytime',
|
||||
'temperature',
|
||||
'temperature_unit',
|
||||
'precipitation_probability',
|
||||
'dewpoint_celsius',
|
||||
'relative_humidity',
|
||||
'wind_speed',
|
||||
'wind_direction',
|
||||
'icon_url',
|
||||
'short_forecast',
|
||||
'detailed_forecast',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'start_time' => 'datetime',
|
||||
'end_time' => 'datetime',
|
||||
'is_daytime' => 'boolean',
|
||||
'temperature' => 'integer',
|
||||
'precipitation_probability' => 'integer',
|
||||
'dewpoint_celsius' => 'decimal:2',
|
||||
'relative_humidity' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<WeatherReport, $this>
|
||||
*/
|
||||
public function report(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(WeatherReport::class, 'weather_report_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user