Add groups page. Update landing Add toastmagic
This commit is contained in:
20
app/Models/Setting.php
Normal file
20
app/Models/Setting.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Setting extends Model
|
||||
{
|
||||
public $fillable = [
|
||||
'user_id',
|
||||
'key',
|
||||
'value',
|
||||
];
|
||||
|
||||
public function User(): belongsTo
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
@@ -45,4 +47,18 @@ class User extends Authenticatable
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
public function crews(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
Crew::class,
|
||||
'crew_members',
|
||||
'user_id',
|
||||
'crew_id'
|
||||
)->withTimestamps();
|
||||
}
|
||||
public function settings(): HasMany
|
||||
{
|
||||
return $this->hasMany(Setting::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user