Optimize code

This commit is contained in:
Daeng Deni Mardaeni 2024-08-13 11:54:42 +07:00
parent 5c4285c77e
commit e950b73b44
42 changed files with 1064 additions and 991 deletions

View File

@ -7,6 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\Branch;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class BranchExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{
@ -41,8 +42,8 @@
: array
{
return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER,
'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME
'A' => NumberFormat::FORMAT_NUMBER,
'D' => NumberFormat::FORMAT_DATE_DATETIME
];
}
}

View File

@ -7,7 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\Currency;
use Modules\Lpj\Models\JenisJaminan;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class CurrencyExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{
@ -46,9 +46,9 @@
: array
{
return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER,
'B' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER,
'E' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME
'A' => NumberFormat::FORMAT_NUMBER,
'B' => NumberFormat::FORMAT_NUMBER,
'E' => NumberFormat::FORMAT_DATE_DATETIME
];
}
}

View File

@ -7,6 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\JenisAset;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class JenisAsetExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{
@ -41,8 +42,8 @@
: array
{
return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER,
'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME
'A' => NumberFormat::FORMAT_NUMBER,
'D' => NumberFormat::FORMAT_DATE_DATETIME
];
}
}

View File

@ -7,6 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\JenisFasilitasKredit;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class JenisFasilitasKreditExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{
@ -41,8 +42,8 @@
: array
{
return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER,
'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME
'A' => NumberFormat::FORMAT_NUMBER,
'D' => NumberFormat::FORMAT_DATE_DATETIME
];
}
}

View File

