当前位置: 首页>>代码示例>>PHP>>正文


PHP Agent::create方法代码示例

本文整理汇总了PHP中Agent::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Agent::create方法的具体用法?PHP Agent::create怎么用?PHP Agent::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Agent的用法示例。


在下文中一共展示了Agent::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::all();
     $validation = Validator::make($input, Agent::$rules);
     if ($validation->passes()) {
         $this->agent->create($input);
         return Redirect::route('admin.agents.index');
     }
     return Redirect::route('admin.agents.create')->withInput()->withErrors($validation)->with('message', 'There were validation errors.');
 }
开发者ID:jacobDaeHyung,项目名称:Laravel-Real-Estate-Manager,代码行数:15,代码来源:AgentsController.php

示例2: store

 /**
  * Store a newly created agent in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Agent::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     Agent::create($data);
     return Redirect::route('control-panel.agents.index');
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:14,代码来源:AgentsController.php

示例3: createAccount

 public function createAccount()
 {
     $validator = Validator::make($data = Input::all(), User::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $data['role'] = Input::get('user_role');
     $data['country_id'] = Input::get('country');
     $data['password'] = Hash::make($data['password']);
     $data['code'] = str_random(60);
     //Activation code
     $user = User::create($data);
     if ($user) {
         $data['user_id'] = $user->id;
         if ($data['role'] == 'Agent') {
             $data['market_id'] = Market::where('market', 'All Market')->first()->id;
             $role = Role::where('name', $data['role'])->first();
             $user->attachRole($role);
             Agent::create($data);
             Mail::send('emails.auth.signup', array('first_name' => $data['first_name'], 'role' => $data['role']), function ($massage) use($user) {
                 $massage->to($user->email, $user->first_name)->subject('Thank You for Signing Up');
             });
             Mail::send('emails.auth.signup', array('first_name' => $data['first_name'], 'role' => $data['role']), function ($massage) use($user) {
                 $massage->to('tharinda@exotic-intl.com', 'Tharinda')->subject('Thank You for Signing Up');
             });
             Session::flash('global', 'Thank you for signing up with us as an ' . $data['role'] . '. We will contact you within 24 hours');
             return View::make('pages.message');
         }
         if ($data['role'] == 'Hotelier') {
             Mail::send('emails.auth.signup', array('first_name' => $data['first_name'], 'role' => $data['role']), function ($massage) use($user) {
                 $massage->to($user->email, $user->first_name)->subject('Thank You for Signing Up');
             });
             Session::flash('global', 'Thank you for signing up with us as an ' . $data['role'] . '. We will contact you within 24 hours');
             return View::make('pages.message');
         }
         // send email
         Mail::send('emails.auth.activate', array('link' => URL::to('account/activate', $data['code']), 'first_name' => $data['first_name']), function ($massage) use($user) {
             $massage->to($user->email, $user->first_name)->subject('Activate your account');
         });
         Session::flash('global', 'Your account has been created! We have sent you an email to activate your account');
         return View::make('pages.message');
     }
     return 'There was an error';
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:44,代码来源:AccountController.php

示例4: create

 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     return Agent::create(['agent_first_name' => $data['agent_first_name'], 'agent_middle_name' => $data['agent_middle_name'], 'agent_last_name' => $data['agent_last_name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'agency_id' => '1']);
 }
开发者ID:Tyler-Gauch,项目名称:DigiCommon,代码行数:10,代码来源:AuthController.php

示例5: create_object

 public function create_object($data)
 {
     $data['avatar'] = $data['avatar'] ? $data['avatar'] : 'default.png';
     return Agent::create($data, True);
 }
开发者ID:radiosilence,项目名称:trouble,代码行数:5,代码来源:agent.php


注:本文中的Agent::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。