forked from aslan/applicant-site
change resorce scoping
https://laravel.com/docs/10.x/controllers#restful-scoping-resource-routes
This commit is contained in:
parent
397f0faf19
commit
2279341988
|
@ -20,6 +20,7 @@ git clone http://172.17.254.104/aslan/applicant-site.git
|
|||
cd applicant-site
|
||||
make setup
|
||||
```
|
||||
2255
|
||||
|
||||
## Project start local
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/dashboard';
|
||||
public const HOME = '/admin/dashboard';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, and other route configuration.
|
||||
|
|
|
@ -14,6 +14,7 @@ return new class extends Migration
|
|||
Schema::create('educational_institutions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('slug');
|
||||
$table->text('description');
|
||||
$table->integer('position');
|
||||
$table->timestamps();
|
||||
|
|
|
@ -18,12 +18,14 @@ class EducationalInstitutionSeeder extends Seeder
|
|||
[
|
||||
'name' => 'МГТУ',
|
||||
'description' => 'ФГБОУ ВО Майкопский государственный технологический университет',
|
||||
'position' => 1
|
||||
'slug' => 'mkgtu',
|
||||
'position' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Педколледж',
|
||||
'description' => 'ФГБОУ СПО Педагогический колледж',
|
||||
'position' => 1
|
||||
'slug' => 'pedcollege',
|
||||
'position' => 1,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -7,15 +7,16 @@ use App\Http\Controllers\FileController;
|
|||
use App\Http\Controllers\ReceptionScreenController;
|
||||
use App\Http\Controllers\UserController;
|
||||
|
||||
Route::middleware(['auth', 'verified'])->group(function () {
|
||||
Route::middleware(['auth', 'verified'])->prefix('admin')->group(function () {
|
||||
Route::get('/files/create/{file?}', [FileController::class, 'create'])->name('files_create');
|
||||
Route::get('/files/download/{file}', [FileController::class, 'download'])->name('files.download');
|
||||
|
||||
Route::resource('/educational-institutions', EducationalInstitutionController::class)
|
||||
->scoped(['educational_institution' => 'slug']);
|
||||
Route::resources([
|
||||
'/files' => FileController::class,
|
||||
'/users' => UserController::class,
|
||||
'/admin-reception-screen' => ReceptionScreenController::class,
|
||||
'/educational-institutions' => EducationalInstitutionController::class,
|
||||
'/faculties' => FacultyController::class,
|
||||
'/departments' => DepartmentController::class,
|
||||
]);
|
||||
|
|
|
@ -5,7 +5,7 @@ use Illuminate\Support\Facades\Route;
|
|||
|
||||
Route::get('/dashboard', function () {
|
||||
return view('admin');
|
||||
})->middleware(['auth', 'verified'])->name('dashboard');
|
||||
})->prefix('admin')->middleware(['auth', 'verified'])->name('dashboard');
|
||||
|
||||
Route::middleware('auth')->group(function () {
|
||||
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
||||
|
|
Loading…
Reference in New Issue