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


PHP Profile::save方法代碼示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     $id = Auth::user()->id;
     if ($request->file('photo')) {
         $file = $request->file('photo');
         $name = 'Appmm_' . time() . '.' . $file->getClientOriginalExtension();
         // $path = public_path().'/upload/users/';
         // $file->move($path,$name);
         Storage::disk('users')->put($name, \File::get($file));
     }
     $users = new User($request->all());
     $users->iduser_create = $id;
     $users->photo = $name;
     $users->save();
     $profiles = new Profile();
     $profiles->user_id = $users->id;
     $profiles->save();
     Session::flash('message', 'El usuario ' . $users->name . '  Fue creado exitosamente');
     //guarda el valor de los campos enviados desde el form en un array
     $data = $request->all();
     //se envia el array y la vista lo recibe en llaves individuales {{ $email }} , {{ $subject }}...
     \Mail::send('emails.message', $data, function ($message) use($request) {
         //remitente
         $message->from($request->email, $request->name);
         //asunto
         $message->subject($request->name);
         //receptor
         $message->to(env('CONTACT_MAIL'), env('CONTACT_NAME'));
     });
     return redirect()->route('admin.usuarios.index');
 }
開發者ID:luiscarlosmarca,項目名稱:matixmedia,代碼行數:37,代碼來源:UserController.php

示例2: store

 public function store(Request $request)
 {
     //dd($request);
     try {
         if (!($user = JWTAuth::parseToken()->authenticate())) {
             return response()->json(['user_not_found'], 404);
         }
     } catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
         return response()->json(['token_expired'], $e->getStatusCode());
     } catch (Tymon\JWTAuth\Exceptions\TokenInvalidException $e) {
         return response()->json(['token_invalid'], $e->getStatusCode());
     } catch (Tymon\JWTAuth\Exceptions\JWTException $e) {
         return response()->json(['token_absent'], $e->getStatusCode());
     }
     // the token is valid and we have found the user
     //dd($request->all());
     try {
         $id = $user->profile->user_id;
         return response()->json(['Profile already exists'], 409);
     } catch (\Exception $e) {
         $profile = new Profile();
         $profile->user_id = $user->id;
         $profile->name = $request->input('name');
         $profile->phone_no = $request->input('phone_no');
         $profile->birthdate = $request->input('birthdate');
         $profile->experience = $request->input('experience');
         $profile->industry_id = $request->input('spec_id');
         $profile->save();
         //return response()->json($profile->id);
         return response()->json(['success  profile' . $profile->id], 200);
     }
 }
開發者ID:Vladimir-Florian,項目名稱:Pasu,代碼行數:32,代碼來源:aProfilesController.php

示例3: postAdd

 public function postAdd(UserRequest $request)
 {
     if ($request->sltRole > 2) {
         return redirect()->back()->with('danger', 'Dont try to be a hacker!!!');
     }
     $model = new User();
     $model->email = $request->txtEmail;
     $model->password = Hash::make($request->txtPass);
     $model->name = $request->txtName;
     $model->role_id = $request->sltRole;
     $model->level_id = $request->rdbLevel;
     $model->phone = $request->txtPhone;
     $model->birthday = $request->txtBirth;
     $model->department_id = $request->sltDepartment;
     $model->save();
     $profile = new Profile();
     $profile->user_id = $model->id;
     if ($profile->save()) {
         $data = ['name' => Request::input('txtName'), 'password' => Request::input('txtPass'), 'email' => Request::input('txtEmail')];
         Mail::send('emails.blanks', $data, function ($message) {
             $message->from('trongtri0705@gmail.com', 'Nguyen Trong Tri');
             $message->to(Request::input('txtEmail'), Request::input('txtName'))->subject('This is mail');
         });
     }
     return redirect()->route('admin.index')->with('success', 'Added completely!');
 }
開發者ID:trongtri0705,項目名稱:elinext_project,代碼行數:26,代碼來源:DepartmentController.php

示例4: createDefaultUserProfile

 public function createDefaultUserProfile(User $new_user)
 {
     $profile = new Profile();
     $profile->user_id = $new_user->id;
     $profile->about_me = '';
     $profile->profile_image_name = UserController::getDefaultImageName();
     $profile->save();
 }
開發者ID:ebrimamaubeh,項目名稱:utg_bantaba,代碼行數:8,代碼來源:RegisterController.php

示例5: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(ProfileCreateRequest $request)
 {
     $profile = new Profile(['nombre' => $request['nombre'], 'apP' => $request['apP'], 'apM' => $request['apM'], 'telefono' => $request['telefono'], 'fechaNac' => $request['telefono'], 'user_id' => $request['id']]);
     $profile->save();
     $user = User::find($request['id']);
     Session::flash('message', 'Datos ingresados Correctamente');
     return view('profileUsr.profile', compact('user', 'profile'));
 }
開發者ID:behimar,項目名稱:sistema-contabilidad,代碼行數:14,代碼來源:ProfileController.php

示例6: getInsert

 public function getInsert()
 {
     //インスタンス生成
     $profile = new Profile();
     $profile->name = "fujimon";
     $profile->age = 23;
     $profile->detail = "ikemen";
     //保存
     $profile->save();
 }
開發者ID:iiyuda7,項目名稱:laravel5_testing,代碼行數:10,代碼來源:TestController.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(User $user, Request $request)
 {
     $data = $request->only('name', 'email', 'siteTitle');
     $profile = new Profile();
     $profile->user_id = $user->id;
     $profile->name = $data['name'];
     $profile->email = $data['email'];
     $profile->siteTitle = $data['siteTitle'];
     $profile->save();
     return $profile;
 }
