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


PHP Uuid::generate方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  * POST /group
  *
  * @return Response
  */
 public function store($id)
 {
     //create sub team
     //return Redirect::action('SubController@create',$id)->with( 'notice', 'This action cannot be perform at this moment, please comeback soon.');
     $user = Auth::user();
     $club = $user->clubs()->FirstOrFail();
     $parent_team = Team::find($id);
     $uuid = Uuid::generate();
     $validator = Validator::make(Input::all(), Team::$rules_group);
     if ($validator->passes()) {
         $team = new Team();
         $team->id = $uuid;
         $team->name = Input::get('name');
         $team->season_id = $parent_team->season_id;
         $team->program_id = $parent_team->program_id;
         $team->description = $parent_team->description;
         $team->early_due = $parent_team->getOriginal('early_due');
         $team->early_due_deadline = $parent_team->early_due_deadline;
         $team->due = $parent_team->getOriginal('due');
         $team->plan_id = $parent_team->plan_id;
         $team->open = $parent_team->open;
         $team->close = $parent_team->close;
         $team->max = Input::get('max');
         $team->status = $parent_team->getOriginal('status');
         $team->parent_id = $parent_team->id;
         $team->club_id = $club->id;
         $team->allow_plan = 1;
         $status = $team->save();
         if ($status) {
             return Redirect::action('TeamController@show', $parent_team->id)->with('messages', 'Group created successfully');
         }
     }
     $error = $validator->errors()->all(':message');
     return Redirect::action('SubController@create', $id)->withErrors($validator)->withInput();
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:41,代码来源:SubController.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     session_start();
     if (!isset($_SESSION['AUTH']) || $_SESSION['AUTH'] == false) {
         \App::abort(500, 'User not authenticated');
     }
     $post = file_get_contents('php://input');
     $data = json_decode($post, true);
     if ($data['ipAddr'] != null && $data['type'] != null) {
         //creates a new VM in middleware database. Expects ipaddress and type
         $v = new vm();
         $v->id = \Uuid::generate(4);
         $v->ipAddr = $data['ipAddr'];
         $v->type = $data['type'];
         try {
             //emit request to make vm
             $redis = \Redis::connection();
             // Using the Redis extension provided client
             $redis->publish('demeter', json_encode(array('command' => 'init', 'vm' => $v->id->string, 'type' => $v->type, 'netId' => $_SESSION['AUTH_USER'])));
             if ($v->save()) {
                 echo "success";
             } else {
                 \App::abort(500, 'VM could not be created, please contact an Administrator');
             }
         } catch (Exception $e) {
             \App::abort(500, 'VM could not be created, please contact an Administrator');
         }
     } else {
         \App::abort(500, 'VM could not be created, please contact an Administrator');
     }
 }
开发者ID:DCUnit711,项目名称:Demeter,代码行数:37,代码来源:vmController.php

示例3: postStoreTransaction

 public function postStoreTransaction(Request $request)
 {
     $input = $request->only('idItemPart', 'qty', 'priceBuy');
     try {
         $arrayData = [];
         $itemId = explode(",", $input['idItemPart']);
         $qty = explode(",", $input['qty']);
         $priceBuy = explode(",", $input['priceBuy']);
         $keyTrans = \Uuid::generate();
         for ($i = 0; $i < count($itemId); $i++) {
             /* Update Stok */
             $this->updateStok($itemId[$i], $qty[$i]);
             /* Update Price */
             $this->updatePrice($itemId[$i], $priceBuy[$i]);
             /* Update Price */
             $this->updatePriceSell($itemId[$i], $priceBuy[$i]);
             $insert['item_id'] = $itemId[$i];
             $insert['qty'] = $qty[$i];
             $insert['price_buy'] = $priceBuy[$i];
             $insert['expedition'] = "-";
             $insert['created_at'] = \Carbon\Carbon::now();
             $insert['updated_at'] = \Carbon\Carbon::now();
             $insert['key_transaction'] = $keyTrans;
             array_push($arrayData, $insert);
         }
         $data = $this->transactionBuy->insert($arrayData);
         return $keyTrans;
     } catch (Exception $e) {
         return "0";
     }
 }
