public function ComposeWebPanelForms() { view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.store.items._form', function ($view) { $view->with('categories', StoreCategory::lists('display_name', 'id')); $view->with('servers', StoreServer::lists('display_name', 'id')); }); view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.store.categories._form', function ($view) { $view->with('servers', StoreServer::lists('display_name', 'id')); }); view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.panel.users._form', function ($view) { $view->with('roles', Role::lists('display_name', 'id')); }); view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.panel.roles._form', function ($view) { $view->with('permissions', Permission::lists('display_name', 'id')); }); view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.panel.permissions._form', function ($view) { $view->with('roles', Role::lists('display_name', 'id')); }); }
/** * Remove the specified resource from storage. * * @param App\Models\StoreServer $server * @return Response */ public function destroy($server) { $server->delete(); return redirect()->route('webpanel.store.servers.index'); }
/** * Store a newly created resource in storage. * * @param Requests\ServerRequest $request * * @return Response */ public function store(Requests\StoreServerRequest $request) { $input = $request->all(); StoreServer::create($input); return redirect()->route('webpanel.store.servers.index'); }