53 lines
2.1 KiB
PHP
53 lines
2.1 KiB
PHP
<?php
|
|
Route::group(['namespace' => 'Contents'], function () {
|
|
// list of all static pages
|
|
Route::get('content/overview/{module?}', 'ContentOverview@index')
|
|
->name('content.overview')
|
|
->middleware('can:manage,' . \App\Models\Content\Content::class);
|
|
|
|
// form for creating new static page
|
|
Route::get('content/new/{module}', 'CreateNewContent@create')
|
|
->name('content.new')// ->middleware(['can:create,module', 'can:create,' . \App\Models\Content\Content::class]);
|
|
->middleware('can:create,' . \App\Models\Content\Content::class);
|
|
|
|
// form for editing existing static page
|
|
Route::get('content/edit/{page}', 'EditContent@edit')
|
|
->name('content.edit')
|
|
->middleware('can:update,page');
|
|
|
|
// post method for creating new static page
|
|
Route::post('content/new/{module}', 'CreateNewContent@store')
|
|
->name('content.newPost')
|
|
->middleware('can:create,' . \App\Models\Content\Content::class);
|
|
// ->middleware('can:create,module');
|
|
|
|
// post method for creating new static page
|
|
Route::post('content/edit/{page}', 'EditContent@update')
|
|
->name('content.editPost')
|
|
->middleware('can:update,page');
|
|
|
|
// change status of page (protected, public or draft)
|
|
Route::get('content/status/{page}/{status}', 'ContentActions@changeStatus')
|
|
->name('content.changeStatus')
|
|
->middleware('can:changeStatus,page');
|
|
|
|
// set homepage
|
|
Route::get('content/homepage/{page}', 'ContentActions@setHomepage')
|
|
->name('content.setHomepage')
|
|
->middleware('can:setHomepage,page');
|
|
|
|
// delete page
|
|
Route::get('content/delete/{page}', 'ContentActions@delete')
|
|
->name('content.delete')
|
|
->middleware('can:delete,page');
|
|
|
|
// history of changes for specified page
|
|
Route::get('history/{page}', 'History@getOverview')
|
|
->name('content.history')
|
|
->middleware('can:viewHistory,page');
|
|
|
|
// history of changes for specified page
|
|
Route::get('history/diff/{revision}', 'History@getDiff')
|
|
->name('history.diff')
|
|
->middleware('can:viewHistory,'.\App\Models\Content\Content::class);
|
|
}); |