add columns to cartable
# Conflicts: # app/Http/Controllers/V3/RahdaranController.php
This commit is contained in:
@@ -50,6 +50,7 @@ class RahdaranController extends Controller
|
|||||||
'province_name' => $province->name_fa,
|
'province_name' => $province->name_fa,
|
||||||
'edareh_shahri_id' => $request->edareh_shahri_id,
|
'edareh_shahri_id' => $request->edareh_shahri_id,
|
||||||
'edareh_shahri_name' => $edareh->name_fa,
|
'edareh_shahri_name' => $edareh->name_fa,
|
||||||
|
'is_driver' => $request->is_driver,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->successResponse();
|
return $this->successResponse();
|
||||||
@@ -73,6 +74,7 @@ class RahdaranController extends Controller
|
|||||||
'province_name' => $province->name_fa,
|
'province_name' => $province->name_fa,
|
||||||
'edareh_shahri_id' => $request->edareh_shahri_id,
|
'edareh_shahri_id' => $request->edareh_shahri_id,
|
||||||
'edareh_shahri_name' => $edareh->name_fa,
|
'edareh_shahri_name' => $edareh->name_fa,
|
||||||
|
'is_driver' => $request->is_driver,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->successResponse();
|
return $this->successResponse();
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ class AllocateRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'machines' => 'required|array',
|
'machines' => 'required|array',
|
||||||
'machines.*' => 'required|integer|exists:cmms_machines,id',
|
'machines.*' => 'required|integer|exists:cmms_machines,id',
|
||||||
'driver' => 'required|integer|exists:rahdaran,id'
|
'driver' => 'required|integer|exists:rahdaran,id',
|
||||||
|
'km' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class StoreRequest extends FormRequest
|
|||||||
'mobile' => 'required|digits:11|regex:/^09\d{9}$/',
|
'mobile' => 'required|digits:11|regex:/^09\d{9}$/',
|
||||||
'province_id' => 'required|exists:provinces,id',
|
'province_id' => 'required|exists:provinces,id',
|
||||||
'edareh_shahri_id' => 'required|exists:edarate_shahri,id',
|
'edareh_shahri_id' => 'required|exists:edarate_shahri,id',
|
||||||
|
'is_driver' => 'required|boolean',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'mobile' => 'required|digits:11|regex:/^09\d{9}$/',
|
'mobile' => 'required|digits:11|regex:/^09\d{9}$/',
|
||||||
'province_id' => 'required|exists:provinces,id',
|
'province_id' => 'required|exists:provinces,id',
|
||||||
'edareh_shahri_id' => 'required|exists:edarate_shahri,id',
|
'edareh_shahri_id' => 'required|exists:edarate_shahri,id',
|
||||||
|
'is_driver' => 'required|boolean',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class TransportationUnitService
|
|||||||
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
||||||
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
||||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa', 'start_time', 'finish_time',
|
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa', 'start_time', 'finish_time',
|
||||||
'code', 'category_id', 'category_name', 'explanation'
|
'code', 'category_id', 'category_name', 'explanation', 'km'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ return new class extends Migration
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('rahdaran', function (Blueprint $table) {
|
Schema::table('rahdaran', function (Blueprint $table) {
|
||||||
$table->unsignedTinyInteger('province_id');
|
$table->unsignedTinyInteger('province_id')->nullable();
|
||||||
$table->foreign('province_id')->references('id')->on('provinces');
|
$table->foreign('province_id')->references('id')->on('provinces');
|
||||||
$table->string('province_name');
|
$table->string('province_name')->nullable();
|
||||||
$table->unsignedBigInteger('edareh_shahri_id');
|
$table->unsignedBigInteger('edareh_shahri_id')->nullable();
|
||||||
$table->foreign('edareh_shahri_id')->references('id')->on('edarate_shahri');
|
$table->foreign('edareh_shahri_id')->references('id')->on('edarate_shahri');
|
||||||
$table->boolean('is_driver')->default(false);
|
$table->boolean('is_driver')->default(false);
|
||||||
});
|
});
|
||||||
@@ -29,7 +29,7 @@ return new class extends Migration
|
|||||||
Schema::table('rahdaran', function (Blueprint $table) {
|
Schema::table('rahdaran', function (Blueprint $table) {
|
||||||
$table->dropForeign('province_id');
|
$table->dropForeign('province_id');
|
||||||
$table->dropForeign('edareh_shahri_id');
|
$table->dropForeign('edareh_shahri_id');
|
||||||
$table->dropColumn(['province_id', 'province_name']);
|
$table->dropColumn(['province_id', 'province_name', 'edareh_shahri_id', 'is_driver']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user