ifx merge for update
This commit is contained in:
10
app/Models/Event.php
Normal file
10
app/Models/Event.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Event extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
}
|
||||
10
app/Models/EventCategory.php
Normal file
10
app/Models/EventCategory.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EventCategory extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -41,4 +41,14 @@ class Memo extends Model
|
||||
$userImage->path = 'images/default-cover.jpg';
|
||||
});
|
||||
}
|
||||
|
||||
public function thumbnailImage(): MorphOne
|
||||
{
|
||||
return $this->morphOne(Image::class, 'imageable')
|
||||
->orderBy('id', 'desc')
|
||||
->where('location', 'cover-small')
|
||||
->withDefault(function ($userImage) {
|
||||
$userImage->path = 'images/default-cover.jpg';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App;
|
||||
|
||||
use App\Models\Bookmark;
|
||||
use App\Models\Event;
|
||||
use App\Models\Image;
|
||||
use App\Models\Memo;
|
||||
use App\Models\ToDoList;
|
||||
@@ -94,4 +95,19 @@ class User extends Authenticatable
|
||||
$userImage->path = 'images/default-cover.jpg';
|
||||
});
|
||||
}
|
||||
|
||||
public function thumbnailImage(): MorphOne
|
||||
{
|
||||
return $this->morphOne(Image::class, 'imageable')
|
||||
->orderBy('id', 'desc')
|
||||
->where('location', 'profile-small')
|
||||
->withDefault(function ($userImage) {
|
||||
$userImage->path = 'images/default-cover.jpg';
|
||||
});
|
||||
}
|
||||
|
||||
public function events(): HasMany
|
||||
{
|
||||
return $this->hasMany(Event::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user