當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Role::create方法代碼示例

本文整理匯總了PHP中app\Role::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Role::create方法的具體用法?PHP Role::create怎麽用?PHP Role::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Role的用法示例。


在下文中一共展示了Role::create方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\RedirectRespons
  */
 public function store(Request $request)
 {
     $input = $request->all();
     $input['password'] = Hash::make($input['password']);
     $user = $this->users->create($input);
     //create Blank profile
     $profile = Profile::create(['user_id' => $user->id, 'bio' => '']);
     $profile->save();
     return \Redirect::route('admin.users.index', [])->withMessage(trans('acl::user.users-controller-successfully_created'));
 }
開發者ID:meccado,項目名稱:acl-admin-control-panel,代碼行數:16,代碼來源:UserController.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     if (\Auth::user()->roles[0]->can('menu-create')) {
         $input = $request->all();
         $input['url'] = "admin/" . str_plural(Str::lower($input['name'] != 'Dashboard' ? $string = str_replace(" ", "_", $input['name']) : ''));
         $menu = $this->menus->create($input);
         foreach ($request->roles as $_id) {
             $role = Role::whereId($_id)->first();
             $menu->assign($role);
         }
         \Session::flash('flash_message', 'Menu added!');
         return \Redirect::route('admin.menus.index', [])->withMessage(trans('acl::menu.menus-controller-successfully_created'));
     }
     return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));
 }
開發者ID:meccado,項目名稱:acl-admin-control-panel,代碼行數:21,代碼來源:MenuController.php

示例3: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $admin = Role::create(['name' => 'admin', 'display_name' => 'Administrator']);
     $managePieces = Permission::create(['name' => 'manage-pieces', 'display_name' => 'create and edit pieces']);
     $admin->attachPermission($managePieces);
     $super = User::where('email', 'steve@evendev.com')->first()->attachRole($admin);
 }
開發者ID:evendev,項目名稱:paintsip,代碼行數:12,代碼來源:RolePermSeeder.php

示例4: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Role::create(['role_name' => 'ROLE_SUPER', 'description' => 'CONTROL TOTAL']);
     Role::create(['role_name' => 'ROLE_ADMIN', 'description' => 'ADMINISTRADOR']);
     Role::create(['role_name' => 'ROLE_USER', 'description' => 'USUARIO']);
     Role::create(['role_name' => 'ROLE_SELLER', 'description' => 'VENDEDOR']);
 }
開發者ID:cruni505,項目名稱:prestomed,代碼行數:12,代碼來源:RoleTableSeeder.php

