Compare commits
1 Commits
feature/Cr
...
feature/do
| Author | SHA1 | Date | |
|---|---|---|---|
| f29510d76e |
@@ -16,18 +16,23 @@ class DocumentationController extends Controller
|
|||||||
public function index(Request $request): array
|
public function index(Request $request): array
|
||||||
{
|
{
|
||||||
return DataTableFacade::run(
|
return DataTableFacade::run(
|
||||||
User::query()->with('documents'),
|
User::query(),
|
||||||
$request,
|
$request,
|
||||||
allowedFilters: ['*'],
|
allowedFilters: ['*'],
|
||||||
allowedSortings: ['*'],
|
allowedSortings: ['*'],
|
||||||
allowedSelects: [
|
allowedSelects: [
|
||||||
'users.id', 'users.first_name', 'users.last_name', 'users.national_id',
|
'id', 'first_name', 'last_name', 'national_id',
|
||||||
'users.phone_number', 'users.postal_code', 'users.city_id', 'users.province_id',
|
'phone_number', 'postal_code', 'city_id', 'province_id',
|
||||||
'users.province_name', 'users.city_name', 'users.address', 'documents.title', 'documents.url'
|
'province_name', 'city_name', 'address'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function files(User $user): JsonResponse
|
||||||
|
{
|
||||||
|
return $this->successResponse($user->load('documents'));
|
||||||
|
}
|
||||||
|
|
||||||
public function confirm(User $user): JsonResponse
|
public function confirm(User $user): JsonResponse
|
||||||
{
|
{
|
||||||
$user->update([
|
$user->update([
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ return new class extends Migration
|
|||||||
$table->string('province_name')->nullable();
|
$table->string('province_name')->nullable();
|
||||||
$table->foreignId('city_id')->nullable()->constrained('cities');
|
$table->foreignId('city_id')->nullable()->constrained('cities');
|
||||||
$table->string('city_name')->nullable();
|
$table->string('city_name')->nullable();
|
||||||
|
$table->tinyInteger('authority_level')->default(0);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ return new class extends Migration
|
|||||||
$table->string('province_name')->nullable();
|
$table->string('province_name')->nullable();
|
||||||
$table->foreignId('city_id')->nullable()->constrained('cities');
|
$table->foreignId('city_id')->nullable()->constrained('cities');
|
||||||
$table->string('city_name')->nullable();
|
$table->string('city_name')->nullable();
|
||||||
$table->tinyInteger('level')->default(1);
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ use App\Admin\Controllers\DocumentationController;
|
|||||||
|
|
||||||
Route::prefix('documents')
|
Route::prefix('documents')
|
||||||
->name('documents.')
|
->name('documents.')
|
||||||
|
->middleware('auth')
|
||||||
->controller(DocumentationController::class)
|
->controller(DocumentationController::class)
|
||||||
->group(function () {
|
->group(function () {
|
||||||
Route::post('/', 'index')->name('index');
|
Route::get('/', 'index')->name('index');
|
||||||
Route::post('confirm', 'confirm')->name('confirm');
|
Route::post('confirm', 'confirm')->name('confirm');
|
||||||
Route::post('reject', 'reject')->name('reject');
|
Route::post('reject', 'reject')->name('reject');
|
||||||
|
Route::get('files/{user}', 'files')->name('files');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user