Hey Guys,
Im wondering if someone could help me out ... Im writing an simple app which will take users details and stripe info, then create a user, pay for a plan and sign them up all in one step.
I want to create the authentication with my own routes and views and migrations but all i can find online is how to use the php artisan make:auth scaffold.
Would anyone be able to give me a hand or know where i can get a tutorial on doing this manually in 5.2?
Thanks heaps!
Best thing you could do is to start with the make:auth command and get a thorough understanding of what it does so that you can replicate/modify the parts that you want to.
Most of the code is stored within traits in "Illuminate\Foundation\Auth" in your Vendor folder.
Good luck!
(Ps: Check out Laravel Spark - Maybe it will save a lot of time coding it yourself)
Thanks for your input, i have used the make:auth on a sample installation and had a look around a little bit, is it just a matter of taking the code from the already made AuthController and putting them in my new controller? or is it a little more in depth?
It's probably more in depth than that. If all you're doing is copying and pasting then you may as well just use it as it is.
Understanding the make:Auth scaffold should give you a good understanding of how to do it yourself.
To me it sounds like you have a lot going on what you're trying to accomplish.
Create a User
Charge their credit card
Sign them up to a plan
Log them in
Validate and Handle each of the above too.
All of those things are quite different and should be broken down into their own responsibilities in the code. Even if it looks like it all happens at once to the user, your code should still treat each of them separately so that it doesn't become a nightmare to test, maintain and understand.
You really should study the code base of the make:auth scaffold first. That will be the easiest way to teach you how to build your own.
Also, consider look into Event Listeners which may be a good pattern to follow for the above.