@ -7,6 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\JenisJaminan;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class JenisJaminanExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{
@ -41,8 +42,8 @@
: array
{
return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER,
'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME
'A' => NumberFormat::FORMAT_NUMBER,
'D' => NumberFormat::FORMAT_DATE_DATETIME
];
}
}

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\BranchExport;
@ -29,7 +30,7 @@
return redirect()
->route('basicdata.branch.index')
->with('success', 'Branch created successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.branch.create')
->with('error', 'Failed to create branch');
@ -60,7 +61,7 @@
return redirect()
->route('basicdata.branch.index')
->with('success', 'Branch updated successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.branch.edit', $id)
->with('error', 'Failed to update branch');
@ -76,7 +77,7 @@
$branch->delete();
echo json_encode(['success' => true, 'message' => 'Branch deleted successfully']);
} catch (\Exception $e) {
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => 'Failed to delete branch']);
}
}

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\CurrencyExport;
@ -29,7 +30,7 @@
return redirect()
->route('basicdata.currency.index')
->with('success', 'Currency created successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.currency.create')
->with('error', 'Failed to create currency');
@ -60,7 +61,7 @@
return redirect()
->route('basicdata.currency.index')
->with('success', 'Currency updated successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.currency.edit', $id)
->with('error', 'Failed to update currency');
@ -76,7 +77,7 @@
$currency->delete();
echo json_encode(['success' => true, 'message' => 'Currency deleted successfully']);
} catch (\Exception $e) {
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => 'Failed to delete currency']);
}
}

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\JenisAsetExport;
@ -29,7 +30,7 @@
return redirect()
->route('basicdata.jenis-aset.index')
->with('success', 'Jenis Aset created successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.jenis-aset.create')
->with('error', 'Failed to create jenis aset');
@ -60,7 +61,7 @@
return redirect()
->route('basicdata.jenis-aset.index')
->with('success', 'Jenis Aset updated successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.jenis-aset.edit', $id)
->with('error', 'Failed to update jenis aset');
@ -76,7 +77,7 @@
$jenisAset->delete();
echo json_encode(['success' => true, 'message' => 'Jenis Aset deleted successfully']);
} catch (\Exception $e) {
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => 'Failed to delete jenis aset']);
}
}

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\JenisFasilitasKreditExport;
@ -13,34 +14,43 @@ class JenisFasilitasKreditController extends Controller
{
public $user;
public function index(){
public function index()
{
return view('lpj::jenis_fasilitas_kredit.index');
}
public function create(){
return view('lpj::jenis_fasilitas_kredit.create');
}
public function store(JenisFasilitasKreditRequest $request){
public function store(JenisFasilitasKreditRequest $request)
{
$validate = $request->validated();
if ($validate) {
try {
// Save to database
JenisFasilitasKredit::create($validate);
return redirect()->route('basicdata.jenis-fasilitas-kredit.index')->with('success', 'Jenis Fasilitas Kredit created successfully');
} catch (\Exception $e){
return redirect()->route('basicdata.jenis-fasilitas-kredit.create')->with('error', 'Failed to create jenis fasilitas kredit');
return redirect()
->route('basicdata.jenis-fasilitas-kredit.index')
->with('success', 'Jenis Fasilitas Kredit created successfully');
} catch (Exception $e) {
return redirect()
->route('basicdata.jenis-fasilitas-kredit.create')
->with('error', 'Failed to create jenis fasilitas kredit');
}
}
}
public function edit($id){
public function create()
{
return view('lpj::jenis_fasilitas_kredit.create');
}
public function edit($id)
{
$jenisFasilitasKredit = JenisFasilitasKredit::find($id);
return view('lpj::jenis_fasilitas_kredit.create', compact('jenisFasilitasKredit'));
}
public function update(JenisFasilitasKreditRequest $request, $id){
public function update(JenisFasilitasKreditRequest $request, $id)
{
$validate = $request->validated();
if ($validate) {
@ -48,26 +58,32 @@ class JenisFasilitasKreditController extends Controller
// Update in database
$jenisFasilitasKredit = JenisFasilitasKredit::find($id);
$jenisFasilitasKredit->update($validate);
return redirect()->route('basicdata.jenis-fasilitas-kredit.index')->with('success', 'Jenis Fasilitas Kredit updated successfully');
} catch (\Exception $e){
return redirect()->route('basicdata.jenis-fasilitas-kredit.edit', $id)->with('error', 'Failed to update jenis fasilitas kredit');
return redirect()
->route('basicdata.jenis-fasilitas-kredit.index')
->with('success', 'Jenis Fasilitas Kredit updated successfully');
} catch (Exception $e) {
return redirect()
->route('basicdata.jenis-fasilitas-kredit.edit', $id)
->with('error', 'Failed to update jenis fasilitas kredit');
}
}
}
public function destroy($id){
public function destroy($id)
{
try {
// Delete from database
$jenisFasilitasKredit = JenisFasilitasKredit::find($id);
$jenisFasilitasKredit->delete();
echo json_encode(['success' => true, 'message' => 'Jenis Fasilitas Kredit deleted successfully']);
} catch (\Exception $e){
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => 'Failed to delete jenis fasilitas kredit']);
}
}
public function dataForDatatables(Request $request){
public function dataForDatatables(Request $request)
{
if (is_null($this->user) || !$this->user->can('jenis_fasilitas_kredit.view')) {
//abort(403, 'Sorry! You are not allowed to view users.');
}

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\JenisJaminanExport;
@ -29,7 +30,7 @@
return redirect()
->route('basicdata.jenis-jaminan.index')
->with('success', 'Jenis Jaminan created successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.jenis-jaminan.create')
->with('error', 'Failed to create jenis jaminan');
@ -60,7 +61,7 @@
return redirect()
->route('basicdata.jenis-jaminan.index')
->with('success', 'Jenis Jaminan updated successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.jenis-jaminan.edit', $id)
->with('error', 'Failed to update jenis jaminan');
@ -76,7 +77,7 @@
$jenisJaminan->delete();
echo json_encode(['success' => true, 'message' => 'Jenis Jaminan deleted successfully']);
} catch (\Exception $e) {
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => 'Failed to delete jenis jaminan']);
}
}

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\JenisLegalitasJaminanExport;
@ -29,7 +30,7 @@
return redirect()
->route('basicdata.jenis-legalitas-jaminan.index')
->with('success', 'Jenis Legalitas Jaminan created successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.jenis-legalitas-jaminan.create')
->with('error', 'Failed to create jenis legalitas jaminan');
@ -60,7 +61,7 @@
return redirect()
->route('basicdata.jenis-legalitas-jaminan.index')
->with('success', 'Jenis Legalitas Jaminan updated successfully');
} catch (\Exception $e) {
} catch (Exception $e) {
return redirect()
->route('basicdata.jenis-legalitas-jaminan.edit', $id)
->with('error', 'Failed to update jenis legalitas jaminan');
@ -76,7 +77,7 @@
$jenisLegalitasJaminan->delete();
echo json_encode(['success' => true, 'message' => 'Jenis Legalitas Jaminan deleted successfully']);
} catch (\Exception $e) {
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => 'Failed to delete jenis legalitas jaminan']);
}
}

View File

