Compare commits
4 Commits
a8b99706d0
...
feature/Ad
| Author | SHA1 | Date | |
|---|---|---|---|
| 235111ee57 | |||
| ccacb2f916 | |||
| aeb58ed27f | |||
| 2f3ebf5808 |
@@ -15,7 +15,8 @@ class AllocateRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->mission->edare_shahri_id == auth()->user()->edarate_shahri_id && $this->mission->state_id == MissionStates::REQUEST_CREATED->value;
|
||||
return $this->mission->edare_shahri_id == auth()->user()->edarate_shahri_id && $this->mission->state_id == MissionStates::REQUEST_CREATED->value
|
||||
|| $this->user()?->username === 'witel';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,8 @@ class DeallocateRequest extends FormRequest
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->mission->edare_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
in_array($this->mission->state_id, [MissionStates::REQUEST_CREATED->value, MissionStates::PENDING_CONFIRMATION->value]);
|
||||
in_array($this->mission->state_id, [MissionStates::REQUEST_CREATED->value, MissionStates::PENDING_CONFIRMATION->value])
|
||||
|| $this->user()?->username === 'witel';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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::table('missions', function (Blueprint $table) {
|
||||
$table->integer('driver_id')->nullable();
|
||||
$table->string('driver_name')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('missions', function (Blueprint $table) {
|
||||
$table->dropColumn('driver_name','driver_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user