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


PHP Customer::instagramAccount方法代码示例

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


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

示例1: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $user = new User();
     $user->name = 'mugekural';
     $user->surname = str_random(10);
     $user->email = $user->name . '@gmail.com';
     $user->is_active = true;
     $user->password = bcrypt('12345');
     $user->type = 'App\\Supplier';
     $user->save();
     $supplier = new Supplier();
     $supplier->phone = '023123';
     $supplier->id = $user->id;
     $supplier->save();
     $user2 = new User();
     $user2->name = str_random(10);
     $user2->surname = str_random(10);
     $user2->email = $user2->name . '@gmail.com';
     $user2->is_active = true;
     $user2->type = 'App\\Customer';
     $user2->save();
     $customer = new Customer();
     $customer->phone = "053247557437";
     $customer->id = $user2->id;
     $customer->save();
     $instagram = new InstagramAccount();
     $instagram->instagram_id = "1231231";
     $instagram->access_token = "asdaddads";
     $instagram->username = "farukaladag";
     $instagram->full_name = "omer faruk";
     $instagram->bio = "fdsfasfdsf";
     $instagram->website = "string";
     $instagram->profile_picture = "";
     $supplier->instagramAccount()->save($instagram);
     $product = new Product();
     $product->supplier_id = $supplier->id;
     $product->id = "235";
     $product->is_active = true;
     $product->title = "kitap";
     $product->description = "martı";
     $product->price = "340";
     $product->save();
     $instagram2 = new InstagramAccount();
     $instagram2->instagram_id = "700797";
     $instagram2->access_token = "fjfjjfjfjf";
     $instagram2->username = "mug9";
     $instagram2->full_name = "muge kural";
     $instagram2->bio = "comp stud";
     $instagram2->website = "some string";
     $instagram2->profile_picture = "";
     $customer->instagramAccount()->save($instagram2);
 }
开发者ID:mg9,项目名称:koalaBazaar,代码行数:57,代码来源:UserTableSeeder.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $rules = array('firstname' => 'required', 'surname' => 'required', 'customeremail' => 'required|email', 'pass' => 'required', 'phone' => 'required', 'rpass' => 'required|same:pass');
     $validator = Validator::make($request->all(), $rules);
     if ($validator->fails()) {
         // get the error messages from the validator
         $messages = $validator->messages();
         // redirect our user back to the form with the errors from the validator
         return back()->withInput()->withErrors($messages);
     } else {
         if (User::where('email', $request->input('customeremail'))->first()) {
             return redirect()->action('AuthenticationController@showRegister')->withErrors(['messages' => "Sistemde mail adresi kayıtlı"]);
         }
         $user = new User();
         $user->name = trim($request->input('firstname'));
         $user->surname = trim($request->input('surname'));
         $user->setAsCustomer();
         $user->is_active = false;
         $user->email = $request->input('customeremail');
         $user->password = bcrypt($request->input('pass'));
         $user->save();
         $customer = new Customer();
         $customer->phone = $request->input('phone');
         $customer->id = $user->id;
         $customer->save();
         if (Session::has('user_instagram_info')) {
             $instagramInfo = Session::pull('user_instagram_info');
             $instagramAccount = new InstagramAccount();
             $instagramAccount->instagram_id = $instagramInfo->user->id;
             $instagramAccount->username = $instagramInfo->user->username;
             $instagramAccount->access_token = $instagramInfo->access_token;
             $instagramAccount->full_name = $instagramInfo->user->full_name;
             $instagramAccount->bio = $instagramInfo->user->bio;
             $instagramAccount->website = $instagramInfo->user->website;
             $instagramAccount->profile_picture = $instagramInfo->user->profile_picture;
             $customer->instagramAccount()->save($instagramAccount);
         }
         Storage::makeDirectory($user->id);
         return redirect()->action('AuthenticationController@showRegister')->with('success', ['Successful']);
     }
 }
开发者ID:mg9,项目名称:koalaBazaar,代码行数:47,代码来源:CustomerController.php


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