開發者ID:callen5914,項目名稱:Portfolio-API,代碼行數:17,代碼來源:ProfileController.php

示例8: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $profile = new Profile();
     $profile->name = $request->input('name');
     $profile->avatar = $request->input('avatar');
     $profile->color = $request->input('color');
     // TODO logged in user
     $profile->user_id = 1;
     $profile->save();
     return response()->json(['profile' => $profile]);
 }
開發者ID:gpmcadam,項目名稱:bloon,代碼行數:17,代碼來源:ProfileController.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $profile = new Profile();
     $profile->user_id = Auth::user()->id;
     $profile->name = $request->input('name');
     $profile->phone_no = $request->input('phone_no');
     $profile->birthdate = $request->input('birthdate');
     $profile->experience = $request->input('experience');
     $profile->industry_id = $request->input('specialization');
     $profile->save();
     return view('employees.index', compact('profile'));
 }
開發者ID:Vladimir-Florian,項目名稱:Pasu,代碼行數:17,代碼來源:EmployeeController.php

示例10: confirm

 public function confirm($token)
 {
     $confirm = ConfirmUser::where('token', $token)->firstOrFail();
     $user = User::where('email', $confirm->email)->first();
     $user->attachRole(3);
     $user->status = 1;
     $user->save();
     $profile = new Profile();
     $profile->user_id = $user->id;
     $profile->city_id = $confirm->city_id;
     $profile->save();
     $confirm->delete();
     return redirect('auth/login')->with('status', 'Вы успешно потдвердили регистрацию. Теперь войдите в систему используя свой email и пароль.');
 }
開發者ID:AbuLoot,項目名稱:vi,代碼行數:14,代碼來源:CustomAuthController.php

示例11: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(StoreProfileRequest $request)
 {
     $profile = new Profile();
     $phone = "+" . $request->phone;
     $id = Auth::user()->id;
     $profile->user_id = $id;
     $profile->first_name = $request->first_name;
     $profile->last_name = $request->last_name;
     $profile->job = $request->job;
     $profile->phone = $phone;
     $profile->location = $request->location;
     $profile->motto = $request->motto;
     $profile->about = $request->about;
     $profile->save();
     return redirect()->route('suite')->with('info', 'You have completed your profile!');
 }
開發者ID:bambangsusanto,項目名稱:planatrium,代碼行數:22,代碼來源:ProfileController.php

示例12: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  int  $iid		industry_id
  * @param Request $request
  * @return Response
  */
 public function store($iid, Request $request)
 {
     $industry = Industry::findOrFail($iid);
     $profile = new Profile();
     $profile->name = $request->input('name');
     $profile->phone_no = $request->input('phone_no');
     $profile->birthdate = $request->input('birthdate');
     $profile->experience = $request->input('experience');
     $profile->industry_id = $iid;
     $profile->save();
     //$input = $request->all();
     //$input['industry_id'] = $iid;
     //Profile::create($input);
     //return redirect('industries.profiles.show', compact('industry'));
     return view('profiles.index', compact('industry'));
 }
開發者ID:Vladimir-Florian,項目名稱:Pasu,代碼行數:23,代碼來源:ProfilesController.php

示例13: confirm

 public function confirm($token)
 {
     $confirm = ConfirmUser::where('token', $token)->firstOrFail();
     $user = User::where('email', $confirm->email)->first();
     $user->attachRole(3);
     $user->status = 1;
     $user->save();
     $profile = new Profile();
     $profile->user_id = $user->id;
     $profile->city_id = $confirm->city_id;
     $contacts = ['phone' => null, 'telegram' => null, 'whatsapp' => null, 'viber' => null, 'phone2' => null, 'telegram2' => null, 'whatsapp2' => null, 'viber2' => null];
     $profile->phone = json_encode($contacts);
     $profile->save();
     $confirm->delete();
     return redirect('auth/login')->with('status', 'Вы успешно потдвердили регистрацию. Теперь войдите в систему используя свой email и пароль.');
 }
開發者ID:vizovteam,項目名稱:vizov,代碼行數:16,代碼來源:CustomAuthController.php

示例14: create

 public function create()
 {
     $user = Auth::user();
     // try to find the profile id that matches the user profile
     try {
         $profile = Profile::where('user_id', $user->id)->firstOrFail();
     } catch (ModelNotFoundException $e) {
         // if it fails create profile
         $profile = new Profile();
         $profile->user_id = $user->id;
         $profile->save();
         flash()->overlay('Welcome to Baking Amigo!', 'Now tell us a bit about yourself.', 'info');
     }
     // redirect to the edit page
     return redirect("/users/{$user->id}/edit");
 }
開發者ID:adrianapope,項目名稱:baking-amigo,代碼行數:16,代碼來源:ProfilesController.php

示例15: uploadTn

 public function uploadTn($fileName, $image)
 {
     $path = public_path('/images/' . Auth::user()->name);
     File::exists($path) or File::makeDirectory($path, 0755, true);
     $image->save($path . '/' . $fileName)->resize(128, 128)->save($path . '/' . 'pp.jpg');
     if (Auth::user()->profile == null) {
         $picture = new Profile();
         $picture->user_id = Auth::user()->id;
         $picture->thumbnailName = 'images/' . Auth::user()->name . '/pp.jpg';
         $picture->save();
     } else {
         $picture = Profile::where('user_id', Auth::user()->id)->first();
         $picture->user_id = Auth::user()->id;
         $picture->thumbnailName = 'images/' . Auth::user()->name . '/pp.jpg';
         $picture->save();
     }
 }
開發者ID:mathewsandi,項目名稱:Sezgi,代碼行數:17,代碼來源:DbProfileRepository.php


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