Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rappasoft's avatar

Laravel Boilerplate 2.0

I have just finished a first release of my second boilerplate, this one contains a custom modified version of my vault package built in.

Please check it out: http://laravel-boilerplate.com

I hope it serves you well and saves you time. Look out for updates in the future.

I spent a lot of time on it, and if something is wrong I would appreciate a pull request instead of a criticism post.

I built this in my spare time to alleviate all the grunt work I keep doing every time I start a new project.

And yes eventually i'll have an actual website.

Hope you like it.

0 likes
34 replies
isaackearl's avatar

I've been following this boilerplate for a little while and I really like it. I haven't used it yet, but plan on using it for my next laravel project. thanks @rappasoft

sitesense's avatar

Damn, I started playing with this 2 days ago - will have to start over :) Nice update!

sitesense's avatar

@csuarez regarding social logins, I got it working with all but Twitter. There seems to be some issues with OAuth 1 if you search around - I get a redirect loop that keeps sending me back to the Twitter auth.

Nothing to do with the "boilerplate".

By the way, there was an update to Socialite today that fixes a problem with the Github login and the email not being returned in the callback.

If anyone has Twitter working, please shout out :)

tgif's avatar

@sitesense ouch Twitter is a big one. At least you got the others working. I'm still trying to wrap my head around Laravel (which is phenomenal).

Thanks again @rappasoft! Keep up the good work. Make it bigger!!!

rappasoft's avatar

Thanks for the feedback guys, I will maintain it.

Socialite has been the biggest pain in the entire project, I almost regret putting it in because it's the number one issue request. I just can't figure it out 100%.

tgif's avatar

You'll get it. When I'm better at this I'd like to help.

sitesense's avatar

@rappasoft You're not on your own regarding Socialite. I've seen loads of posts where they just can't get twitter to work.

I have a tip for those testing on localhost or other local URL...

For example, when you setup your Google API Account for the Google login, you need a real domain for the callback (not local) that you can also enter as the "GOOGLE_REDIRECT" in your config or .env.

You can just use Google URL shortener though ( https://goo.gl/ ) on your local url - and Google will accept that URL so you can test. Same with Twitter, but there are other issues here.

Github and Facebook seem to be fine using a local URL for the callback.

rappasoft's avatar

Yes I am looking for contributors to help out with the latest best practices in the project. I learned almost all of my laravel knowledge from @JeffreyWay and i'm happy to put it all into a single start up project for others to base their projects on, and learn from.

I am in no way an expert on this, and I pride myself on learning new techniques as often as I can. So I am extremely open to other people contributing so I can both learn, and teach what I learn.

rappasoft's avatar

And I know 5.1 is coming out relatively soon, I hope there will be an easy conversion guide that doesn't require me to start over. I had to start over from 4.2 to 5, but I don't think this one is as heavy, though i'm glad it's an LTS release.

sitesense's avatar

@rappasoft thanks for heads up about the LTS, I didn't think that would ever be a thing with Laravel. Nice one Taylor!

sitesense's avatar

Yup, I found that after you mentioned the LTS, great news :)

Teranode's avatar

Transitioning my large project that uses sentry to this one >_> - I like the Blade roles. Gonna take a look at the twitter problem.

sitesense's avatar

@Steve_U hey what happened to you looking at the Twitter login? :)

Yeah, the convoluted way in which it's implemented is ridiculously confusing.

Took me some time to figure out the pieces but first of all, the url for authorization is wrong.

\vendor\league\oauth1-client\src\Client\Server\Twitter.php: line 22:

// change this
// return 'https://api.twitter.com/oauth/authenticate';
// to this
return 'https://api.twitter.com/oauth/authorize';

Next up, Twitter doesn't (won't) supply the "email" that is necessary...

I hacked this by using the Twitter ID instead:

\vendor\laravel\socialite\src\One\TwitterProvider.php: after line 14 $user = $this->server->getUserDetails($token = $this->getToken()); - add:

$user->email = $user->uid;

So, nasty hack of core files, but just to show it can work.

Need to get this fixed so I'll let it be known on Github and hopefully someone with greater skills than me can fix this shit.

Too late and too tired to do that now but I'll sort it asap.

EDIT

It's seems there's more to this Twitter login issue.

Apparently they do now supply the email but your app needs to be whitelisted by them.

I'm waiting for my application to be accepted and then I'll look at what else is required for the Twitter login to work properly.

Another workaround for the moment would be to get the user to enter their own email address, but the whole point of oauth is to avoid all that complication.

sitesense's avatar

@rappasoft maybe you're interested too :) Sorry, gotta hit the sheets, falling asleep. Good night.

Steve_U's avatar

@sitesense I don't view any indication that I was 'looking at the Twitter login?' ;-) Merely thanking @rappasoft for the boilerplate contribution.

Your workaround looks interesting though. Thanks.

Teranode's avatar

For the user roles/permissions how would you apply this to a controller rather than a route?

nolros's avatar

@sitesense I attempted to open a ticket on github some time ago, but instead I received some "great feedback" from a moderator. Seems like someone else is pushing again.

Next

Please or to participate in this conversation.