composer update && add warning text

This commit is contained in:
2024-11-21 23:16:36 +05:00
parent 8155038df8
commit 6e8f30a1b9
16 changed files with 695 additions and 450 deletions

View File

@@ -4,7 +4,6 @@ namespace App\Modules\SberPaymentOrder\Nova\Resources\Concerns;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
trait NovaSberPaymentOrderAuth
{
@@ -21,7 +20,7 @@ trait NovaSberPaymentOrderAuth
return;
}
throw new AuthorizationException();
throw new AuthorizationException;
}
/** Edit button */
@@ -49,7 +48,7 @@ trait NovaSberPaymentOrderAuth
return;
}
throw new AuthorizationException();
throw new AuthorizationException;
}
/** Delete button */
@@ -73,7 +72,7 @@ trait NovaSberPaymentOrderAuth
return;
}
throw new AuthorizationException();
throw new AuthorizationException;
}
/** Force delete */

View File

@@ -20,7 +20,7 @@ trait VisaMasterAuth
return;
}
throw new AuthorizationException();
throw new AuthorizationException;
}
/** Edit button */
@@ -48,7 +48,7 @@ trait VisaMasterAuth
return;
}
throw new AuthorizationException();
throw new AuthorizationException;
}
/** Delete button */
@@ -72,7 +72,7 @@ trait VisaMasterAuth
return;
}
throw new AuthorizationException();
throw new AuthorizationException;
}
/** Force delete */

View File

@@ -0,0 +1,49 @@
<?php
namespace App\Modules\VisaMasterSettings\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class VisaMasterSettingsController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(Request $request): void
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): void
{
//
}
/**
* Display the specified resource.
*/
public function show(Request $request): void
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request): void
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Request $request): void
{
//
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('visa_master_settings', function (Blueprint $table) {
$table->id();
$table->string('name')->unique();
$table->string('display_name');
$table->text('value');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('visa_master_settings');
}
};

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Modules\VisaMasterSettings\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Model;
class VisaMasterSettings extends Model
{
protected $table = 'visa_master_settings';
}

View File

@@ -0,0 +1,8 @@
<?php
namespace App\Modules\VisaMasterSettings\Repositories;
class VisaMasterSettingsRepository
{
}

View File

@@ -5,6 +5,7 @@ namespace App\Nova\Actions;
use App\Models\CurrencyRate;
use App\Models\Payment\OnlinePaymentHistory;
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
use App\Modules\VisaMasterSettings\Models\VisaMasterSettings;
use App\Repos\Payment\OnlinePaymentRepo;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\InteractsWithQueue;
@@ -71,7 +72,9 @@ class MakePaymentNovaVisaMaster extends Action
{
$usd_to_tmt = CurrencyRate::where('currency_from', 'USD')->where('currency_to', 'TMT')->first('value');
if (! $usd_to_tmt) {
$payment_warning_text = VisaMasterSettings::where('name', 'payment_warning_text')->first();
if (! $usd_to_tmt || ! $payment_warning_text) {
return [];
}
@@ -113,6 +116,15 @@ class MakePaymentNovaVisaMaster extends Action
$field->setValue('');
}
}),
Heading::make(Blade::render(<<<HTML
<div class="w-full border text-left appearance-none rounded text-sm font-bold focus:outline-none focus:ring ring-primary-200 dark:ring-gray-600 relative inline-flex items-center justify-center shadow h-9 px-3 bg-primary-500 border-primary-500 text-white dark:text-gray-900">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-current shrink-0 w-6 h-6 mr-2">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span>$payment_warning_text->value</span>
</div>
HTML))->asHtml(),
];
}

View File

@@ -2,6 +2,7 @@
namespace App\Nova;
use DigitalCreative\ColumnToggler\ColumnTogglerTrait;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
use Laravel\Nova\Http\Requests\NovaRequest;
@@ -9,6 +10,8 @@ use Laravel\Nova\Resource as NovaResource;
abstract class Resource extends NovaResource
{
use ColumnTogglerTrait;
/**
* Indicates whether Nova should check for modifications between viewing and updating a resource.
*

View File

@@ -5,9 +5,7 @@ namespace App\Nova\Resources;
use App\Models\CurrencyRate as ModelsCurrencyRate;
use App\Nova\Resource;
use App\Nova\Resources\CurrencyRate\CurrencyRateAuth;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;

View File

@@ -16,7 +16,7 @@ trait CurrencyRateAuth
return;
}
throw new AuthorizationException();
throw new AuthorizationException;
}
/** Edit button */
@@ -44,7 +44,7 @@ trait CurrencyRateAuth
return;
}
throw new AuthorizationException();
throw new AuthorizationException;
}
/** Delete button */
@@ -68,7 +68,7 @@ trait CurrencyRateAuth
return;
}
throw new AuthorizationException();
throw new AuthorizationException;
}
/** Force delete */