示例5: run

 public function run()
 {
     DB::table('roles')->delete();
     Role::create(['abr' => 'PRL', 'role' => 'President of Lending', 'description' => "Responsible for ARM Loan Locations. This primarily includes making sure that (1) Existing ARM Loan Locations adhere to the Location Growth Profiles for loan commitments and EBT, (2) Adding new ARM Loan Locations in accordance with our Growth Strategy, (3) Marketing of ARM Loan Locations, and (4) Personnel growth within each ARM Loan Locations", 'matrix' => 1]);
     Role::create(['abr' => 'COO', 'role' => 'Chief Operating Officer', 'description' => "Responsible for (1) the day-to-day running of the critical departments of ARM, (2) establishing procedures and processes to ensure their smooth functioning, and (3) providing timely operational information and assistance to the CEO", 'matrix' => 1]);
     Role::create(['abr' => 'CEO', 'role' => 'Chief Executive Officer', 'description' => "Top executive responsible for ARM’s overall operations and performance. Serves as the main link between the board of directors (the board) and the ARM's various parts or levels, and is held responsible for ARM’s success or failure. Insures that IT and accounting meets corporate goals. Maintains and implements corporate policy, as established by the board.", 'matrix' => 1]);
     Role::create(['abr' => 'CFO', 'role' => 'Chief Financial Officer', 'matrix' => 1]);
     Role::create(['abr' => 'ABM', 'role' => 'Area Business Manager', 'description' => "For a particular ARM Loan Location(s), the ABM is responsible for (1) meeting the growth objectives of the Location Growth Profile, (2) adherence to ARM policies and procedures, (3) front line for collection of past dues, (3) development of employees, and (4) communication of objectives and opportunities.", 'matrix' => 1]);
     Role::create(['abr' => 'COM', 'role' => 'Corporate Office Manager', 'matrix' => 1]);
     Role::create(['abr' => 'OM', 'role' => 'Office Manager', 'description' => "Responsible for ARM Loan Location operations including: loan closings, loan filings, loan disbursements, office operations, and management of Office Assistant roles and responsibilities.", 'matrix' => 1]);
     Role::create(['abr' => 'OA', 'role' => 'Office Assistant', 'description' => "Responsible for specific ARM Loan Location office operations as they pertain to loan operations and other crop insurance processing.", 'matrix' => 1]);
     Role::create(['abr' => 'LBM', 'role' => 'Loan Business Manager', 'description' => "Responsible for ensuring that ARM Loan Officers and Loan Analysts are (1) trained properly and (2) perform loan analysis and loan management steps consistently. The LBM supports the growth of ARM Loan Locations.", 'matrix' => 1]);
     Role::create(['abr' => 'LO', 'role' => 'Loan Officer', 'description' => "Responsible for (1) structuring agriculture loan deals that serve the customers needs, (2) adhering to ARM policies and procedures, (3) supporting ARM’s Loan Location growth objectives as defined in the Location Growth Profile, (4) Interfacing with office staff to get the job done, (5) selling crop insurance, and (6) using loan experience to develop Loan Analysts", 'matrix' => 1]);
     Role::create(['abr' => 'LA', 'role' => 'Loan Analyst', 'description' => "Responsible for (1) structuring agriculture loan deals that serve the customers needs, (2) adhering to ARM policies and procedures, (3) supporting ARM’s Loan Location growth objectives as defined in the Location Growth Profile, (4) Interfacing with office staff to get the job done.", 'matrix' => 1]);
     Role::create(['abr' => 'LCA', 'role' => 'Loan Compliance Auditor', 'description' => ": Responsible for the quality and consistency of ARM Loans across ARM locations. The LCA serves as the corporate interface with ARM Loan Location ABM’s for loan reviews and loan past due collection.", 'matrix' => 1]);
     Role::create(['abr' => 'HRM', 'role' => 'Human Resources Manager', 'description' => "The human resource manager is directly responsible for the overall administration, coordination and evaluation of the human resource function.", 'matrix' => 1]);
     Role::create(['abr' => 'IBM', 'role' => 'Insurance Business Manager', 'matrix' => 1]);
     Role::create(['abr' => 'IAN', 'role' => 'Insurance Analyst', 'matrix' => 1]);
     Role::create(['abr' => 'CIM', 'role' => 'Corporate Insurance Manager', 'matrix' => 1]);
     Role::create(['abr' => 'IA', 'role' => 'Crop Insurance Agents', 'description' => "Responsible for marketing of crop insurance policies to the customer, adhering to ARM insurance standards, maintenance of customer APH databases, and the obtaining of applications, production reports, acreage reports, and notice of loss claims", 'matrix' => 1]);
     Role::create(['abr' => 'ITT', 'role' => 'IT Technician']);
     Role::create(['abr' => 'SUP', 'role' => 'Other Support']);
     Role::create(['abr' => 'SYS', 'role' => 'System']);
     Role::create(['abr' => 'PRI', 'role' => 'President of Insurance', 'description' => "Responsible for (1) ARM agency growth strategy, (2) insurance agency acquisitions, (3) insurance policy, and (4) ARM umbrella value to agencies.", 'matrix' => 1]);
     Role::create(['abr' => 'CRO', 'role' => 'Chief Risk Officer', 'description' => "The corporate executive tasked with assessing and mitigating significant loan risk, regulatory risk, and technological risks across ARM", 'matrix' => 1]);
     Role::create(['abr' => 'CTR', 'role' => 'Corporate Controller', 'description' => "Top managerial and financial accountant. The controller supervises the accounting department and assists management in interpreting and utilizing managerial accounting information.", 'matrix' => 1]);
     Role::create(['abr' => 'PA', 'role' => 'Principal Agent', 'description' => "Serves as the leader of an ARM Loan or Agency location’s crop insurance business; which includes (1) making sure that policies are represented and processed correctly, (2) development of ARM agents, (3) growth of policy revenue, (4) marketing of additional ARM lines of revenue, and (5) supervision of Insurance Processors and Agents", 'matrix' => 1]);
     Role::create(['abr' => 'IP', 'role' => 'Insurance Processor', 'description' => "Responsible for the support of Principal Agent, Crop Insurance Agents, and all crop insurance operations including: processing of customer insurance applications, production reports, acreage reports, filing notice of loss claims", 'matrix' => 1]);
     Role::create(['id' => 999, 'abr' => 'OPT', 'role' => 'Optional', 'description' => "Committee member", 'matrix' => 0]);
 }