@ -9,7 +9,8 @@ class BranchRequest extends FormRequest
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
public function rules()
: array
{
$rules = [
'name' => 'required|string|max:255',
@ -31,7 +32,8 @@ class BranchRequest extends FormRequest
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
public function authorize()
: bool
{
return true;
}

View File

@ -9,7 +9,8 @@ class JenisAsetRequest extends FormRequest
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
public function rules()
: array
{
$rules = [
'name' => 'required|max:255',
@ -26,7 +27,8 @@ class JenisAsetRequest extends FormRequest
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
public function authorize()
: bool
{
return true;
}

View File

@ -9,7 +9,8 @@ class JenisJaminanRequest extends FormRequest
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
public function rules()
: array
{
$rules = [
'name' => 'required|max:255',
@ -26,7 +27,8 @@ class JenisJaminanRequest extends FormRequest
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
public function authorize()
: bool
{
return true;
}

View File

@ -9,7 +9,8 @@ class JenisLegalitasJaminanRequest extends FormRequest
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
public function rules()
: array
{
$rules = [
'name' => 'required|max:255',
@ -26,7 +27,8 @@ class JenisLegalitasJaminanRequest extends FormRequest
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
public function authorize()
: bool
{
return true;
}

View File

@ -1,4 +1,5 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;

View File

@ -2,12 +2,15 @@
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\BranchFactory;
class Branch extends Base
{
protected $table = 'branches';
protected $fillable = ['code', 'name', 'status', 'authorized_at', 'authorized_status', 'authorized_by'];
public function debitures()
{
return $this->hasMany(Debiture::class, 'branch_id', 'id');
}
}

View File

@ -2,13 +2,19 @@
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\CurrencyFactory;
class Currency extends Base
{
protected $table = 'currencies';
protected $fillable = ['code', 'name', 'decimal_places','status', 'authorized_at', 'authorized_status', 'authorized_by'];
protected $fillable = [
'code',
'name',
'decimal_places',
'status',
'authorized_at',
'authorized_status',
'authorized_by'
];
}

View File

@ -2,8 +2,6 @@
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\JenisAsetFactory;
class JenisAset extends Base

View File

@ -2,8 +2,6 @@
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\JenisJaminanFactory;
class JenisJaminan extends Base

View File

@ -2,8 +2,6 @@
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\JenisLegalitasJaminanFactory;
class JenisLegalitasJaminan extends Base

View File

@ -6,6 +6,12 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvi
class EventServiceProvider extends ServiceProvider
{
/**
* Indicates if events should be discovered.
*
* @var bool
*/
protected static $shouldDiscoverEvents = true;
/**
* The event handler mappings for the application.
*
@ -13,19 +19,13 @@ class EventServiceProvider extends ServiceProvider
*/
protected $listen = [];
/**
* Indicates if events should be discovered.
*
* @var bool
*/
protected static $shouldDiscoverEvents = true;
/**
* Configure the proper event listeners for email verification.
*
* @return void
*/
protected function configureEmailVerification(): void
protected function configureEmailVerification()
: void
{
}

View File

@ -14,7 +14,8 @@ class LpjServiceProvider extends ServiceProvider
/**
* Boot the application events.
*/
public function boot(): void
public function boot()
: void
{
$this->registerCommands();
$this->registerCommandSchedules();
@ -28,19 +29,11 @@ class LpjServiceProvider extends ServiceProvider
}
}
/**
* Register the service provider.
*/
public function register(): void
{
$this->app->register(EventServiceProvider::class);
$this->app->register(RouteServiceProvider::class);
}
/**
* Register commands in the format of Command::class
*/
protected function registerCommands(): void
protected function registerCommands()
: void
{
// $this->commands([]);
}
@ -48,7 +41,8 @@ class LpjServiceProvider extends ServiceProvider
/**
* Register command Schedules.
*/
protected function registerCommandSchedules(): void
protected function registerCommandSchedules()
: void
{
// $this->app->booted(function () {
// $schedule = $this->app->make(Schedule::class);
@ -59,7 +53,8 @@ class LpjServiceProvider extends ServiceProvider
/**
* Register translations.
*/
public function registerTranslations(): void
public function registerTranslations()
: void
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
@ -75,7 +70,8 @@ class LpjServiceProvider extends ServiceProvider
/**
* Register config.
*/
protected function registerConfig(): void
protected function registerConfig()
: void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower . '.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
@ -84,7 +80,8 @@ class LpjServiceProvider extends ServiceProvider
/**
* Register views.
*/
public function registerViews(): void
public function registerViews()
: void
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');
@ -98,19 +95,10 @@ class LpjServiceProvider extends ServiceProvider
}
/**
* Get the services provided by the provider.
*
* @return array<string>
*/
public function provides(): array
{
return [];
}
/**
* @return array<string>
*/
private function getPublishableViewPaths(): array
private function getPublishableViewPaths()
: array
{
$paths = [];
foreach (config('view.paths') as $path) {
@ -121,4 +109,25 @@ class LpjServiceProvider extends ServiceProvider
return $paths;
}
/**
* Register the service provider.
*/
public function register()
: void
{
$this->app->register(EventServiceProvider::class);
$this->app->register(RouteServiceProvider::class);
}
/**
* Get the services provided by the provider.
*
* @return array<string>
*/
public function provides()
: array
{
return [];
}
}

View File

@ -2,8 +2,8 @@
namespace Modules\Lpj\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
@ -12,7 +12,8 @@ class RouteServiceProvider extends ServiceProvider
*
* Register any model bindings or pattern based filters.
*/
public function boot(): void
public function boot()
: void
{
parent::boot();
}
@ -20,30 +21,33 @@ class RouteServiceProvider extends ServiceProvider
/**
* Define the routes for the application.
*/
public function map(): void
public function map()
: void
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Lpj', '/routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*/
protected function mapApiRoutes(): void
protected function mapApiRoutes()
: void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Lpj', '/routes/api.php'));
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*/
protected function mapWebRoutes()
: void
{
Route::middleware('web')->group(module_path('Lpj', '/routes/web.php'));
}
}

View File

@ -4,29 +4,35 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
public function up()
: void
{
Schema::create('jenis_fasilitas_kredit', function (Blueprint $table) {
$table->id();
$table->string('code');
$table->string('code')->unique()->index();
$table->string('name');
$table->boolean('status')->default(true)->nullable();
$table->timestamps();
$table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable();
$table->softDeletes();
$table->uuid('created_by')->nullable();
$table->uuid('updated_by')->nullable();
$table->uuid('deleted_by')->nullable();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
public function down()
: void
{
Schema::dropIfExists('jenis_fasilitas_kredit');
}

View File

@ -4,29 +4,35 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
public function up()
: void
{
Schema::create('jenis_jaminan', function (Blueprint $table) {
$table->id();
$table->string('code');
$table->string('code')->unique()->index()();
$table->string('name');
$table->boolean('status')->default(true)->nullable();
$table->timestamps();
$table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable();
$table->softDeletes();
$table->uuid('created_by')->nullable();
$table->uuid('updated_by')->nullable();
$table->uuid('deleted_by')->nullable();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
public function down()
: void
{
Schema::dropIfExists('jenis_jaminan');
}

View File

@ -4,29 +4,35 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
public function up()
: void
{
Schema::create('jenis_legalitas_jaminan', function (Blueprint $table) {
$table->id();
$table->string('code');
$table->string('code')->unique()->index();
$table->string('name');
$table->boolean('status')->default(true)->nullable();
$table->timestamps();
$table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable();
$table->softDeletes();
$table->uuid('created_by')->nullable();
$table->uuid('updated_by')->nullable();
$table->uuid('deleted_by')->nullable();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
public function down()
: void
{
Schema::dropIfExists('jenis_legalitas_jaminan');
}

View File

@ -4,29 +4,35 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
public function up()
: void
{
Schema::create('jenis_aset', function (Blueprint $table) {
$table->id();
$table->string('code');
$table->string('code')->unique()->index();
$table->string('name');
$table->boolean('status')->default(true)->nullable();
$table->timestamps();
$table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable();
$table->softDeletes();
$table->uuid('created_by')->nullable();
$table->uuid('updated_by')->nullable();
$table->uuid('deleted_by')->nullable();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
public function down()
: void
{
Schema::dropIfExists('jenis_aset');
}

View File

@ -4,12 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
public function up()
: void
{
Schema::create('branches', function (Blueprint $table) {
$table->id();
@ -31,7 +31,8 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down(): void
public function down()
: void
{
Schema::dropIfExists('branches');
}

View File

@ -4,12 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
public function up()
: void
{
Schema::create('currencies', function (Blueprint $table) {
$table->id();
@ -32,7 +32,8 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down(): void
public function down()
: void
{
Schema::dropIfExists('currencies');
}

View File

@ -9,7 +9,8 @@ class LpjDatabaseSeeder extends Seeder
/**
* Run the database seeds.
*/
public function run(): void
public function run()
: void
{
// $this->call([]);
}

View File

@ -1,8 +1,4 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\Lpj\Http\Controllers\LpjController;
/*
*--------------------------------------------------------------------------
* API Routes