So for those who would be using Laravel 8 with jetstream, this stack uses Fortify for authentication and i quote from laravel documentation 'Fortify does not provide its own user interface, it is meant to be paired with your own user interface which makes requests to the routes it registers'. if that is hard to understand then follow the laravel.com/docs/8.x/fortify#intro... for clarity or drop a comment below.
So let's get to the chase. The most important thing in this system is the session that Mr Simi set to cache a session variable named 'referrer' if the register route contains a ref query parameter. now go to App\Providers\FortiftyServiceProvider in the boot() method and paste the code below
Fortify::registerView(function(Request $request) {
if ($request->has('ref')) {
session(['referrer' => $request->query('ref')]);
}
return view('auth.register');
});
Now the code is doing the same as that in the registerController.
Secondly, after caching the ref=user and getting the user's id, you would need to pass in this data in the create() method. You will find this file in the App\Actions\Foritfy\CreateNewUser class. Like what i did, i replaced the codes in this file with that of the RegisterController and then pass in the
This is the code that pulls the referrer's credentials and parses it in to create a new user. Every other thing stays the same from the User class and from the migration class file too.
It worked for me because i was using laravel 8 for a referral system project. Like i said, drop a comment if you have any challanges below...Cheers
Thanks for this guys. I'm new to Laravel. The project I'm working on includes referrals system and I'm using Jetstream. Would you like to share what you've done please. Thanks
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
So for those who would be using Laravel 8 with jetstream, this stack uses Fortify for authentication and i quote from laravel documentation 'Fortify does not provide its own user interface, it is meant to be paired with your own user interface which makes requests to the routes it registers'. if that is hard to understand then follow the laravel.com/docs/8.x/fortify#intro... for clarity or drop a comment below.
So let's get to the chase. The most important thing in this system is the session that Mr Simi set to cache a session variable named 'referrer' if the register route contains a ref query parameter. now go to App\Providers\FortiftyServiceProvider in the boot() method and paste the code below
Fortify::registerView(function(Request $request) {
if ($request->has('ref')) {
session(['referrer' => $request->query('ref')]);
}
return view('auth.register');
});
Now the code is doing the same as that in the registerController.
Secondly, after caching the ref=user and getting the user's id, you would need to pass in this data in the create() method. You will find this file in the App\Actions\Foritfy\CreateNewUser class. Like what i did, i replaced the codes in this file with that of the RegisterController and then pass in the
This is the code that pulls the referrer's credentials and parses it in to create a new user. Every other thing stays the same from the User class and from the migration class file too.
It worked for me because i was using laravel 8 for a referral system project. Like i said, drop a comment if you have any challanges below...Cheers
where to write Notification code
You have to create a notification. Kindly refer to the notification section of the Laravel docs to get started with that
laravel.com/docs/8.x/notifications
How can I get in touch with you? a means of contact
You can send me a tweet on X (formerly Twitter)
unable to send message by x
Send me a mail at deifilius1@gmail.com
Thanks! I should update this tutorial to reflect the changes in Laravel since it was written but I'm currently swamped with work.
Thanks once again
Okay boss.
Thanks it's work fine in laravel 8..ihave make refferel system just 40 minutes.. Thanks for Your Help..
Thanks for this guys. I'm new to Laravel. The project I'm working on includes referrals system and I'm using Jetstream. Would you like to share what you've done please. Thanks