开发者ID:Abdulhmid,项目名称:inventory,代码行数:31,代码来源:Buying.php

示例4: postStore

 public function postStore(UsersRequest $request = null, $id = "")
 {
     $input = $request->except('save_continue', 'password_confirmation');
     $result = '';
     if (\Input::hasFile('photo')) {
         $photo = (new \ImageUpload($input))->upload();
     }
     if ($id == "") {
         $input['id'] = \Uuid::generate();
         $input['photo'] = isset($photo) ? $photo : "";
         $input['password'] = bcrypt($input['password']);
         $query = $this->model->create($input);
         $result = $query->id;
     } else {
         if (\Input::hasFile('photo')) {
             $input['photo'] = isset($photo) ? $photo : "";
         }
         if (isset($input['password']) && $input['password'] != "") {
             $input['password'] = bcrypt($input['password']);
         }
         $this->model->find($id)->update($input);
         $result = $id;
     }
     $save_continue = \Input::get('save_continue');
     $redirect = empty($save_continue) ? $this->url : $this->url . '/edit/' . $result;
     return redirect($redirect)->with('message', 'Berhasil tambah data Pengguna!');
 }
开发者ID:Abdulhmid,项目名称:inventory,代码行数:27,代码来源:Users.php

示例5: store

 /**
  * Store a newly created resource in storage.
  * POST /plan
  *
  * @return Response
  */
 public function store()
 {
     $user = Auth::user();
     $club = $user->clubs()->FirstOrFail();
     $validator = Validator::make(Input::all(), Plan::$rules);
     $uuid = Uuid::generate();
     //check if recurrences
     if ($validator->passes()) {
         $amount = Input::get('total') - Input::get('initial');
         $recurring = Input::get('recurring');
         $recurrences = $amount / $recurring;
         $recidual = fmod($amount, $recurring);
         if ($recidual > 0) {
             return Redirect::action('PlanController@create')->withInput()->with('warning', "Please check the recurring amount and initial amount.");
         }
         $plan = new Plan();
         $plan->id = $uuid;
         $plan->name = Input::get('name');
         $plan->total = Input::get('total');
         $plan->initial = Input::get('initial');
         $plan->recurring = Input::get('recurring');
         $plan->recurrences = $recurrences;
         $plan->frequency_id = Input::get('frequency_id');
         $plan->on = Input::get('on');
         $plan->club_id = $club->id;
         $status = $plan->save();
         if ($status) {
             return Redirect::action('PlanController@index')->with('notice', 'Event created successfully');
         }
         return Redirect::action('PlanController@create')->with('warning', $status);
     }
     $error = $validator->errors()->all(':message');
     return Redirect::action('PlanController@create')->withErrors($validator)->withInput();
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:40,代码来源:PlanController.php

示例6: __construct

 protected function __construct($id = null)
 {
     if ($id !== null && !is_scalar($id)) {
         throw new InvalidIdException();
     }
     $this->id = null === $id ? Uuid::generate() : $id;
 }
开发者ID:kreta,项目名称:kreta,代码行数:7,代码来源:Id.php

示例7: run

 public function run()
 {
     $participants = DB::table('event_participant')->get();
     foreach ($participants as $participant) {
         $player = Player::find($participant->player_id);
         $user = User::find($participant->user_id);
         $event = Evento::find($participant->event_id);
         $payment = Payment::find($participant->payment_id);
         $uuid = Uuid::generate();
         $new = new Participant();
         $new->id = $uuid;
         $new->firstname = $player->firstname;
         $new->lastname = $player->lastname;
         $new->due = $event->getOriginal('fee');
         $new->early_due = $event->getOriginal('early_fee');
         $new->early_due_deadline = $event->early_deadline;
         $new->method = 'full';
         $new->plan_id = Null;
         $new->player_id = $player->id;
         $new->event_id = $participant->event_id;
         $new->accepted_on = $participant->created_at;
         $new->accepted_by = $user->profile->firstname . " " . $user->profile->lastname;
         $new->accepted_user = $participant->user_id;
         $new->status = 1;
         $new->created_at = $participant->created_at;
         $new->updated_at = $participant->updated_at;
         $new->save();
         $update = Item::where('payment_id', '=', $payment->id)->firstOrFail();
         $update->participant_id = $uuid;
         $update->save();
     }
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:32,代码来源:FollowersTableSeeder.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('groups')->insert(['group_id' => '1', 'group_name' => 'Admin']);
     // \DB::statement("SELECT pg_catalog.setval(pg_get_serial_sequence('groups', 'group_id'), "
     //      . "MAX(group_id)) FROM groups");
     DB::table('users')->insert(['id' => Uuid::generate(), 'group_id' => '1', 'username' => 'admin', 'email' => 'admin@spam4.me', 'password' => bcrypt('123456'), 'name' => 'Admin Sistem Inventory', 'active' => '1', 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
 }
开发者ID:Abdulhmid,项目名称:inventory,代码行数:12,代码来源:UsersTableSeeder.php

示例9: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     # Clear the table.
     Segment::truncate();
     # Seed the table.
     $segments = [['Seg_Name' => 'Age', 'Seg_CreatedOn' => Carbon\Carbon::now(), 'Seg_CreatedBy' => 1, 'Seg_GUID' => (string) Uuid::generate(4)], ['Seg_Name' => 'Location', 'Seg_CreatedOn' => Carbon\Carbon::now(), 'Seg_CreatedBy' => 1, 'Seg_GUID' => (string) Uuid::generate(4)]];
     Segment::insert($segments);
 }
开发者ID:bambangadrian,项目名称:mailmarketing,代码行数:13,代码来源:SegmentSeeder.php

示例10: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     # Clear the table.
     Company::truncate();
     # Seed the table.
     $company = [['Cpy_Name' => 'Cahaya Bagi Negri (CBN Indonesia)', 'Cpy_Email' => 'mailmarketing@cbn.or.id', 'Cpy_WebsiteUrl' => 'http://www.jawaban.com', 'Cpy_Address1' => 'Jl. Sriwijaya Kavling 5-7', 'Cpy_Address2' => 'Lippo Cikarang, Cikarang Selatan', 'Cpy_City' => 'Kabupaten Bekasi', 'Cpy_PostCode' => '17550', 'Cpy_Country' => 'Indonesia', 'Cpy_TimeZone' => 'Asia/Jakarta', 'Cpy_CreatedOn' => Carbon\Carbon::now(), 'Cpy_CreatedBy' => 1, 'Cpy_GUID' => (string) Uuid::generate(4)]];
     Company::insert($company);
 }
开发者ID:bambangadrian,项目名称:mailmarketing,代码行数:13,代码来源:CompanySeeder.php

示例11: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     # Clear the table.
     MailList::truncate();
     # Seed the table.
     $mailList = [['Mls_Name' => 'Jawaban Mailing List (Monthly)', 'Mls_EmailAddressFrom' => 'mailmaster@jawaban.com', 'Mls_EmailNameFrom' => 'Webmaster Jawaban.com', 'Mls_Reminder' => 'Y', 'Mls_CompanyName' => 'CBN Indonesia', 'Mls_Address1' => 'Jl. Sriwijaya Kavling 5-7', 'Mls_Address2' => 'Lippo Cikarang', 'Mls_City' => 'Kab. Bekasi', 'Mls_Country' => 'Indonesia', 'Mls_Phone' => '0218888888', 'Mls_NotifType' => 'All', 'Mls_CreatedOn' => Carbon\Carbon::now(), 'Mls_CreatedBy' => 1, 'Mls_GUID' => (string) Uuid::generate(4)]];
     MailList::insert($mailList);
 }
