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


PHP Profile::create方法代碼示例

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


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

示例1: run

 public function run()
 {
     \App\Profile::create(array('userid' => 1, 'about' => 'anurdha is great'));
     \App\Profile::create(array('userid' => 2, 'about' => 'yeah is great'));
     \App\Profile::create(array('userid' => 3, 'about' => 'ret is weak'));
     \App\Profile::create(array('userid' => 4, 'about' => 'pep is beek'));
 }
開發者ID:anuradhacse,項目名稱:UOM-RESOURCE-MANAGER,代碼行數:7,代碼來源:ProfileSeeder.php

示例2: run

 /**
  * Run the Profiles table seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     Profile::create(['id' => 1, 'user_id' => 1, 'bio' => 'I like to soccer, women, and beer.', 'location' => 'Long Beach, CA', 'twitter_username' => 'johnsfeed', 'instagram_username' => 'johnwashere']);
     Profile::create(['id' => 2, 'user_id' => 2, 'bio' => 'I like to cooking, reading, and swimming.', 'location' => 'Oceanside, CA', 'twitter_username' => 'karenwho', 'instagram_username' => 'karenthequeen']);
     Profile::create(['id' => 3, 'user_id' => 3, 'bio' => 'I like eating raw food and yoga.', 'location' => 'San Francisco, CA', 'twitter_username' => 'janesworld', 'instagram_username' => 'janedidit']);
 }
開發者ID:adrianapope,項目名稱:baking-amigo,代碼行數:12,代碼來源:ProfilesSeeder.php

示例3: create

 /**
  * Create a new user and connected profile instance after a valid registration.
  *
  * @param  array $data
  * @return User
  */
 protected function create(array $data)
 {
     $user = User::create(['username' => $data['username'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
     $profile = Profile::create(['user_id' => $user->id, 'picture' => "default-avatar.jpg"]);
     $user->profile()->save($profile);
     return $user;
 }
開發者ID:uidaho,項目名稱:squireproject,代碼行數:13,代碼來源:AuthController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['first_name' => 'required|alpha_num|max:20', 'last_name' => 'required|alpha_num|max:20', 'gender' => 'boolean', 'birthdate' => 'date']);
     $profile = Profile::create(['first_name' => $request->first_name, 'last_name' => $request->last_name, 'gender' => $request->gender, 'birthdate' => $request->birthdate, 'user_id' => Auth::user()->id]);
     $user = Auth::user();
     alert()->overlay('Congrats!', 'You made your profile', 'success');
     return view('profile.show', compact('profile', 'user'));
 }
開發者ID:sergiu05,項目名稱:laravel5-test,代碼行數:14,代碼來源:ProfileController.php

示例5: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $profile = Profile::create(['name' => $request->input('name'), 'bio' => $request->input('bio'), 'profile_image' => json_encode($request->input('profile_image')), 'type' => (int) $request->input('type'), 'status' => (int) $request->input('status')]);
     if ($profile) {
         return redirect('/admin/profile');
     }
     return back()->withInputs();
 }
開發者ID:antonioiradukunda,項目名稱:missbelge,代碼行數:14,代碼來源:ProfileController.php

示例6: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = \Faker\Factory::create();
     foreach (range(1, 10) as $index) {
         $user = User::All()->random(1);
         Profile::create(['user_id' => $user->id, 'telephone' => $faker->phoneNumber, 'telegram' => $faker->username]);
     }
 }
開發者ID:dikyarga,項目名稱:sistem-informasi-organisasi-dengan-laravel,代碼行數:13,代碼來源:ProfileTableSeeder.php

