应用程序的前端有一个左边的页面,用户可以在这里创建一个新的会议。此页面由url "http://proj.test/createConference“访问。
在存储会议之后,应该将用户重定向到该特定会议的管理区域的索引页。网址可能类似于"http://proj.test/myconference/2“。
用户还可以始终访问带有两个链接的子菜单,以列出由他创建的会议并编辑其用户帐户。

这个管理区域是用户创建的每个会议的特定区域,在这个区域,用户可以编辑会议详细信息(标题、描述等),但也可以管理会议的其他方面,如编辑注册类型、列表参与者等。
怀疑
我怀疑ConferneceControler使用哪种方法,如何注册路由,以及如何组织视图文件夹中的文件,以便在创建会议后将用户重定向到特定会议的会议管理区域。也适用于当用户访问特定会议上的链接“”时的上下文(实际上,它们都是相同的上下文)。
现在,没有用户上下文的结构可以访问他创建的每个会议的会议管理区域:
视图目录:
views
createConference.blade.php (page with a form to create new conference)
app.blade.php (template shared by all frontend pages)
index.blade.php (index page of the frontend)路由:
Route::group(['prefix' => '', 'middleware' => 'auth'], function(){
Route::post('/conference/store', [
'uses' => 'ConferenceController@store',
'as' => 'conference.store'
]);
Route::get('/createConference', [
'uses' => 'ConferenceController@create',
'as' => 'conference.create'
]);
});ConferenceController存储方法:
public function store(Request $request)
{
$this->validate($request, [
'conference_name' => 'required|max:255|string',
...
]);
$conference = Conference::create([
'name' => $request->conference_name,
...
]);
// here the user should be redirected to the conference management area specific for this created conference
}发布于 2018-02-18 21:50:19
下面是我将如何构造它的草图。
views // First option
conference
create.blade.php // left image
manage.blade.php // bottom right
list.blade.php // top right
participants
...
layout
main.blade.php // template shared by all frontend pages
views // Second option
conference
create.blade.php // left image
list.blade.php // top right
manageConference
index.blade.php // bottom right
participants
...
layout
main.blade.php // template shared by all frontend pages
GET: /conference -> @index
GET: /conference/create -> @create
POST: /conference -> @store
GET: /conference/edit/<conference-tag> -> @edit
POST: /conference/update/<conference-tag> -> @update
GET: /conference/manage/<conference-tag> -> @manage // First option
or
GET: /manageConference/<conference-tag> -> ManageConference@index // Second option
@store -> @manage我不知道你为什么要通过'as' => 'conference.create'在你的路线,但我可能是缺乏更大的图片。
https://stackoverflow.com/questions/48856590
复制相似问题