penambahan slug pada status permohonan

This commit is contained in:
Daeng Deni Mardaeni 2024-08-27 10:23:32 +07:00
parent fec80bfa1c
commit 3c59943a08
4 changed files with 7 additions and 2 deletions

View File

@ -22,6 +22,7 @@
return [
$row->id,
$row->name,
$row->slug,
$row->description,
$row->status,
$row->created_at
@ -34,6 +35,7 @@
return [
'ID',
'Name',
'Slug',
'Description',
'Status',
'Created At'
@ -45,7 +47,7 @@
{
return [
'A' => NumberFormat::FORMAT_NUMBER,
'E' => NumberFormat::FORMAT_DATE_DATETIME
'F' => NumberFormat::FORMAT_DATE_DATETIME
];
}
}

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Str;
class StatusPermohonanRequest extends FormRequest
{
@ -38,6 +39,7 @@
{
$this->merge([
'status' => isset($this->status) ? 1 : 0,
'slug'=> Str::slug($this->name)
]);
}
}

View File

@ -5,5 +5,5 @@
class StatusPermohonan extends Base
{
protected $table = 'status_permohonan';
protected $fillable = ['name', 'description','status'];
protected $fillable = ['name', 'description','status','slug'];
}

View File

@ -14,6 +14,7 @@ return new class extends Migration
Schema::create('status_permohonan', function (Blueprint $table) {
$table->id();
$table->string('name')->unique();
$table->string('slug')->nullable();
$table->string('description')->nullable();
$table->boolean('status')->default(true)->nullable();
$table->timestamps();