first work on front events

This commit is contained in:
2020-08-24 07:55:32 +02:00
parent 0f4250a029
commit f466ce7cc9
17 changed files with 575 additions and 32 deletions

View File

@@ -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')