refactor: move backend in apps/backend
This commit is contained in:
1 parent
cf529278bd
commit
e2b471312c
178 files changed
+210
-193
No files matched your search
Executable
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace apps\backend\app\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Event extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $fillable = [
|
||||
"name",
|
||||
"description",
|
||||
"event_photo_path",
|
||||
'start',
|
||||
'end',
|
||||
];
|
||||
|
||||
public function tasks() {
|
||||
return $this->hasMany(Task::class, 'events_id');
|
||||
}
|
||||
}
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace apps\backend\app\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Task extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'start',
|
||||
'end',
|
||||
'location',
|
||||
'description',
|
||||
'max_participants',
|
||||
];
|
||||
|
||||
public function event() {
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
public function users() {
|
||||
return $this->belongsToMany(User::class);
|
||||
}
|
||||
|
||||
}
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace apps\backend\app\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<\apps\backend\database\factories\UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'lastname',
|
||||
'email',
|
||||
'password',
|
||||
'phone',
|
||||
'validate',
|
||||
'role',
|
||||
'verified_at',
|
||||
'profile_photo_path',
|
||||
'email_notifications',
|
||||
'web_notifications'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
public function tasks() {
|
||||
return $this->belongsToMany(Task::class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user