refactor: apply consistent formatting and organization across multiple files
This commit is contained in:
parent
e9237f857e
commit
04bff9773a
@ -3,8 +3,8 @@
|
|||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests\Admin\Settings\UpdateHRRequest;
|
|
||||||
use App\Http\Requests\Admin\Settings\UpdateHomepageRequest;
|
use App\Http\Requests\Admin\Settings\UpdateHomepageRequest;
|
||||||
|
use App\Http\Requests\Admin\Settings\UpdateHRRequest;
|
||||||
use App\Http\Requests\Admin\Settings\UpdateMarketplaceRequest;
|
use App\Http\Requests\Admin\Settings\UpdateMarketplaceRequest;
|
||||||
use App\Http\Requests\Admin\Settings\UpdateSocialMediaRequest;
|
use App\Http\Requests\Admin\Settings\UpdateSocialMediaRequest;
|
||||||
use App\Http\Requests\Admin\Settings\UpdateSystemRequest;
|
use App\Http\Requests\Admin\Settings\UpdateSystemRequest;
|
||||||
|
|||||||
@ -34,7 +34,6 @@ public function update(PasswordUpdateRequest $request): RedirectResponse
|
|||||||
|
|
||||||
Inertia::flash('toast', ['type' => 'success', 'message' => 'Kata sandi berhasil diperbarui.']);
|
Inertia::flash('toast', ['type' => 'success', 'message' => 'Kata sandi berhasil diperbarui.']);
|
||||||
|
|
||||||
|
|
||||||
return back();
|
return back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
namespace App\Http\Requests\Admin\HR;
|
namespace App\Http\Requests\Admin\HR;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Override;
|
|
||||||
|
|
||||||
class AttendanceRequest extends FormRequest
|
class AttendanceRequest extends FormRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\Settings;
|
namespace App\Http\Requests\Settings;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
|
||||||
@ -10,7 +11,7 @@ class ProfileUpdateRequest extends FormRequest
|
|||||||
/**
|
/**
|
||||||
* Get the validation rules that apply to the request.
|
* Get the validation rules that apply to the request.
|
||||||
*
|
*
|
||||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
* @return array<string, ValidationRule|array<mixed>|string>
|
||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
#[Guarded(['id'])]
|
#[Guarded(['id'])]
|
||||||
class CashTransaction extends Model implements HasMedia
|
class CashTransaction extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory, SoftDeletes, InteractsWithMedia;
|
use HasFactory, InteractsWithMedia, SoftDeletes;
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
#[Guarded(['id'])]
|
#[Guarded(['id'])]
|
||||||
class Expense extends Model implements HasMedia
|
class Expense extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasFactory, SoftDeletes, InteractsWithMedia;
|
use HasFactory, InteractsWithMedia, SoftDeletes;
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
namespace App\Services\Admin;
|
namespace App\Services\Admin;
|
||||||
|
|
||||||
use App\Services\S3PresignedService;
|
use App\Services\S3PresignedService;
|
||||||
use App\Settings\HRSettings;
|
|
||||||
use App\Settings\HomepageSettings;
|
use App\Settings\HomepageSettings;
|
||||||
|
use App\Settings\HRSettings;
|
||||||
use App\Settings\MarketplaceSettings;
|
use App\Settings\MarketplaceSettings;
|
||||||
use App\Settings\SocialMediaSettings;
|
use App\Settings\SocialMediaSettings;
|
||||||
use App\Settings\SystemSettings;
|
use App\Settings\SystemSettings;
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Services\Admin\HR;
|
namespace App\Services\Admin\HR;
|
||||||
|
|
||||||
use App\Enums\LeaveRequestStatus;
|
|
||||||
use App\Models\Attendance;
|
use App\Models\Attendance;
|
||||||
use App\Models\LeaveRequest;
|
use App\Models\LeaveRequest;
|
||||||
use App\Services\S3PresignedService;
|
use App\Services\S3PresignedService;
|
||||||
@ -76,6 +75,7 @@ public function getMonthStats(int $year, int $month): array
|
|||||||
$leaveStart = max($leave->start_date->timestamp, $startOfMonth->timestamp);
|
$leaveStart = max($leave->start_date->timestamp, $startOfMonth->timestamp);
|
||||||
$leaveEnd = min($leave->end_date->timestamp, $endOfMonth->timestamp);
|
$leaveEnd = min($leave->end_date->timestamp, $endOfMonth->timestamp);
|
||||||
$days = Carbon::createFromTimestamp($leaveStart)->diffInDays(Carbon::createFromTimestamp($leaveEnd)) + 1;
|
$days = Carbon::createFromTimestamp($leaveStart)->diffInDays(Carbon::createFromTimestamp($leaveEnd)) + 1;
|
||||||
|
|
||||||
return $carry + max(0, $days);
|
return $carry + max(0, $days);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ private function formatAttendance(Attendance $attendance): array
|
|||||||
$toArray = $attendance->toArray();
|
$toArray = $attendance->toArray();
|
||||||
|
|
||||||
if (is_null($toArray['work_duration_minutes']) && $attendance->check_in_at) {
|
if (is_null($toArray['work_duration_minutes']) && $attendance->check_in_at) {
|
||||||
$checkIn = \Carbon\Carbon::parse($attendance->check_in_at);
|
$checkIn = Carbon::parse($attendance->check_in_at);
|
||||||
$end = $checkIn->toDateString() === now()->toDateString()
|
$end = $checkIn->toDateString() === now()->toDateString()
|
||||||
? now()
|
? now()
|
||||||
: $checkIn->copy()->endOfDay();
|
: $checkIn->copy()->endOfDay();
|
||||||
|
|||||||
@ -7,8 +7,11 @@
|
|||||||
class HRSettings extends Settings
|
class HRSettings extends Settings
|
||||||
{
|
{
|
||||||
public string $scheduled_check_in_time;
|
public string $scheduled_check_in_time;
|
||||||
|
|
||||||
public string $scheduled_check_out_time;
|
public string $scheduled_check_out_time;
|
||||||
|
|
||||||
public int $late_penalty_amount;
|
public int $late_penalty_amount;
|
||||||
|
|
||||||
public int $absent_penalty_amount;
|
public int $absent_penalty_amount;
|
||||||
|
|
||||||
public static function group(): string
|
public static function group(): string
|
||||||
|
|||||||
@ -7,45 +7,71 @@
|
|||||||
class HomepageSettings extends Settings
|
class HomepageSettings extends Settings
|
||||||
{
|
{
|
||||||
public string $hero_badge;
|
public string $hero_badge;
|
||||||
|
|
||||||
public string $hero_title_line1;
|
public string $hero_title_line1;
|
||||||
|
|
||||||
public string $hero_title_line2;
|
public string $hero_title_line2;
|
||||||
|
|
||||||
public string $hero_title_highlight;
|
public string $hero_title_highlight;
|
||||||
|
|
||||||
public string $hero_description;
|
public string $hero_description;
|
||||||
|
|
||||||
public string $hero_cta_primary_text;
|
public string $hero_cta_primary_text;
|
||||||
|
|
||||||
public string $hero_cta_secondary_text;
|
public string $hero_cta_secondary_text;
|
||||||
|
|
||||||
public ?string $hero_image_url;
|
public ?string $hero_image_url;
|
||||||
|
|
||||||
public string $hero_bg_text_left;
|
public string $hero_bg_text_left;
|
||||||
|
|
||||||
public string $hero_bg_text_right;
|
public string $hero_bg_text_right;
|
||||||
|
|
||||||
public string $scroll_hashtag;
|
public string $scroll_hashtag;
|
||||||
|
|
||||||
public string $scroll_tagline;
|
public string $scroll_tagline;
|
||||||
|
|
||||||
public string $catalog_badge;
|
public string $catalog_badge;
|
||||||
|
|
||||||
public string $catalog_title;
|
public string $catalog_title;
|
||||||
|
|
||||||
public string $catalog_description;
|
public string $catalog_description;
|
||||||
|
|
||||||
public string $catalog_search_placeholder;
|
public string $catalog_search_placeholder;
|
||||||
|
|
||||||
public string $gallery_badge;
|
public string $gallery_badge;
|
||||||
|
|
||||||
public string $gallery_title;
|
public string $gallery_title;
|
||||||
|
|
||||||
public string $gallery_description;
|
public string $gallery_description;
|
||||||
|
|
||||||
public array $gallery_images;
|
public array $gallery_images;
|
||||||
|
|
||||||
public string $order_guide_badge;
|
public string $order_guide_badge;
|
||||||
|
|
||||||
public string $order_guide_title;
|
public string $order_guide_title;
|
||||||
|
|
||||||
public string $order_guide_description;
|
public string $order_guide_description;
|
||||||
|
|
||||||
public array $order_steps;
|
public array $order_steps;
|
||||||
|
|
||||||
public string $about_badge;
|
public string $about_badge;
|
||||||
|
|
||||||
public string $about_title;
|
public string $about_title;
|
||||||
|
|
||||||
public ?string $about_image_url;
|
public ?string $about_image_url;
|
||||||
|
|
||||||
public array $about_features;
|
public array $about_features;
|
||||||
|
|
||||||
public string $contact_badge;
|
public string $contact_badge;
|
||||||
|
|
||||||
public string $contact_title;
|
public string $contact_title;
|
||||||
|
|
||||||
public string $contact_description;
|
public string $contact_description;
|
||||||
|
|
||||||
public string $contact_form_title;
|
public string $contact_form_title;
|
||||||
|
|
||||||
public string $footer_description;
|
public string $footer_description;
|
||||||
|
|
||||||
public string $footer_copyright;
|
public string $footer_copyright;
|
||||||
|
|
||||||
public static function group(): string
|
public static function group(): string
|
||||||
|
|||||||
@ -8,20 +8,33 @@
|
|||||||
class MarketplaceSettings extends Settings
|
class MarketplaceSettings extends Settings
|
||||||
{
|
{
|
||||||
public MarketplaceFeeRule $tiktok_shop_platform_commission;
|
public MarketplaceFeeRule $tiktok_shop_platform_commission;
|
||||||
|
|
||||||
public MarketplaceFeeRule $tiktok_shop_logistics_service_fee;
|
public MarketplaceFeeRule $tiktok_shop_logistics_service_fee;
|
||||||
|
|
||||||
public MarketplaceFeeRule $tiktok_shop_dynamic_commission;
|
public MarketplaceFeeRule $tiktok_shop_dynamic_commission;
|
||||||
|
|
||||||
public MarketplaceFeeRule $tiktok_shop_order_processing_fee;
|
public MarketplaceFeeRule $tiktok_shop_order_processing_fee;
|
||||||
|
|
||||||
public MarketplaceFeeRule $tiktok_shop_affiliate;
|
public MarketplaceFeeRule $tiktok_shop_affiliate;
|
||||||
|
|
||||||
public MarketplaceFeeRule $tiktok_shop_pre_order_service_fee;
|
public MarketplaceFeeRule $tiktok_shop_pre_order_service_fee;
|
||||||
|
|
||||||
public MarketplaceFeeRule $shopee_admin_fee;
|
public MarketplaceFeeRule $shopee_admin_fee;
|
||||||
|
|
||||||
public MarketplaceFeeRule $shopee_program_fee;
|
public MarketplaceFeeRule $shopee_program_fee;
|
||||||
|
|
||||||
public MarketplaceFeeRule $shopee_shipping_savings;
|
public MarketplaceFeeRule $shopee_shipping_savings;
|
||||||
|
|
||||||
public MarketplaceFeeRule $shopee_premium;
|
public MarketplaceFeeRule $shopee_premium;
|
||||||
|
|
||||||
public MarketplaceFeeRule $shopee_service_fee;
|
public MarketplaceFeeRule $shopee_service_fee;
|
||||||
|
|
||||||
public MarketplaceFeeRule $shopee_order_processing_fee;
|
public MarketplaceFeeRule $shopee_order_processing_fee;
|
||||||
|
|
||||||
public MarketplaceFeeRule $shopee_ams_commission_fee;
|
public MarketplaceFeeRule $shopee_ams_commission_fee;
|
||||||
|
|
||||||
public MarketplaceFeeRule $shopee_pre_order;
|
public MarketplaceFeeRule $shopee_pre_order;
|
||||||
|
|
||||||
public MarketplaceFeeRule $shopee_live_extra;
|
public MarketplaceFeeRule $shopee_live_extra;
|
||||||
|
|
||||||
public static function group(): string
|
public static function group(): string
|
||||||
|
|||||||
@ -7,7 +7,9 @@
|
|||||||
class SocialMediaSettings extends Settings
|
class SocialMediaSettings extends Settings
|
||||||
{
|
{
|
||||||
public ?string $instagram_url;
|
public ?string $instagram_url;
|
||||||
|
|
||||||
public ?string $facebook_url;
|
public ?string $facebook_url;
|
||||||
|
|
||||||
public ?string $tiktok_url;
|
public ?string $tiktok_url;
|
||||||
|
|
||||||
public static function group(): string
|
public static function group(): string
|
||||||
|
|||||||
@ -7,9 +7,13 @@
|
|||||||
class SystemSettings extends Settings
|
class SystemSettings extends Settings
|
||||||
{
|
{
|
||||||
public string $app_name;
|
public string $app_name;
|
||||||
|
|
||||||
public ?string $address;
|
public ?string $address;
|
||||||
|
|
||||||
public ?string $about_app;
|
public ?string $about_app;
|
||||||
|
|
||||||
public ?string $email;
|
public ?string $email;
|
||||||
|
|
||||||
public ?string $phone;
|
public ?string $phone;
|
||||||
|
|
||||||
public static function group(): string
|
public static function group(): string
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
use Illuminate\Foundation\Configuration\Middleware;
|
use Illuminate\Foundation\Configuration\Middleware;
|
||||||
use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
|
use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Spatie\Permission\Middleware\RoleMiddleware;
|
|
||||||
use Spatie\Permission\Middleware\PermissionMiddleware;
|
use Spatie\Permission\Middleware\PermissionMiddleware;
|
||||||
|
use Spatie\Permission\Middleware\RoleMiddleware;
|
||||||
use Spatie\Permission\Middleware\RoleOrPermissionMiddleware;
|
use Spatie\Permission\Middleware\RoleOrPermissionMiddleware;
|
||||||
|
|
||||||
return Application::configure(basePath: dirname(__DIR__))
|
return Application::configure(basePath: dirname(__DIR__))
|
||||||
|
|||||||
@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Spatie\LaravelData\Data;
|
||||||
|
use Spatie\LaravelSettings\SettingsCasts\DataCast;
|
||||||
|
use Spatie\LaravelSettings\SettingsCasts\DateTimeInterfaceCast;
|
||||||
|
use Spatie\LaravelSettings\SettingsCasts\DateTimeZoneCast;
|
||||||
|
use Spatie\LaravelSettings\SettingsRepositories\DatabaseSettingsRepository;
|
||||||
|
use Spatie\LaravelSettings\SettingsRepositories\RedisSettingsRepository;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -35,13 +42,13 @@
|
|||||||
*/
|
*/
|
||||||
'repositories' => [
|
'repositories' => [
|
||||||
'database' => [
|
'database' => [
|
||||||
'type' => Spatie\LaravelSettings\SettingsRepositories\DatabaseSettingsRepository::class,
|
'type' => DatabaseSettingsRepository::class,
|
||||||
'model' => null,
|
'model' => null,
|
||||||
'table' => null,
|
'table' => null,
|
||||||
'connection' => null,
|
'connection' => null,
|
||||||
],
|
],
|
||||||
'redis' => [
|
'redis' => [
|
||||||
'type' => Spatie\LaravelSettings\SettingsRepositories\RedisSettingsRepository::class,
|
'type' => RedisSettingsRepository::class,
|
||||||
'connection' => null,
|
'connection' => null,
|
||||||
'prefix' => null,
|
'prefix' => null,
|
||||||
],
|
],
|
||||||
@ -78,10 +85,10 @@
|
|||||||
* your settings class isn't a default PHP type.
|
* your settings class isn't a default PHP type.
|
||||||
*/
|
*/
|
||||||
'global_casts' => [
|
'global_casts' => [
|
||||||
DateTimeInterface::class => Spatie\LaravelSettings\SettingsCasts\DateTimeInterfaceCast::class,
|
DateTimeInterface::class => DateTimeInterfaceCast::class,
|
||||||
DateTimeZone::class => Spatie\LaravelSettings\SettingsCasts\DateTimeZoneCast::class,
|
DateTimeZone::class => DateTimeZoneCast::class,
|
||||||
// Spatie\DataTransferObject\DataTransferObject::class => Spatie\LaravelSettings\SettingsCasts\DtoCast::class,
|
// Spatie\DataTransferObject\DataTransferObject::class => Spatie\LaravelSettings\SettingsCasts\DtoCast::class,
|
||||||
Spatie\LaravelData\Data::class => Spatie\LaravelSettings\SettingsCasts\DataCast::class,
|
Data::class => DataCast::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -5,12 +5,13 @@
|
|||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Spatie\Permission\Models\Permission;
|
use Spatie\Permission\Models\Permission;
|
||||||
use Spatie\Permission\Models\Role;
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Spatie\Permission\PermissionRegistrar;
|
||||||
|
|
||||||
class RolePermissionSeeder extends Seeder
|
class RolePermissionSeeder extends Seeder
|
||||||
{
|
{
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
app()[\Spatie\Permission\PermissionRegistrar::class]->forgetCachedPermissions();
|
app()[PermissionRegistrar::class]->forgetCachedPermissions();
|
||||||
|
|
||||||
$permissions = [
|
$permissions = [
|
||||||
'user' => ['view', 'create', 'update', 'delete', 'toggle-active', 'reset-password'],
|
'user' => ['view', 'create', 'update', 'delete', 'toggle-active', 'reset-password'],
|
||||||
|
|||||||
@ -7,13 +7,12 @@
|
|||||||
use App\Http\Controllers\Admin\Finance\PayrollAdjustmentController;
|
use App\Http\Controllers\Admin\Finance\PayrollAdjustmentController;
|
||||||
use App\Http\Controllers\Admin\Finance\PayrollController;
|
use App\Http\Controllers\Admin\Finance\PayrollController;
|
||||||
use App\Http\Controllers\Admin\Finance\PayrollPeriodController;
|
use App\Http\Controllers\Admin\Finance\PayrollPeriodController;
|
||||||
use App\Http\Controllers\Admin\Master\CategoryController;
|
|
||||||
use App\Http\Controllers\Admin\Master\CustomerController;
|
|
||||||
use App\Http\Controllers\Admin\Master\ProductController;
|
|
||||||
use App\Http\Controllers\Admin\Master\SupplierController;
|
|
||||||
use App\Http\Controllers\Admin\HR\AttendanceController;
|
use App\Http\Controllers\Admin\HR\AttendanceController;
|
||||||
use App\Http\Controllers\Admin\HR\EmployeeController;
|
use App\Http\Controllers\Admin\HR\EmployeeController;
|
||||||
use App\Http\Controllers\Admin\HR\LeaveRequestController;
|
use App\Http\Controllers\Admin\HR\LeaveRequestController;
|
||||||
|
use App\Http\Controllers\Admin\Master\CategoryController;
|
||||||
|
use App\Http\Controllers\Admin\Master\CustomerController;
|
||||||
|
use App\Http\Controllers\Admin\Master\SupplierController;
|
||||||
use App\Http\Controllers\Admin\RoleController;
|
use App\Http\Controllers\Admin\RoleController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
use App\Enums\PayrollPeriodStatus;
|
use App\Enums\PayrollPeriodStatus;
|
||||||
use App\Enums\PayrollStatus;
|
use App\Enums\PayrollStatus;
|
||||||
use App\Models\CashAccount;
|
use App\Models\CashAccount;
|
||||||
use App\Models\CashTransaction;
|
|
||||||
use App\Models\Employee;
|
use App\Models\Employee;
|
||||||
use App\Models\Payroll;
|
use App\Models\Payroll;
|
||||||
use App\Models\PayrollAdjustment;
|
use App\Models\PayrollAdjustment;
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Employee;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\UserProfile;
|
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Inertia\Testing\AssertableInertia as Assert;
|
use Inertia\Testing\AssertableInertia as Assert;
|
||||||
|
|
||||||
|
|||||||
@ -1702,7 +1702,7 @@
|
|||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = $this->post(route('admin.master.categories.store'), ['name' => "ABCDE"]);
|
$response = $this->post(route('admin.master.categories.store'), ['name' => 'ABCDE']);
|
||||||
$response->assertSessionHasNoErrors();
|
$response->assertSessionHasNoErrors();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1710,7 +1710,7 @@
|
|||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = $this->post(route('admin.master.categories.store'), ['name' => "()【】"]);
|
$response = $this->post(route('admin.master.categories.store'), ['name' => '()【】']);
|
||||||
$response->assertSessionHasNoErrors();
|
$response->assertSessionHasNoErrors();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Purchase;
|
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
|
use App\Models\Purchase;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Inertia\Testing\AssertableInertia as Assert;
|
use Inertia\Testing\AssertableInertia as Assert;
|
||||||
@ -1675,7 +1675,7 @@
|
|||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = $this->post(route('admin.master.customers.store'), ['name' => "ABCDE"]);
|
$response = $this->post(route('admin.master.customers.store'), ['name' => 'ABCDE']);
|
||||||
$response->assertSessionHasNoErrors();
|
$response->assertSessionHasNoErrors();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1683,7 +1683,7 @@
|
|||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = $this->post(route('admin.master.customers.store'), ['name' => "()【】"]);
|
$response = $this->post(route('admin.master.customers.store'), ['name' => '()【】']);
|
||||||
$response->assertSessionHasNoErrors();
|
$response->assertSessionHasNoErrors();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1675,7 +1675,7 @@
|
|||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = $this->post(route('admin.master.suppliers.store'), ['name' => "ABCDE"]);
|
$response = $this->post(route('admin.master.suppliers.store'), ['name' => 'ABCDE']);
|
||||||
$response->assertSessionHasNoErrors();
|
$response->assertSessionHasNoErrors();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1683,7 +1683,7 @@
|
|||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = $this->post(route('admin.master.suppliers.store'), ['name' => "()【】"]);
|
$response = $this->post(route('admin.master.suppliers.store'), ['name' => '()【】']);
|
||||||
$response->assertSessionHasNoErrors();
|
$response->assertSessionHasNoErrors();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Settings\HRSettings;
|
|
||||||
use App\Settings\HomepageSettings;
|
use App\Settings\HomepageSettings;
|
||||||
|
use App\Settings\HRSettings;
|
||||||
use App\Settings\MarketplaceSettings;
|
use App\Settings\MarketplaceSettings;
|
||||||
use App\Settings\SocialMediaSettings;
|
use App\Settings\SocialMediaSettings;
|
||||||
use App\Settings\SystemSettings;
|
use App\Settings\SystemSettings;
|
||||||
|
|||||||
@ -5,11 +5,12 @@
|
|||||||
use Inertia\Testing\AssertableInertia as Assert;
|
use Inertia\Testing\AssertableInertia as Assert;
|
||||||
use Spatie\Permission\Models\Permission;
|
use Spatie\Permission\Models\Permission;
|
||||||
use Spatie\Permission\Models\Role;
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Spatie\Permission\PermissionRegistrar;
|
||||||
|
|
||||||
uses(RefreshDatabase::class);
|
uses(RefreshDatabase::class);
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
app()[\Spatie\Permission\PermissionRegistrar::class]->forgetCachedPermissions();
|
app()[PermissionRegistrar::class]->forgetCachedPermissions();
|
||||||
|
|
||||||
$modules = [
|
$modules = [
|
||||||
'user' => ['view', 'create', 'update', 'delete', 'toggle-active', 'reset-password'],
|
'user' => ['view', 'create', 'update', 'delete', 'toggle-active', 'reset-password'],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user