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')); }
/** * 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']); }
/** * 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; }
/** * 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')); }
/** * 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(); }
/** * 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]); } }
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]); } }
/** * 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); }
/** * 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()]); } }
/** * 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; }
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; }
/** * 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.']); }
/** * 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')); }
/** * 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]); } }
/** * 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(); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { //Ceate User $user = User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); //create Blank profile $profile = Profile::create(['user_id' => $user->id, 'bio' => '']); $profile->save(); //Assign User Role $user->assign('user'); return $user; }
public function SaveProfile($request, $token) { $this->request = $request->all(); $this->request["access_token"] = $token; $this->request["client_id"] = env("clitnt_id"); $this->curlManager->SetCurlUrl(env("api_url") . "profile/save"); $this->curlManager->SetCurlData($this->request); $response = $this->curlManager->ProcessCurl(); $response = json_decode($response, TRUE); return Profile::create($response); }
public function profileSave(Request $request) { $rules = ['state' => 'required', 'city' => 'required', 'locality' => 'required', 'subject_tution' => 'required', 'study_in' => 'required', 'language_medium' => 'required', 'message' => 'required|Max:200']; $messages = ['locality.required' => 'Please Enter Your Locality.', 'study_in.required' => 'Please Enter Your Study Subject.']; $validator = Validator::make($request->all(), $rules, $messages); if ($validator->fails()) { return Redirect::back()->withInput()->withErrors($validator); } else { Profile::create(['state' => $request->input('state'), 'city' => $request->input('city'), 'locality' => $request->input('locality'), 'subject_tution' => $request->input('subject_tution'), 'other_subject' => $request->input('other_subject'), 'study_in' => $request->input('study_in'), 'language_medium' => $request->input('language_medium'), 'message' => $request->input('message')]); } Session::flash('success', 'Thanks for Your Profile Registration'); return Redirect::to('student-registration'); }
/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(Request $request) { $this->validate($request, ['user_id' => 'required', 'division' => 'required', 'puesto' => 'required', 'extension' => 'required|max:4']); Profile::create($request->all()); if (Auth::user()->admin != 1) { $user = Auth::user(); $profile = $request->all(); Mail::send('profile.email', ['profile' => $profile, 'user' => $user], function ($msg) { $msg->to('*****@*****.**', 'Mesa de control de usuarios')->subject('Validación de cuentas de usuario'); }); } return Redirect::route('control'); }
public function run() { DB::table('roles')->delete(); /** * faker library * * @var */ $faker = Faker\Factory::create(); $users = User::where('role_id', '2')->get(); foreach ($users as $user) { Profile::create(['user_id' => $user->id, 'born_again' => $faker->year, 'last_church' => $faker->company]); } }
/** * 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::$rules); $this->validate($request, ['name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|confirmed|min:6']); $user = User::create(['name' => $request->input('name'), 'email' => $request->input('email'), 'password' => bcrypt($request->input('password'))]); $user->attachRole($request->input('role_id')); $data_profile = array_merge($request->all(), array('user_id' => $user->id)); $profile = Profile::create($data_profile); $enterprise = Enterprise::find($request->input('enterprise_id')); $enterprise->staff()->attach($user->id); Mail::send('emails.new_staff', ['data' => $request->all(), 'empresa' => $enterprise], function ($m) use($enterprise, $user, $profile) { $m->to($user->email, $profile->nombre . ' ' . $profile->apellido)->cc($enterprise->email, $enterprise->razon_social)->subject('Nuevo usuario para la empresa: ' . $enterprise->razon_social); }); return redirect()->route('admin.empresa.staff', $request->input('enterprise_id'))->with('message', '<div class="alert alert-success" style="margin-top:15px">Usuario creado con Éxito. Un email ha sido enviado con sus datos de sesión</div>'); }
public function run() { //User::truncate(); $user_super = User::create(['email' => '*****@*****.**', 'password' => Hash::make('password'), 'name' => 'Super Administrator']); //create Blank profile $profile = Profile::create(['user_id' => $user_super->id, 'bio' => '']); $profile->save(); $user_admin = User::create(['email' => '*****@*****.**', 'password' => Hash::make('password'), 'name' => 'Administrator']); //create Blank profile $profile = Profile::create(['user_id' => $user_admin->id, 'bio' => '']); $profile->save(); $user_user = User::create(['email' => '*****@*****.**', 'password' => Hash::make('password'), 'name' => 'General User']); //create Blank profile $profile = Profile::create(['user_id' => $user_user->id, 'bio' => '']); $profile->save(); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { $user = User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); $profile = Profile::create(['user_id' => $user->id, 'name' => $data['name'], 'surname' => $data['surname'], 'gender' => $data['gender'], 'birth_date' => $data['birth_year'] . '-' . $data['birth_month'] . '-' . $data['birth_day'], 'location' => $data['location'], 'interested_in' => $data['interested_in'], 'description' => $data['bio']]); if (isset($data['interest'])) { foreach ($data['interest'] as $interest) { $interest = Interest::firstOrCreate(['name' => $interest]); $profile->interests()->attach($interest->id); } } if (isset($data['profile_photo'])) { $image = Image::create(['profile_id' => $profile->id, 'photo_url' => $data['profile_photo']]); $profile->profile_photo_id = $image->id; $profile->save(); } return $user; }
/** * */ public function run() { $faker = Faker::create('en_US'); /* * Base User Accounts */ // Mike's account $michael = User::create(['name' => 'Michael Norris', 'email' => '*****@*****.**', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $michaelProfile = Profile::create(['user_id' => $michael->id, 'photo_url' => 'https://placeholdit.imgix.net/~text?txt=Mike&txtsize=80&bg=eceff1&txtclr=607d8b&w=640&h=640', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $michael->profile()->save($michaelProfile); // Jim's account $james = User::create(['name' => 'James Norris', 'email' => '*****@*****.**', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $jamesProfile = Profile::create(['user_id' => $james->id, 'photo_url' => 'https://placeholdit.imgix.net/~text?txt=Jim&txtsize=80&bg=eceff1&txtclr=607d8b&w=640&h=640', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $james->profile()->save($jamesProfile); // Steve's account $stephen = User::create(['name' => 'Stephen Norris', 'email' => '*****@*****.**', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $stephenProfile = Profile::create(['user_id' => $stephen->id, 'photo_url' => 'https://placeholdit.imgix.net/~text?txt=Steve&txtsize=80&bg=eceff1&txtclr=607d8b&w=640&h=640', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $stephen->profile()->save($stephenProfile); }
/** * Create a new profile instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { return Profile::create(['first_name' => $data['firstname'], 'last_name' => $data['lastname'], 'adress' => $data['adress'], 'gender' => $data['gender'], 'bio' => $data['bio']]); }
public function createProfileInstance($userId, $input) { $profile = Profile::create(['user_id' => $userId, 'first_name' => $input['first_name'], 'last_name' => $input['last_name'], 'address_line1' => $input['address_line1'], 'address_line2' => $input['address_line2'], 'city' => $input['city'], 'state' => $input['state'], 'country' => $input['country'], 'postcode' => $input['postcode'], 'phone' => $input['phone'], 'passport_no' => $input['passport_no']]); return $profile; }
/** * Create a new profile after a valid registration * *@param id *@return Profile */ protected function createProfile($user_id) { return Profile::create(['user_id' => $user_id]); }
/** * */ public function run() { $faker = Faker::create('en_US'); /* * Base User Accounts */ // Mike's account $michael = User::create(['name' => 'Michael Norris', 'email' => '*****@*****.**', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $michaelProfile = Profile::create(['user_id' => $michael->id, 'facebook_username' => 'mstnorris', 'twitter_username' => 'mstnorris', 'instagram_username' => 'mstnorris']); $michael->profile()->save($michaelProfile); // Sezer's account $sezer = User::create(['name' => 'Sezer Tunca', 'email' => '*****@*****.**', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $sezerProfile = Profile::create(['user_id' => $sezer->id, 'facebook_username' => 'sezertunca', 'twitter_username' => 'sezertunca', 'instagram_username' => 'sezertunca']); $sezer->profile()->save($sezerProfile); // Holly's account $holly = User::create(['name' => 'Holly McNicol', 'email' => '*****@*****.**', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $hollyProfile = Profile::create(['user_id' => $holly->id, 'facebook_username' => 'hjm', 'twitter_username' => 'hjm', 'instagram_username' => 'hjm']); $holly->profile()->save($hollyProfile); // Super Administrator (User) $superU = User::create(['name' => 'Super Administrator', 'email' => '*****@*****.**', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $superUProfile = Profile::create(['user_id' => $superU->id, 'facebook_username' => 'superadmin', 'twitter_username' => 'superadmin', 'instagram_username' => 'superadmin']); $superU->profile()->save($superUProfile); // Administrator (User) $adminU = User::create(['name' => 'Administrator', 'email' => '*****@*****.**', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); $adminUProfile = Profile::create(['user_id' => $adminU->id, 'facebook_username' => 'admin', 'twitter_username' => 'admin', 'instagram_username' => 'admin']); $adminU->profile()->save($adminUProfile); /* * Roles */ // Super Administrator (Role) $superR = Role::create(['name' => 'Super Administrator', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Administrator (Role) $adminR = Role::create(['name' => 'Administrator', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // User (Role) $basicUserR = Role::create(['name' => 'Basic User', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); /* * Permissions */ // Super Administrator (Permission) $superP = Permission::create(['name' => 'Super Administrator (Permission)', 'level' => '1000', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Administrator (Permission) $adminP = Permission::create(['name' => 'Administrator (Permission)', 'level' => '500', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Level 200 (Permission) $p200 = Permission::create(['name' => 'Level 200 (Permission)', 'level' => '200', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Level 100 (Permission) $p100 = Permission::create(['name' => 'Level 100 (Permission)', 'level' => '100', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Level 50 (Permission) Permission::create(['name' => 'Level 50 (Permission)', 'level' => '50', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Level 20 (Permission) Permission::create(['name' => 'Level 20 (Permission)', 'level' => '20', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Level 10 (Permission) Permission::create(['name' => 'Level 10 (Permission)', 'level' => '10', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Level 5 (Permission) Permission::create(['name' => 'Level 5 (Permission)', 'level' => '5', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Level 2 (Permission) Permission::create(['name' => 'Level 2 (Permission)', 'level' => '2', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Level 1 (Permission) Permission::create(['name' => 'Level 1 (Permission)', 'level' => '1', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Level 0 (Permission) Permission::create(['name' => 'Level 0 (Permission)', 'level' => '0', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); // Can create a new Article Permission::create(['name' => 'create an article', 'level' => '10', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); /* * Detailed User Accounts with Roles and Permissions */ $superU->roles()->attach($superR); $adminU->roles()->attach($adminR); $superR->permissions()->attach($superP); $adminR->permissions()->attach($adminP); $michael->roles()->attach($superR); factory(User::class, 50)->create()->each(function ($u) use($basicUserR) { $u->roles()->attach($basicUserR); $u->profile()->save(factory(Profile::class)->create()); }); factory(Article::class, 50)->create(); }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request, Profile $profile) { $this->validate($request, Profile::validationRules()); Profile::create($request->all()); return redirect('/profile'); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(CreateUserRequest $request, User $user, Profile $profile) { $user->create(['username' => $request->get('username'), 'password' => bcrypt($request->get('password')), 'role' => $request->get('role')])->save(); $profile->create(['username' => $request->get('username'), 'name' => $request->get('name'), 'email' => $request->get('email')])->save(); flash()->info('Created a New User !!'); return redirect()->route('admin.all'); }