开发者ID:bambangadrian,项目名称:mailmarketing,代码行数:13,代码来源:MailListSeeder.php

示例12: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     # Clear the table.
     UserRoleDetail::truncate();
     # Seed the table.
     $userRoleDetails = [['Urd_UserID' => 1, 'Urd_RoleID' => 1, 'Urd_CreatedOn' => Carbon\Carbon::now(), 'Urd_CreatedBy' => 1, 'Urd_GUID' => (string) Uuid::generate(4)], ['Urd_UserID' => 2, 'Urd_RoleID' => 2, 'Urd_CreatedOn' => Carbon\Carbon::now(), 'Urd_CreatedBy' => 1, 'Urd_GUID' => (string) Uuid::generate(4)], ['Urd_UserID' => 3, 'Urd_RoleID' => 3, 'Urd_CreatedOn' => Carbon\Carbon::now(), 'Urd_CreatedBy' => 1, 'Urd_GUID' => (string) Uuid::generate(4)]];
     UserRoleDetail::insert($userRoleDetails);
 }
开发者ID:bambangadrian,项目名称:mailmarketing,代码行数:13,代码来源:UserRoleDetailSeeder.php

示例13: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     # Clear the table.
     Subscriber::truncate();
     # Seed the table.
     $subscribers = [['Sbr_ImportFromID' => 4, 'Sbr_EmailAddress' => 'maitaelfrida29@gmail.com', 'Sbr_FirstName' => 'Maita', 'Sbr_LastName' => 'Elfrida', 'Sbr_Address1' => 'Perumahan Bagasasi Blok F3 No.1', 'Sbr_Address2' => 'Cibarusah', 'Sbr_Address3' => 'Cikarang Selatan', 'Sbr_CreatedOn' => Carbon\Carbon::now(), 'Sbr_CreatedBy' => 1, 'Sbr_GUID' => (string) Uuid::generate(4)]];
     Subscriber::insert($subscribers);
 }
