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