add Meteo part
This commit is contained in:
16
app/Models/Location.php
Normal file
16
app/Models/Location.php
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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
11
app/Models/Weather.php
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user