Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/Console/Commands/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public function handle()
$modelNama = $this->argument('modelName');

$this->call('make:model', ['name' => $modelNama, '-m' => true]);
$this->call('make:policy', ['name' => $modelNama . 'Policy']);
$this->call('make:policy', ['name' => $modelNama.'Policy']);
$this->call('nova:resource', ['name' => $modelNama]);

}
}
1 change: 0 additions & 1 deletion app/Models/KerangkaAcuan.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ protected static function booted(): void
$kak->deleteAssociatedRecords();
$ids = PerjalananDinas::where('kerangka_acuan_id', $kak->id)->pluck('id');
PerjalananDinas::destroy($ids);

});

static::created(function (KerangkaAcuan $kak) {
Expand Down
1 change: 0 additions & 1 deletion app/Models/MasterWilayah.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ public static function cacheEntities(): array
}),
];
}

}
5 changes: 2 additions & 3 deletions app/Models/RateTranslok.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class RateTranslok extends Model
{
use LaraCache;

public static function cacheEntities(): array
{
return [
Expand All @@ -26,6 +27,7 @@ public static function cacheEntities(): array
'tujuan_master_wilayah_id',

];

public function getTitleAttribute()
{
return "{$this->asalMasterWilayah->wilayah} - {$this->tujuanMasterWilayah->wilayah} ({$this->skTranslok->tahun})";
Expand All @@ -45,7 +47,4 @@ public function tujuanMasterWilayah(): BelongsTo
{
return $this->belongsTo(MasterWilayah::class, 'tujuan_master_wilayah_id');
}



}
1 change: 0 additions & 1 deletion app/Models/SkTranslok.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ public function rateTransloks(): HasMany
{
return $this->hasMany(RateTranslok::class);
}

}
6 changes: 2 additions & 4 deletions app/Models/UserEksternal.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ class UserEksternal extends Model

public function setGolonganAttribute($value)
{
if (! empty($this->attributes['golongan']))
{
if (! empty($this->attributes['golongan'])) {
$this->attributes['golongan'] = $value;
$this->attributes['pangkat'] = Helper::$pangkat[$value];
}

}

public static function cacheEntities(): array
{
return [
Expand Down
5 changes: 0 additions & 5 deletions app/Nova/Actions/AddPerjalananDinas.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace App\Nova\Actions;

use App\Helpers\Helper;
use App\Models\PerjalananDinas;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Collection;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Actions\ActionResponse;
use Laravel\Nova\Fields\ActionFields;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Http\Requests\NovaRequest;

class AddPerjalananDinas extends Action
Expand All @@ -23,7 +20,6 @@ public function name()
return 'Tambahkan Perjalalan Dinas';
}


/**
* Perform the action on the given models.
*
Expand All @@ -42,7 +38,6 @@ public function handle(ActionFields $fields, Collection $models)
$perjalanan->save();

return ActionResponse::redirect('perjalanan-dinas/'.$perjalanan->id.'/edit');

}

/**
Expand Down
5 changes: 3 additions & 2 deletions app/Nova/RateTranslok.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public static function label()
*/
public static $title = 'title';

public function subtitle(){
public function subtitle()
{
return Helper::formatUang($this->rate);
}

Expand All @@ -42,7 +43,7 @@ public function subtitle(){
* @var array
*/
public static $search = [
'asalMasterWilayah.wilayah', 'tujuanMasterWilayah.wilayah'
'asalMasterWilayah.wilayah', 'tujuanMasterWilayah.wilayah',
];

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Nova/SkTranslok.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Laravel\Nova\Http\Requests\NovaRequest;

class SkTranslok extends Resource
{
{
public static $with = ['rateTransloks'];
/**
* The model the resource corresponds to.
Expand Down