first work on front events
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
@@ -11,6 +12,11 @@ class Event extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public function category() :BelongsTo
|
||||
{
|
||||
return $this->belongsTo(EventCategory::class, 'category_id');
|
||||
}
|
||||
|
||||
public function guests() :BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'event_guest')
|
||||
|
||||
Reference in New Issue
Block a user