開發者ID:wyrover,項目名稱:lenda-api,代碼行數:30,代碼來源:RolesTableSeeder.php

示例6: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $roles = [['name' => 'Administrator', 'slug' => 'admin']];
     foreach ($roles as $role) {
         Role::create($role);
     }
 }
開發者ID:Cheddam,項目名稱:health,代碼行數:12,代碼來源:RoleSeeder.php

示例7: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('roles')->truncate();
     Role::create(['name' => 'administrator', 'display_name' => 'Administrator', 'description' => 'This person rules the roost']);
     Role::create(['name' => 'approver', 'display_name' => 'Approver', 'description' => 'User can approve or disapprove requests but can not make system changes.']);
     Role::create(['name' => 'user', 'display_name' => 'User', 'description' => 'Default role for everyone. Can submit new requests but that\'s it']);
 }
開發者ID:gfdeveloper,項目名稱:LCCB,代碼行數:12,代碼來源:RolesTableSeeder.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $roles = ['Administrador', 'Coordinador TI', 'Coordinador TALLER', 'Coordinador OPERACIONES', 'Coordinador OOCC', 'Coordinador MIN', 'Coordinador MAT', 'Coordinador LAB', 'Coordinador ING', 'Coordinador FIS', 'Coordinador EYM', 'Coordinador EST', 'Coordinador BIO', 'Coordinador 5TO AÑO'];
     foreach ($roles as $role) {
         Role::create(['name' => $role]);
     }
 }
開發者ID:edmiranda,項目名稱:uai_courses,代碼行數:12,代碼來源:RoleTableSeeder.php

示例9: store

 public function store(BookingRequest $request)
 {
     $booking = array('car_type_id' => $request->car_type_id, 'number_of_passengers' => $request->number_of_passengers, 'pickup_time' => $request->pickup_date_part . ' ' . $request->pickup_time_part, 'ip_info' => $request->ip_info);
     $newBooking = Booking::create($booking);
     flash()->success('Your booking has been created!')->important();
     if (!empty($request->comment1)) {
         //children comment
         $comment1 = array('booking_id' => $newBooking->id, 'comment_type_id' => '1', 'role_id' => '1', 'comment' => $request->comment1);
         Comment::create($comment1);
     }
     if (!empty($request->comment2)) {
         //general comment
         $comment2 = array('booking_id' => $newBooking->id, 'comment_type_id' => '2', 'role_id' => '1', 'comment' => $request->comment2);
         Comment::create($comment2);
     }
     $change = array('booking_id' => $newBooking->id, 'change_type_id' => '4', 'user_id' => Auth::user()->id, 'from' => null, 'to' => null);
     Change::create($change);
     $passenger = User::firstOrNew(['email' => $request->email]);
     $passenger->name = $request->name;
     $passenger->phone = $request->phone;
     $passenger->save();
     $role = array('booking_id' => $newBooking->id, 'role_type_id' => '2', 'user_id' => $passenger->id);
     Role::create($role);
     $price = array('booking_id' => $newBooking->id, 'income_type_id' => '1', 'amount_eur' => $request->price);
     Income::create($price);
     $locationArray = $request->location;
     foreach ($request->address as $order => $address_id) {
         $route_point = null;
         $route_point = array('booking_id' => $newBooking->id, 'location_id' => $locationArray[$order], 'address_id' => $address_id, 'order' => $order);
         Route_point::create($route_point);
     }
     return redirect('bookings');
 }
