composer update && add warning text
This commit is contained in:
@@ -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(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
74
app/Nova/Resources/NovaVisaMasterSetting.php
Normal file
74
app/Nova/Resources/NovaVisaMasterSetting.php
Normal 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'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user