Update source into github
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Post extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'post';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'slug',
|
||||
'thumbnail',
|
||||
'content',
|
||||
'status'
|
||||
];
|
||||
public function getStatus()
|
||||
{
|
||||
return match ((int)$this->status) {
|
||||
1 => '<span class="badge bg-success text-success-fg">Published</span>',
|
||||
2 => '<span class="badge bg-secondary text-secondary-fg">Draft</span>',
|
||||
default => '<span class="badge bg-warning text-warning-fg">Pending</span>',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user