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
6 changes: 3 additions & 3 deletions app/Imports/MataAnggaransImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function collection(Collection $rows)
KamusAnggaran::updateOrCreate(
['mak' => $mak],
[
'detail' => $row[1],
'dipa_id' => $this->dipa_id,
'updated_at' => now(),
'detail' => $row[1],
'dipa_id' => $this->dipa_id,
'updated_at' => now(),
]
);
if (strlen($mak) == 37) {
Expand Down
3 changes: 0 additions & 3 deletions app/Models/Dipa.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Models;

use App\Models\KamusAnggaran;
use App\Models\MataAnggaran;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
Expand Down Expand Up @@ -34,7 +32,6 @@ public function kamusAnggaran(): HasMany
return $this->hasMany(KamusAnggaran::class);
}


public static function cacheEntities(): array
{
return [
Expand Down
2 changes: 1 addition & 1 deletion app/Models/KamusAnggaran.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class KamusAnggaran extends Model
{
use HasFactory, LaraCache;

protected $guarded =[];
protected $guarded = [];

public static function cacheEntities(): array
{
Expand Down
5 changes: 2 additions & 3 deletions app/Models/MataAnggaran.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
class MataAnggaran extends Model
{
use HasFactory, LaraCache;
protected $guarded =[];

protected $guarded = [];

public static function cacheEntities(): array
{
Expand All @@ -32,5 +32,4 @@ protected static function booted(): void
$mak->tahun = session('year');
});
}

}
4 changes: 2 additions & 2 deletions app/Nova/Actions/ImportMataAnggaran.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ public function handle(ActionFields $fields, Collection $models)
$model = $models->first();
MataAnggaran::cache()->disable();
KamusAnggaran::cache()->disable();
MataAnggaran::where('tahun', session('year'))->where('dipa_id', $model->id)->update(['updated_at' => null]);
MataAnggaran::where('tahun', session('year'))->where('dipa_id', $model->id)->update(['updated_at' => null]);
KamusAnggaran::where('tahun', session('year'))->where('dipa_id', $model->id)->update(['updated_at' => null]);
Excel::import(new MataAnggaransImport($fields->satker, $fields->wilayah, $model->id), $fields->file);
MataAnggaran::where('updated_at', null)->delete();
MataAnggaran::where('updated_at', null)->delete();
KamusAnggaran::where('updated_at', null)->delete();
MataAnggaran::cache()->enable();
MataAnggaran::cache()->update('all');
Expand Down
2 changes: 0 additions & 2 deletions app/Nova/MataAnggaran.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Nova;

use App\Helpers\Policy;
use App\Nova\Actions\ImportMataAnggaran;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use Laravel\Nova\Fields\Text;
Expand Down