当前位置: 首页>>代码示例>>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;未经允许,请勿转载。