create new dependensy for accident controller
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Http\Requests\V3\AccidentReceipt;
|
||||
|
||||
use App\Enums\AccidentStates;
|
||||
use App\Models\Accident;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ConfirmPaymentInfoRequest extends FormRequest
|
||||
@@ -9,9 +11,9 @@ class ConfirmPaymentInfoRequest extends FormRequest
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
public function authorize(Accident $accident): bool
|
||||
{
|
||||
return true;
|
||||
return $accident->status === AccidentStates::SODOR_NAME_BIME_VA_DAGHI->value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user