開發者ID:jedlicka82,項目名稱:transferpraha,代碼行數:33,代碼來源:BookingController.php

示例10: store

 public function store(Request $request)
 {
     $keys = 'name,display_name,description,url';
     $data = $this->autoValidate($request, 'role.store', $keys);
     Role::create($data);
     return $this->success('', url('admin/role'));
 }
開發者ID:unionbt,項目名稱:hanpaimall,代碼行數:7,代碼來源:RoleController.php

示例11: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $roles = ['manager' => ['users.create', 'users.delete', 'users.read', 'users.update', 'invoices.read', 'invoices.create', 'invoices.delete', 'invoices.update', 'reports.read', 'reports.update', 'reports.delete'], 'user' => ['invoices.read', 'invoices.create', 'reports.read']];
     foreach ($roles as $key => $value) {
         Role::create(['role_name' => $key, 'permissions' => json_encode($value)]);
     }
 }
開發者ID:GCRS,項目名稱:special-journey,代碼行數:12,代碼來源:2016_01_31_080608_add_default_roles.php

示例12: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // Create Roles
     $subscriberRole = Role::create(['name' => '訂閱者', 'slug' => 'subscriber']);
     $contributorRole = Role::create(['name' => '投稿者', 'slug' => 'contributor']);
     $authorRole = Role::create(['name' => '作者', 'slug' => 'author']);
     $editorRole = Role::create(['name' => '編輯', 'slug' => 'editor']);
     $adminRole = Role::create(['name' => '管理員', 'slug' => 'admin']);
     // Create Permission
     $createArticlePermission = Permission::create(['name' => '發布文章', 'slug' => 'article.create']);
     $uploadImagePermission = Permission::create(['name' => '上傳圖片', 'slug' => 'image.upload']);
     $manageArticlePermission = Permission::create(['name' => '文章管理', 'slug' => 'article.manage']);
     $manageImagePermission = Permission::create(['name' => '圖片管理', 'slug' => 'image.manage']);
     $manageUserPermission = Permission::create(['name' => '用戶管理', 'slug' => 'user.manage']);
     $contributorRole->assignPermission($createArticlePermission->id);
     $authorRole->assignPermission($createArticlePermission->id);
     $authorRole->assignPermission($uploadImagePermission->id);
     $editorRole->assignPermission($createArticlePermission->id);
     $editorRole->assignPermission($uploadImagePermission->id);
     $editorRole->assignPermission($manageArticlePermission->id);
     $editorRole->assignPermission($manageImagePermission->id);
     // Create User
     $admin = User::create(['name' => env('ADMIN_NAME', 'Admin'), 'email' => env('ADMIN_EMAIL', 'admin@laravel.blog'), 'password' => bcrypt(env('ADMIN_PASSWORD', 'password'))]);
     if (!$admin->save()) {
         Log::info('Unable to create admin ' . $admin->username, (array) $admin->errors());
     } else {
         $admin->assignRole($adminRole->id);
         Log::info('Created admin "' . $admin->username . '" <' . $admin->email . '>');
     }
 }
開發者ID:litemax,項目名稱:LaravelBlog,代碼行數:35,代碼來源:RoleAndUserTableSeeder.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required|unique:roles|min:2|max:255', 'slug' => 'required|unique:roles|min:2|max:255', 'description' => 'max:255']);
     $input = $request->all();
     Role::create($input);
     return redirect()->route('admin.roles.index')->with('message', 'Successfully created the role!');
 }
開發者ID:Blockeel,項目名稱:living,代碼行數:13,代碼來源:RoleController.php

示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  *
  * @return void
  */
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required']);
     Role::create($request->all());
     Session::flash('flash_message', 'Role added!');
     return redirect('admin/roles');
 }
開發者ID:appzcoder,項目名稱:laravel-admin,代碼行數:14,代碼來源:RolesController.php

示例15: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     \App\Role::create(['name' => 'super admin']);
     \App\Role::create(['name' => 'manager']);
     \App\Role::create(['name' => 'agent']);
 }
開發者ID:candrasetiadi,項目名稱:nvjvnjsdnnvdvdw,代碼行數:12,代碼來源:RolesTableSeeder.php


注:本文中的app\Role::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。