View File

@@ -0,0 +1,74 @@
<?php
namespace App\Nova\Resources;
use App\Nova\Resource;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Trix;
use Laravel\Nova\Http\Requests\NovaRequest;
class NovaVisaMasterSetting extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\Resources\NovaVisaMasterSetting>
*/
public static $model = \App\Modules\VisaMasterSettings\Models\VisaMasterSettings::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'name';
/**
* The columns that should be searched.
*
* @var array<int, string>
*/
public static $search = [
'name', 'value',
];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Visa Master Settings');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Visa Master Setting');
}
/**
* Get the fields displayed by the resource.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array<int, \Laravel\Nova\Fields\FieldElement|\Laravel\Nova\Panel>
*/
public function fields(NovaRequest $request): array
{
return [
ID::make('id')->sortable(),
Text::make('Name')
->rules('required', 'string', 'max:255'),
Text::make('Display name', 'display_name')
->rules('required', 'string', 'max:255'),
Text::make('Value')
->rules('required', 'string', 'max:255'),
];
}
}

View File

@@ -4,7 +4,6 @@ namespace App\Nova\Resources\Payment;
use App\Nova\Actions\CheckOnlinePayment;
use App\Nova\Resource;
use App\Repos\Order\OrderRepo;
use App\Repos\Payment\OnlinePaymentRepo;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Badge;

View File

@@ -2,10 +2,7 @@
namespace App\Nova;
use App\Nova\Forms\NovaForm;
use App\Nova\Resources\Branch\Branch;
use App\Nova\Resources\Order\Card\CardOrder;
use App\Nova\Resources\Order\Loan\LoanOrder;
use App\Nova\Resources\System\Roles\Permission;
use App\Nova\Resources\System\Roles\Role;
use Illuminate\Database\Eloquent\Builder;
@@ -13,8 +10,6 @@ use Illuminate\Http\Request;
use Illuminate\Validation\Rules;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\Hidden;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\MorphToMany;
use Laravel\Nova\Fields\Password;

View File

@@ -8,6 +8,7 @@ use App\Modules\VisaMasterPaymentOrder\Nova\Resources\NovaVisaMasterPaymentOrder
use App\Nova\Dashboards\Main;
use App\Nova\Resources\Branch\Branch;
use App\Nova\Resources\CurrencyRate;
use App\Nova\Resources\NovaVisaMasterSetting;
use App\Nova\Resources\Order\Card\CardOrder;
use App\Nova\Resources\Order\Card\CardState;
use App\Nova\Resources\Order\Card\CardType;
@@ -91,6 +92,7 @@ class NovaMenuRepo
MenuGroup::make(__('Currencies'), [
MenuItem::resource(CurrencyRate::class),
MenuItem::resource(NovaVisaMasterSetting::class),
])->collapsedByDefault(),
MenuGroup::make(__('Locale'), [

View File

@@ -11,6 +11,7 @@
"php": "^8.1",
"dedoc/scramble": "^0.11.11",
"denniseilander/pulse-about-application": "^0.1.1",
"digital-creative/column-toggler": "^0.2.3",
"digital-creative/icon-action-toolbar": "^0.1.2",
"ebess/advanced-nova-media-library": "^4.2",
"eminiarts/nova-tabs": "*",
@@ -24,6 +25,7 @@
"laravel/tinker": "^2.8",
"maantje/pulse-php-fpm": "^0.2.1",
"morrislaptop/laravel-pulse-4xx": "^0.0.2",
"nurmuhammet/nova-custom-html": "@dev",
"nurmuhammet/nova-inputmask": "^1.0",
"outl1ne/nova-grid": "@dev",
"outl1ne/nova-simple-repeatable": "^2.2",
@@ -36,8 +38,7 @@
"stepanenko3/nova-logs-tool": "^2.1",
"stevebauman/location": "^7.1",
"symfony/filesystem": "^7.0",
"trin4ik/nova-switcher": "^0.4.0",
"nurmuhammet/nova-custom-html": "@dev"
"trin4ik/nova-switcher": "^0.4.0"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
@@ -115,4 +116,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}

920
composer.lock generated

File diff suppressed because it is too large Load Diff