DEV Community

Cover image for Forstrap: Laravel 8 Fortify with Bootstrap 5 Scaffolding
mkfizi
mkfizi

Posted on • Updated on

Forstrap: Laravel 8 Fortify with Bootstrap 5 Scaffolding

Introduction

I've made plenty of web applications using Laravel stylized with Bootstrap and most of them requires user authentication features. Since Laravel favors Tailwind for stylization in it's out of the box packages these days, I figured I need to create a scaffolding in order to quick start my next project complete with user authentication. And this is where Forstrap comes in.

Forstrap

Forstrap is a Laravel 8 authentication boilerplate using Fortify package and stylized with Bootstrap 5 CSS framework without the complexity of Jetstream and TailwindCSS and extends Laravel Fortify base features.

How To Use This?

Run this command below where app is the folder you want to create your project with.

composer create-project mkfizi/forstrap app
Enter fullscreen mode Exit fullscreen mode

Run this command after you change your .env file

php artisan migrate 
Enter fullscreen mode Exit fullscreen mode

That's it! Your new app is now ready with authentication features

Email Configuration

In order to experience the complete Laravel Fortify and Forstrap authentication features, you must set your email configuration in .env file. You may use mailtrap.io for development purpose and use it's SMTP integration codes in your .env file.

Extended Feature

Aside from the out of the box Fortify's authentication features, this boilerplate also came with an extended feature which enables the application to send the two factor recovery codes to user's email address.

Folder Structure

The files for this feature can be located in these folders

App/
|--Http/
|  |--Controllers
|     |--EmailController.php
|--Mail/
   |--TwoFactorRecoveryCodes.php
Resources/
|--Views/
   |--Emails/
      |--two-factor-recovery-codes.blade.php
Enter fullscreen mode Exit fullscreen mode

Route

The route for this feature can be located in web.php with this line

Route::post('/user/two-factor-recovery-codes/email', 'App\Http\Controllers\EmailController@sendTwoFactorRecoveryCodes')->name('two-factor-recovery-codes.send');
Enter fullscreen mode Exit fullscreen mode

You may check out Forstrap's github repository here

Future Updates & Recommendations

I am thinking of including more features that's authentication related such as SMS verification or a One Time Password verification. But I couldn't find a free solution without a paid options. Also, I intended to include QR Code email recovery but I found out that most of the email providers doesn't do well with svg codes. Let me know if you have any ideas or a new feature idea I should include in comment below.

Top comments (2)

Collapse
 
mazaczenko profile image
Wojciech Mazur

Perfect !

Collapse
 
mkfizi profile image
mkfizi

Thanks!