Inheritance: extends Illuminate\Database\Eloquent\Model
コード例 #1
0
 public function adminPost(AdminUserRequest $request)
 {
     $role = Role::create(['name' => 'administraotr', 'description' => 'Administrator Role has all access']);
     AdminUser::create(['first_name' => $request->get('first_name'), 'last_name' => $request->get('last_name'), 'email' => $request->get('email'), 'password' => bcrypt($request->get('password')), 'is_super_admin' => 1, 'role_id' => $role->id]);
     $host = str_replace('http://', '', $request->getUriForPath(''));
     $host = str_replace('https://', '', $host);
     $website = Website::create(['host' => $host, 'name' => 'Defaul Website', 'is_default' => 1]);
     Configuration::create(['configuration_key' => 'active_theme_identifier', 'configuration_value' => 'mage2-basic', 'website_id' => $website->id]);
     Configuration::create(['configuration_key' => 'active_theme_path', 'configuration_value' => base_path('themes\\mage2\\basic'), 'website_id' => $website->id]);
     Configuration::create(['configuration_key' => 'mage2_catalog_no_of_product_category_page', 'configuration_value' => 9, 'website_id' => $website->id]);
     Configuration::create(['configuration_key' => 'mage2_catalog_cart_page_display_taxamount', 'configuration_value' => 'yes', 'website_id' => $website->id]);
     Configuration::create(['configuration_key' => 'mage2_tax_class_percentage_of_tax', 'configuration_value' => 15, 'website_id' => $website->id]);
     return redirect()->route('mage2.install.success');
 }
コード例 #2
0
 private function _getRoleOptions()
 {
     $roles = Collection::make([0 => 'Please Select']);
     return $roles->merge(Role::all()->pluck('name', 'id'));
 }
コード例 #3
0
 public function adminPost(AdminUserRequest $request)
 {
     $role = Role::create(['name' => 'administraotr', 'description' => 'Administrator Role has all access']);
     AdminUser::create(['first_name' => $request->get('first_name'), 'last_name' => $request->get('last_name'), 'email' => $request->get('email'), 'password' => bcrypt($request->get('password')), 'is_super_admin' => 1, 'role_id' => $role->id]);
     return redirect()->route('mage2.install.success');
 }
コード例 #4
0
ファイル: TestCase.php プロジェクト: mage2/laravel-ecommerce
 private function setupAdminUserAndWebsite()
 {
     $role = Role::create(['name' => 'Administrator', 'description' => 'administrator role']);
     AdminUser::create(['first_name' => 'test User', 'last_name' => 'test User', 'email' => '*****@*****.**', 'password' => bcrypt('admin123'), 'is_super_admin' => 1, 'role_id' => $role->id]);
     $host = str_replace('http://', '', $this->baseUrl);
     $host = str_replace('https://', '', $host);
     $website = Website::create(['host' => $host, 'name' => 'Defaul Website', 'is_default' => 1]);
     Configuration::create(['configuration_key' => 'active_theme_path', 'configuration_value' => base_path('themes/mage2/default'), 'website_id' => $website->id]);
     Configuration::create(['configuration_key' => 'active_theme_name', 'configuration_value' => 'mage2-default', 'website_id' => $website->id]);
 }
コード例 #5
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Role::destroy($id);
     return redirect()->route('role.index');
 }
コード例 #6
0
 private function _deleteRole($id)
 {
     Role::destroy($id);
 }
コード例 #7
0
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  *
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Role::destroy($id);
     return redirect()->route('admin.role.index')->with('notificationText', " Role Destroy Successfully!");
 }
コード例 #8
0
 private function _getRoleOptions()
 {
     return [0 => 'Please Select'] + Role::all()->pluck('name', 'id')->toArray();
 }