mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
book cases added
This commit is contained in:
@@ -4,10 +4,12 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\Comments\Models\Concerns\HasComments;
|
||||
|
||||
class BookCase extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasComments;
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
@@ -28,4 +30,22 @@ class BookCase extends Model
|
||||
'digital' => 'boolean',
|
||||
'deactivated' => 'boolean',
|
||||
];
|
||||
|
||||
/*
|
||||
* This string will be used in notifications on what a new comment
|
||||
* was made.
|
||||
*/
|
||||
public function commentableName(): string
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/*
|
||||
* This URL will be used in notifications to let the user know
|
||||
* where the comment itself can be read.
|
||||
*/
|
||||
public function commentUrl(): string
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
40
app/Models/OrangePill.php
Normal file
40
app/Models/OrangePill.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrangePill extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'user_id' => 'integer',
|
||||
'book_case_id' => 'integer',
|
||||
'date' => 'datetime',
|
||||
];
|
||||
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function bookCase(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
{
|
||||
return $this->belongsTo(BookCase::class);
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,11 @@ use Laravel\Fortify\TwoFactorAuthenticatable;
|
||||
use Laravel\Jetstream\HasProfilePhoto;
|
||||
use Laravel\Jetstream\HasTeams;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Spatie\Comments\Models\Concerns\InteractsWithComments;
|
||||
use Spatie\Comments\Models\Concerns\Interfaces\CanComment;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable implements MustVerifyEmail
|
||||
class User extends Authenticatable implements MustVerifyEmail, CanComment
|
||||
{
|
||||
use HasApiTokens;
|
||||
use HasFactory;
|
||||
@@ -21,6 +23,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
use Notifiable;
|
||||
use TwoFactorAuthenticatable;
|
||||
use HasRoles;
|
||||
use InteractsWithComments;
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user