开发者ID:bambangadrian,项目名称:mailmarketing,代码行数:13,代码来源:SubscriberSeeder.php

示例14: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     # Clear the table.
     PermissionRole::truncate();
     # Seed the table.
     $permissionRoles = [['Pmr_PermissionID' => 1, 'Pmr_RoleID' => 1, 'Pmr_CreatedOn' => Carbon\Carbon::now(), 'Pmr_CreatedBy' => 1, 'Pmr_GUID' => (string) Uuid::generate(4)], ['Pmr_PermissionID' => 2, 'Pmr_RoleID' => 3, 'Pmr_CreatedOn' => Carbon\Carbon::now(), 'Pmr_CreatedBy' => 1, 'Pmr_GUID' => (string) Uuid::generate(4)]];
     PermissionRole::insert($permissionRoles);
 }
开发者ID:bambangadrian,项目名称:mailmarketing,代码行数:13,代码来源:PermissionRoleSeeder.php

示例15: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     # Clear the table.
     UserAccount::truncate();
     # Seed the table.
     $userAccounts = [['Usr_Name' => 'Administrator', 'Usr_Email' => 'bambang.adrian@gmail.com', 'Usr_Password' => bcrypt('optilog2014'), 'Usr_CreatedOn' => Carbon\Carbon::now(), 'Usr_CreatedBy' => 1, 'Usr_GUID' => (string) Uuid::generate(4)], ['Usr_Name' => 'Bambang Adrian', 'Usr_Email' => 'bambang.adrian@yahoo.co.id', 'Usr_Password' => bcrypt('content2015'), 'Usr_CreatedOn' => Carbon\Carbon::now(), 'Usr_CreatedBy' => 1, 'Usr_GUID' => (string) Uuid::generate(4)], ['Usr_Name' => 'Faber Banjarnahor', 'Usr_Email' => 'faber.banjarnahor@gmail.com', 'Usr_Password' => bcrypt('supervisor2015'), 'Usr_CreatedOn' => Carbon\Carbon::now(), 'Usr_CreatedBy' => 3, 'Usr_GUID' => (string) Uuid::generate(4)]];
     UserAccount::insert($userAccounts);
 }
开发者ID:bambangadrian,项目名称:mailmarketing,代码行数:13,代码来源:UserAccountSeeder.php


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