add Meteo part

This commit is contained in:
Romulus21
2023-09-24 11:19:58 +02:00
parent bfaf82f264
commit 33b2044859
23 changed files with 429 additions and 31 deletions

16
app/Models/Location.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Location extends Model
{
protected $guarded = [];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}

View File

@@ -44,6 +44,11 @@ class User extends Authenticatable
'password' => 'hashed',
];
public function locations(): HasMany
{
return $this->hasMany(Location::class);
}
public function rainfalls(): HasMany
{
return $this->hasMany(Rainfall::class);

11
app/Models/Weather.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Weather extends Model
{
use HasFactory;
}