示例7: run

 public function run()
 {
     $faker = Faker\Factory::create();
     Profile::truncate();
     foreach (range(1, 20) as $index) {
         Profile::create(['first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'job' => $faker->word, 'motto' => $faker->sentence, 'about' => $faker->paragraph(4), 'favorite' => $faker->paragraph(4), 'favorite_img' => $faker->imageUrl(300, 200), 'sample_img1' => $faker->imageUrl(300, 200), 'sample_img2' => $faker->imageUrl(300, 200), 'sample_img3' => $faker->imageUrl(300, 200), 'location' => $faker->country, 'phone' => $faker->phoneNumber]);
     }
 }
開發者ID:bambangsusanto,項目名稱:planatrium,代碼行數:8,代碼來源:DatabaseSeeder.php

示例8: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $customer = Auth::customer()->get();
     if (!count($customer->profile)) {
         $profile = Profile::create(['customer_id' => Auth::customer()->get()->id]);
     }
     return redirect()->route('profile.edit', $profile);
 }
開發者ID:bluecipherz,項目名稱:gl-ct,代碼行數:13,代碼來源:ProfileController.php

示例9: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('profiles')->insert(['user_id' => 1, 'first_name' => 'Uriah', 'last_name' => 'Galang', 'profile_pic' => '/img/avatar.png', 'about_me' => 'Im Your Admin', 'display_name' => 'Super Mario Bros.', 'contact_no' => '09277503043', 'address' => 'New Cabalan', 'city' => 'Olongapo', 'province_state' => 'Zambales', 'zip_code' => '2200', 'country' => 'Philippines', 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     $faker = Faker\Factory::create();
     // Profile::truncate();
     foreach (range(2, 51) as $index) {
         Profile::create(['user_id' => $index, 'first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'profile_pic' => $faker->imageUrl($width = 200, $height = 200), 'about_me' => $faker->paragraph(5), 'display_name' => $faker->name, 'contact_no' => $faker->phoneNumber, 'address' => $faker->streetAddress, 'city' => $faker->city, 'province_state' => $faker->state, 'zip_code' => $faker->postcode, 'country' => $faker->country, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
 }
開發者ID:xenxa,項目名稱:royalflushnetwork,代碼行數:14,代碼來源:ProfileTableSeeder.php

示例10: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['profile.pitch' => 'required', 'profile.position' => 'required', 'profile.gender' => 'required', 'profile.website' => 'required', 'profile.city' => 'required', 'profile.country' => 'required']);
     $profile = Profile::create(['pitch' => $request->profile['pitch'], 'position' => $request->profile['position'], 'gender' => $request->profile['gender'], 'website' => $request->profile['website'], 'city' => $request->profile['city'], 'country' => $request->profile['country'], 'user_id' => Auth::user()->id]);
     foreach ($request->skills as $skill) {
         $profile->attributes()->save(Attribute::create(['name' => $skill['name'], 'content' => $skill['content'], 'profile_id' => $profile->id]));
     }
     return $profile;
 }
開發者ID:diit,項目名稱:e74-alpha,代碼行數:15,代碼來源:ProfileController.php

示例11: SaveProfile

 public function SaveProfile($request)
 {
     $this->request = $request->all();
     $profile = $this->user->profiles()->save(Profile::create($this->request));
     if (isset($this->request["client_id"])) {
         $profile->clients()->attach($this->request["client_id"]);
     }
     return $profile;
 }
開發者ID:nilovese,項目名稱:oauthserver,代碼行數:9,代碼來源:ProfileManager.php

示例12: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // clear table
     \App\Profile::truncate();
     // add 1st row
     \App\Profile::create(['user_id' => 1, 'firstname' => 'Хангал', 'lastname' => 'Жаргалсайхан', 'headline' => 'Оюутан', 'address' => 'БГД-н 4-р хороолол 45-20', 'desired_salary' => 800000, 'phone' => '89237842', 'summary' => 'Laravel Framework ашиглах болон, Full stack development хийх сонирхолтой']);
     // add 2nd row
     \App\Profile::create(['user_id' => 2, 'firstname' => 'Khangal', 'lastname' => 'Kola', 'headline' => 'Undergraduate', 'address' => 'New York', 'phone' => '12345678', 'summary' => 'I wanna be a rockstar.']);
 }
開發者ID:khangal,項目名稱:employment,代碼行數:14,代碼來源:ProfilesTableSeeder.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['first_name' => 'required|alpha_num|max:20', 'last_name' => 'required|alpha_num|max:20', 'gender' => 'boolean', 'birthdate' => 'date']);
     $profile = Profile::create(['first_name' => $request->first_name, 'last_name' => $request->last_name, 'gender' => $request->gender, 'birthdate' => $this->formatDatePickerDate($request->birthdate), 'user_id' => Auth::user()->id]);
     $profile->save();
     $user = User::where('id', '=', $profile->user_id)->first();
     alert()->success('Congrats!', 'You made your profile');
     return view('profile.show', compact('profile', 'user'));
 }
開發者ID:coxy121,項目名稱:lc-dev,代碼行數:15,代碼來源:ProfileController.php

示例14: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::table('profiles')->delete();
     $users = User::all();
     $faker = Faker::create();
     foreach ($users as $user) {
         Profile::create(['description' => $faker->sentence(), 'user_id' => $user->id]);
     }
 }
開發者ID:sammyboy45467,項目名稱:Skynet_for_users,代碼行數:15,代碼來源:ProfileSeeder.php

示例15: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $faker = \Faker\Factory::create();
     foreach (range(1, 50) as $index) {
         $user = \App\User::create(['username' => str_replace('.', ' ', $faker->username), 'email' => $faker->email, 'password' => bcrypt('password'), 'remember_token' => str_random(10)]);
         \App\Profile::create(['user_id' => $user->id]);
     }
     Model::reguard();
 }
開發者ID:Osiruss,項目名稱:LaravelForum,代碼行數:15,代碼來源:UserTableSeeder.php


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