• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

GhazaliTajuddin.com

Another Kuantan Blogger

  • Home
  • Blog
    • Kuantan
    • Foods
    • Technology
    • Health
  • Stock Photography
    • Senarai Microstock Agency
    • Membuka akaun contributor Shutterstock.com
    • Tips untuk 10 keping gambar pertama Shutterstock.com
    • Mengapa Shutterstock.com reject gambar / submission
    • Model Release
    • Bagaimana withdraw earning daripada Fotolia
    • Bagaimana untuk mengisi keyword kepada imej dengan menggunakan Adobe Photoshop

Register

Sentinel::Register() Vs Sentinel::RegisterAndActivate()

January 17, 2017 by ghazalitajuddin Leave a Comment

Sentinel::RegisterAndActivate()

       //Register the $request user and activate
	if(Sentinel::registerAndActivate($request->All())){

			//Search the new registered user
			$user = User::whereEmail($request->get('email'))->firstOrFail();

			//Bind the user to Activation Table
			$activation=Activation::create($userSentinel);

			//Assign A Profile To The New Registered User 
			$userProfile = new Profile();
			$userProfile->user_id = $user->id;
			$userProfile->smoked = $request->smoked;
			$userProfile->lat = 0.0;
			$userProfile->lng = 0.0;

			$user->profile()->save($userProfile);
			
			//Find role
			$role=Sentinel::findRoleBySlug('member')->firstOrFail();

			//Attach the user to the Role
			$role->users()->attach($user);


			return redirect()->back()->with('status','Registration Successful !');
		}else{
			return redirect()->back()->with('error','Registration Failed !');
			//return back()->withErrors($validator);
		}

Sentinel::Register()

                if($userSentinel = Sentinel::register($request->All())){

			//Search the new registered user
			$user = User::whereEmail($request->get('email'))->firstOrFail();

			//Bind the user to Activation Table
			$activation=Activation::create($userSentinel);

			//Assign A Profile To The New Registered User 
			$userProfile = new Profile();
			$userProfile->user_id = $user->id;
			$userProfile->smoked = $request->smoked;
			$userProfile->lat = 0.0;
			$userProfile->lng = 0.0;

			$user->profile()->save($userProfile);
			
			//Find role
			$role=Sentinel::findRoleBySlug('member')->firstOrFail();

			//Attach the user to the Role
			$role->users()->attach($user);

			return redirect()->back()->with('status','Registration Successful !');
		}else{
			return redirect()->back()->with('error','Registration Failed !');
			//return back()->withErrors($validator);
		}

 

Filed Under: General Tagged With: Register, RegisterAndActivate, sentinel

Primary Sidebar

“Solat. Sabar. Syukur. Senyum. Sedekah.”

For Collaboration, Events & Review, kindly contact me at +6016[-]9212092 or click Whatsapp button on this page.

Sponsor

Recent Posts

BadMethodCallException Method Illuminate\Database\Eloquent\Collection::roles does not exist.

User Roles And Permissions Without Package Laravel 10

Laravel Many To Many Relationship

Makan malam bersama keluarga di Awangan Palace

Sarapan pagi di Warung Gulai Kawah

Recent Comments

  • helmi on Personal Tips Berhenti Merokok
  • ghazalitajuddin on Personal Tips Berhenti Merokok
  • helmi on Personal Tips Berhenti Merokok
  • ghazalitajuddin on Nasi Lemak Kukus Restoran Zaman. Otai masih berbisa.
  • ghazalitajuddin on Air tangki radiator Proton Exora cepat kering? Cuba tukar penutup radiator!
  • Mal on Nasi Lemak Kukus Restoran Zaman. Otai masih berbisa.
  • Firdaus on Air tangki radiator Proton Exora cepat kering? Cuba tukar penutup radiator!

My Link

  • Takaful Insurance Web

JJCM

Day Trip Kuantan – Kuala Gandah – Temerloh – Kuantan

Berpagian di Restoran Astana Cafe

Kuih Akok Kedut Kelantan

Rojak Pak Lah Taman Gelora

Roti Canai Pulau Gerai Mat Zam-Zam

Tags

bebas rokok berhenti merokok breakfast Controller Framework Gezzeg Photography & Design health jalan-jalan cari makan jalan-jalan cari makan kuantan jjcm jjcm kuantan Jurufoto Kuantan Kuantan Kuantan Photographer kuantan programmer kuantan web developer kuantan webmaster laravel merokok merbahayakan kesihatan model MVC nikmat rokok OOP Pahang Pahangtourism pahang tourism Photo Manipulation PHP rajalanun retired smoking revisit pahang 2018 shutterstock stop smoking stop smoking tips stop smoking withdrawal symptom tips tips berhenti merokok View visit malaysia 2020 visit pahang visitpahang white wordpress yii Yii Framework

Recent Posts

  • BadMethodCallException Method Illuminate\Database\Eloquent\Collection::roles does not exist.
  • User Roles And Permissions Without Package Laravel 10
  • Laravel Many To Many Relationship
  • Makan malam bersama keluarga di Awangan Palace
  • Sarapan pagi di Warung Gulai Kawah

Copyright © 2025 — Ghazali Tajuddin • All rights reserved. •