wip
This commit is contained in:
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources\Item;
|
||||||
|
|
||||||
|
use Illuminate\Auth\Access\AuthorizationException;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
trait NovaVisaMasterPaymentOrderItemAuth
|
||||||
|
{
|
||||||
|
/** Edit button */
|
||||||
|
public function authorizedToUpdate(Request $request): bool
|
||||||
|
{
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
if ($user->isMe()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Update */
|
||||||
|
public function authorizeToUpdate(Request $request): void
|
||||||
|
{
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
if ($user->isMe()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new AuthorizationException;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Delete button */
|
||||||
|
public function authorizedToDelete(Request $request)
|
||||||
|
{
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
if ($user->isMe()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Delete */
|
||||||
|
public function authorizeToDelete(Request $request)
|
||||||
|
{
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
if ($user->isMe()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new AuthorizationException;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources;
|
namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources;
|
||||||
|
|
||||||
use App\Models\Branch\Branch;
|
use App\Models\Branch\Branch;
|
||||||
|
use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Item\NovaVisaMasterPaymentOrderItemAuth;
|
||||||
use App\Nova\Resource;
|
use App\Nova\Resource;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Laravel\Nova\Fields\Boolean;
|
use Laravel\Nova\Fields\Boolean;
|
||||||
@@ -15,6 +16,8 @@ use Laravel\Nova\Http\Requests\NovaRequest;
|
|||||||
*/
|
*/
|
||||||
class NovaVisaMasterPaymentOrderItem extends Resource
|
class NovaVisaMasterPaymentOrderItem extends Resource
|
||||||
{
|
{
|
||||||
|
use NovaVisaMasterPaymentOrderItemAuth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The model the resource corresponds to.
|
* The model the resource corresponds to.
|
||||||
*
|
*
|
||||||
@@ -102,9 +105,9 @@ class NovaVisaMasterPaymentOrderItem extends Resource
|
|||||||
|
|
||||||
Text::make('Amalyň geçirilen wagty', fn () => $this->created_at->format('H:i, d.m.Y')),
|
Text::make('Amalyň geçirilen wagty', fn () => $this->created_at->format('H:i, d.m.Y')),
|
||||||
|
|
||||||
Text::make('Amalyň möçberi', fn () => $this->usd_payment_amount . ' USD'),
|
Text::make('Amalyň möçberi', fn () => $this->usd_payment_amount.' USD'),
|
||||||
|
|
||||||
Text::make('Amalyň manat möçberi', fn () => $this->tmt_payment_amount . ' TMT'),
|
Text::make('Amalyň manat möçberi', fn () => $this->tmt_payment_amount.' TMT'),
|
||||||
|
|
||||||
Text::make('Amalyň referensi', fn () => $this->payment_order_number),
|
Text::make('Amalyň referensi', fn () => $this->payment_order_number),
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,13 @@ Route::middleware(['auth', 'unVerified'])->group(function () {
|
|||||||
Route::post('sms-verification', [RegisterController::class, 'verifySmsCode']);
|
Route::post('sms-verification', [RegisterController::class, 'verifySmsCode']);
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('online-payment-store', [OnlinePaymentController::class, 'store'])->name('online-payment-store');
|
Route::get('online-payment-store', [OnlinePaymentController::class, 'store'])
|
||||||
Route::get('online-payment-store-visa-master', [OnlinePaymentController::class, 'visaMaster'])->name('online-payment-store-visa-master');
|
->name('online-payment-store');
|
||||||
Route::get('online-payment-store-sber', [OnlinePaymentController::class, 'sber'])->name('online-payment-store-sber');
|
|
||||||
|
Route::get('online-payment-store-visa-master', [OnlinePaymentController::class, 'visaMaster'])
|
||||||
|
->name('online-payment-store-visa-master');
|
||||||
|
|
||||||
|
Route::get('online-payment-store-sber', [OnlinePaymentController::class, 'sber'])
|
||||||
|
->name('online-payment-store-sber');
|
||||||
|
|
||||||
Route::redirect('/', config('nova.path'));
|
Route::redirect('/', config('nova.path'));
|
||||||
|
|||||||
Reference in New Issue
Block a user