├── laravel.log ├── public ├── favicon.ico ├── robots.txt ├── css │ └── app.css ├── .htaccess ├── js │ └── sessions.js └── index.php ├── database ├── seeds │ ├── .gitkeep │ └── DatabaseSeeder.php ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2018_10_22_220102_create_one_touch_table.php │ └── 2014_10_12_000000_create_users_table.php └── .gitignore ├── app ├── Handlers │ ├── Events │ │ └── .gitkeep │ └── Commands │ │ └── .gitkeep ├── Events │ └── Event.php ├── Commands │ └── Command.php ├── Http │ ├── Requests │ │ └── Request.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── HomeController.php │ │ ├── WelcomeController.php │ │ └── Auth │ │ │ ├── PasswordController.php │ │ │ ├── AuthyController.php │ │ │ └── AuthController.php │ ├── routes.php │ ├── Middleware │ │ ├── VerifyCsrfToken.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── Authenticate.php │ │ └── ValidateAuthyRequest.php │ └── Kernel.php ├── OneTouch.php ├── Providers │ ├── ConfigServiceProvider.php │ ├── BusServiceProvider.php │ ├── EventServiceProvider.php │ ├── AppServiceProvider.php │ └── RouteServiceProvider.php ├── Console │ ├── Kernel.php │ └── Commands │ │ └── Inspire.php ├── Exceptions │ └── Handler.php ├── Services │ ├── Registrar.php │ └── Authy.php ├── Authy │ └── Service.php └── User.php ├── resources ├── views │ ├── vendor │ │ └── .gitkeep │ ├── emails │ │ └── password.blade.php │ ├── home.blade.php │ ├── errors │ │ └── 503.blade.php │ ├── welcome.blade.php │ ├── auth │ │ ├── password.blade.php │ │ ├── two-factor.blade.php │ │ ├── reset.blade.php │ │ ├── register.blade.php │ │ └── login.blade.php │ └── app.blade.php ├── assets │ └── less │ │ ├── bootstrap │ │ ├── mixins │ │ │ ├── center-block.less │ │ │ ├── text-emphasis.less │ │ │ ├── size.less │ │ │ ├── background-variant.less │ │ │ ├── opacity.less │ │ │ ├── text-overflow.less │ │ │ ├── tab-focus.less │ │ │ ├── labels.less │ │ │ ├── resize.less │ │ │ ├── progress-bar.less │ │ │ ├── nav-divider.less │ │ │ ├── reset-filter.less │ │ │ ├── alerts.less │ │ │ ├── nav-vertical-align.less │ │ │ ├── responsive-visibility.less │ │ │ ├── pagination.less │ │ │ ├── border-radius.less │ │ │ ├── panels.less │ │ │ ├── list-group.less │ │ │ ├── hide-text.less │ │ │ ├── clearfix.less │ │ │ ├── table-row.less │ │ │ ├── image.less │ │ │ ├── buttons.less │ │ │ ├── forms.less │ │ │ ├── grid-framework.less │ │ │ ├── grid.less │ │ │ └── gradients.less │ │ ├── wells.less │ │ ├── breadcrumbs.less │ │ ├── responsive-embed.less │ │ ├── close.less │ │ ├── media.less │ │ ├── component-animations.less │ │ ├── thumbnails.less │ │ ├── utilities.less │ │ ├── pager.less │ │ ├── jumbotron.less │ │ ├── mixins.less │ │ ├── bootstrap.less │ │ ├── labels.less │ │ ├── badges.less │ │ ├── code.less │ │ ├── grid.less │ │ ├── alerts.less │ │ ├── progress-bars.less │ │ ├── pagination.less │ │ ├── print.less │ │ ├── scaffolding.less │ │ ├── tooltip.less │ │ ├── list-group.less │ │ ├── popovers.less │ │ ├── modals.less │ │ ├── buttons.less │ │ ├── input-groups.less │ │ ├── responsive-utilities.less │ │ └── tables.less │ │ └── app.less └── lang │ └── en │ ├── pagination.php │ ├── passwords.php │ └── validation.php ├── storage ├── .gitignore ├── app │ └── .gitignore ├── debugbar │ └── .gitignore ├── logs │ └── .gitignore └── framework │ ├── cache │ └── .gitignore │ ├── views │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── bootstrap ├── cache │ └── .gitignore ├── autoload.php └── app.php ├── Procfile ├── .gitignore ├── phpspec.yml ├── .github └── dependabot.yml ├── .env.example ├── tests ├── HomeControllerTest.php ├── TestCase.php └── AuthyControllerTest.php ├── gulpfile.js ├── server.php ├── channel.xml ├── app.json ├── phpunit.xml ├── config ├── services.php ├── view.php ├── compile.php ├── filesystems.php ├── cache.php ├── auth.php ├── queue.php ├── trustedproxy.php ├── mail.php ├── database.php └── session.php ├── composer.json ├── artisan ├── README.md └── SETUP.markdown /laravel.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Handlers/Events/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Handlers/Commands/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/.gitignore: -------------------------------------------------------------------------------- 1 | laravel.log -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/debugbar/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: vendor/bin/heroku-php-apache2 public 2 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /vendor/ 3 | package.json 4 | .env 5 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /app/Events/Event.php: -------------------------------------------------------------------------------- 1 | .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | call('GET', '/'); 13 | 14 | $this->assertEquals(302, $response->getStatusCode()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Home
9 | 10 |
11 | You are logged in! 12 |
13 |
14 |
15 |
16 |
17 | @endsection 18 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /app/OneTouch.php: -------------------------------------------------------------------------------- 1 | li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/Providers/ConfigServiceProvider.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | $uri = urldecode( 10 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 11 | ); 12 | 13 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 14 | // built-in PHP web server. This provides a convenient way to test a Laravel 15 | // application without having installed a "real" web server software here. 16 | if ($uri !== '/' and file_exists(__DIR__.'/public'.$uri)) 17 | { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 26 | ->hourly(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /channel.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | pecl.php.net 5 | pecl 6 | PHP Extension Community Library 7 | PEAR_Validator_PECL 8 | 9 | 10 | 11 | https://pecl.php.net/rest/ 12 | https://pecl.php.net/rest/ 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "2FA in Laravel 5 with Authy", 3 | "description": "Two Factor Authentication in Laravel 5 with Authy", 4 | "website": "https://www.twilio.com/docs/howto/walkthrough/two-factor-authentication/php/laravel", 5 | "repository": "https://github.com/TwilioDevEd/authy2fa-laravel", 6 | "logo": "https://s3.amazonaws.com/howtodocs/twilio-logo.png", 7 | "success_url": "/landing.html", 8 | "keywords": ["twilio", "PHP", "laravel", "MMS"], 9 | "addons": ["heroku-postgresql:hobby-dev"], 10 | "env": { 11 | "AUTHY_API_KEY": { 12 | "description": "Your Authy authentication token", 13 | "required": true 14 | } 15 | }, 16 | "scripts": { 17 | "postdeploy": "php artisan migrate --force" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token')->index(); 19 | $table->timestamp('created_at'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('password_resets'); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | 26 | // Modifier class for 16:9 aspect ratio 27 | &.embed-responsive-16by9 { 28 | padding-bottom: 56.25%; 29 | } 30 | 31 | // Modifier class for 4:3 aspect ratio 32 | &.embed-responsive-4by3 { 33 | padding-bottom: 75%; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Providers/BusServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapUsing(function($command) 17 | { 18 | return Dispatcher::simpleMapping( 19 | $command, 'App\Commands', 'App\Handlers\Commands' 20 | ); 21 | }); 22 | } 23 | 24 | /** 25 | * Register any application services. 26 | * 27 | * @return void 28 | */ 29 | public function register() 30 | { 31 | // 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('UserTableSeeder'); 19 | } 20 | } 21 | 22 | class UserTableSeeder extends Seeder { 23 | public function run() 24 | { 25 | DB::table('users')->delete(); 26 | // make sure to update this code with your actual e-mail and phone number 27 | User::create(array('name'=>'Ricky','email' => 'ricky@twilio.com','phone_number' => '7187533087', 'password' => bcrypt('testtest'), 'country_code' => '+1')); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Console/Commands/Inspire.php: -------------------------------------------------------------------------------- 1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 15 | 'EventListener', 16 | ], 17 | ]; 18 | 19 | /** 20 | * Register any other events for your application. 21 | * 22 | * @param \Illuminate\Contracts\Events\Dispatcher $events 23 | * @return void 24 | */ 25 | public function boot(DispatcherContract $events) 26 | { 27 | parent::boot($events); 28 | 29 | // 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | "Passwords must be at least six characters and match the confirmation.", 17 | "user" => "We can't find a user with that e-mail address.", 18 | "token" => "This password reset token is invalid.", 19 | "sent" => "We have e-mailed your password reset link!", 20 | "reset" => "Your password has been reset!", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /app/Http/routes.php: -------------------------------------------------------------------------------- 1 | 'validate_authy', 'uses'=>'Auth\AuthyController@callback']); 20 | 21 | Route::controllers([ 22 | 'auth' => 'Auth\AuthController', 23 | 'password' => 'Auth\PasswordController', 24 | ]); 25 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | except_urls) . '#'; 21 | 22 | if ($this->isReading($request) || $this->tokensMatch($request) || preg_match($regex, $request->path())) 23 | { 24 | return $this->addCookieToResponse($request, $next($request)); 25 | } 26 | 27 | throw new TokenMismatchException; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/ 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /database/migrations/2018_10_22_220102_create_one_touch_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('uuid')->index(); 19 | $table->enum('status', ['pending', 'approved', 'denied'])->default('pending'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('one_touch'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 33 | 34 | 35 |
36 |
37 |
Be right back.
38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => '', 19 | 'secret' => '', 20 | ], 21 | 22 | 'mandrill' => [ 23 | 'secret' => '', 24 | ], 25 | 26 | 'ses' => [ 27 | 'key' => '', 28 | 'secret' => '', 29 | 'region' => 'us-east-1', 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => 'User', 34 | 'secret' => '', 35 | ], 36 | 37 | ]; 38 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media-right, 11 | .media > .pull-right { 12 | padding-left: 10px; 13 | } 14 | 15 | .media-left, 16 | .media > .pull-left { 17 | padding-right: 10px; 18 | } 19 | 20 | .media-left, 21 | .media-right, 22 | .media-body { 23 | display: table-cell; 24 | vertical-align: top; 25 | } 26 | 27 | .media-middle { 28 | vertical-align: middle; 29 | } 30 | 31 | .media-bottom { 32 | vertical-align: bottom; 33 | } 34 | 35 | // Reset margins on headings for tighter default spacing 36 | .media-heading { 37 | margin-top: 0; 38 | margin-bottom: 5px; 39 | } 40 | 41 | // Media list variation 42 | // 43 | // Undo default ul/ol styles 44 | .media-list { 45 | padding-left: 0; 46 | list-style: none; 47 | } 48 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | visibility: hidden; 21 | 22 | &.in { display: block; visibility: visible; } 23 | tr&.in { display: table-row; } 24 | tbody&.in { display: table-row-group; } 25 | } 26 | 27 | .collapsing { 28 | position: relative; 29 | height: 0; 30 | overflow: hidden; 31 | .transition-property(~"height, visibility"); 32 | .transition-duration(.35s); 33 | .transition-timing-function(ease); 34 | } 35 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make('Illuminate\Contracts\Console\Kernel')->bootstrap(); 22 | 23 | return $app; 24 | } 25 | 26 | public function setUp() 27 | { 28 | parent::setUp(); 29 | Artisan::call('migrate'); 30 | } 31 | 32 | public function tearDown() 33 | { 34 | Artisan::call('migrate:reset'); 35 | parent::tearDown(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 24 | } 25 | 26 | /** 27 | * Show the application dashboard to the user. 28 | * 29 | * @return Response 30 | */ 31 | public function index() 32 | { 33 | return view('home'); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 25 | } 26 | 27 | /** 28 | * Handle an incoming request. 29 | * 30 | * @param \Illuminate\Http\Request $request 31 | * @param \Closure $next 32 | * @return mixed 33 | */ 34 | public function handle($request, Closure $next) 35 | { 36 | if ($this->auth->check()) 37 | { 38 | return new RedirectResponse(url('/home')); 39 | } 40 | 41 | return $next($request); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Http/Controllers/WelcomeController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 24 | } 25 | 26 | /** 27 | * Show the application welcome screen to the user. 28 | * 29 | * @return Response 30 | */ 31 | public function index() 32 | { 33 | return view('welcome'); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind( 29 | 'Illuminate\Contracts\Auth\Registrar', 30 | 'App\Services\Registrar' 31 | ); 32 | 33 | $this->app->bind( 34 | 'App\Authy\Service', 35 | 'App\Services\Authy' 36 | ); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 37 | 38 | 39 |
40 |
41 |
Laravel 5
42 |
{{ Inspiring::quote() }}
43 |
44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 24 | } 25 | 26 | /** 27 | * Handle an incoming request. 28 | * 29 | * @param \Illuminate\Http\Request $request 30 | * @param \Closure $next 31 | * @return mixed 32 | */ 33 | public function handle($request, Closure $next) 34 | { 35 | if ($this->auth->guest()) 36 | { 37 | if ($request->ajax()) 38 | { 39 | return response('Unauthorized.', 401); 40 | } 41 | else 42 | { 43 | return redirect()->guest('auth/login'); 44 | } 45 | } 46 | 47 | return $next($request); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')) 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path().'/framework/views'), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 'App\Http\Middleware\Authenticate', 29 | 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth', 30 | 'guest' => 'App\Http\Middleware\RedirectIfAuthenticated', 31 | 'validate_authy' => 'App\Http\Middleware\ValidateAuthyRequest', 32 | ]; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=5.6.0", 9 | "laravel/framework": "5.1.*", 10 | "authy/php": "~3.0", 11 | "ext-curl": "*", 12 | "ext-json": "*", 13 | "fideloper/proxy": "~3.3" 14 | }, 15 | "require-dev": { 16 | "phpunit/phpunit": "~4.0", 17 | "phpspec/phpspec": "~2.1" 18 | }, 19 | "autoload": { 20 | "classmap": [ 21 | "database" 22 | ], 23 | "psr-4": { 24 | "App\\": "app/" 25 | } 26 | }, 27 | "autoload-dev": { 28 | "classmap": [ 29 | "tests/TestCase.php" 30 | ] 31 | }, 32 | "scripts": { 33 | "post-install-cmd": [ 34 | "php artisan clear-compiled", 35 | "php artisan optimize" 36 | ], 37 | "post-update-cmd": [ 38 | "php artisan clear-compiled", 39 | "php artisan optimize" 40 | ], 41 | "post-create-project-cmd": [ 42 | "php -r \"copy('.env.example', '.env');\"", 43 | "php artisan key:generate" 44 | ] 45 | }, 46 | "config": { 47 | "preferred-install": "dist" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password', 60); 21 | $table->string('country_code'); 22 | $table->string('phone_number'); 23 | $table->string('authy_status')->default('unverified'); 24 | $table->string('authy_id')->nullable(); 25 | $table->rememberToken(); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::drop('users'); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | group(['namespace' => $this->namespace], function($router) 39 | { 40 | require app_path('Http/routes.php'); 41 | }); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/Services/Registrar.php: -------------------------------------------------------------------------------- 1 | 'required|max:255', 19 | 'email' => 'required|email|max:255|unique:users', 20 | 'country_code' => 'required', 21 | 'phone_number' => 'required|min:7|unique:users', 22 | 'password' => 'required|confirmed|min:6', 23 | ]); 24 | } 25 | 26 | /** 27 | * Create a new user instance after a valid registration. 28 | * 29 | * @param array $data 30 | * @return User 31 | */ 32 | public function create(array $data) 33 | { 34 | return User::create([ 35 | 'name' => $data['name'], 36 | 'email' => $data['email'], 37 | 'country_code' => $data['country_code'], 38 | 'phone_number' => $data['phone_number'], 39 | 'password' => bcrypt($data['password']), 40 | ]); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | hr { 23 | border-top-color: darken(@jumbotron-bg, 10%); 24 | } 25 | 26 | .container &, 27 | .container-fluid & { 28 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 29 | } 30 | 31 | .container { 32 | max-width: 100%; 33 | } 34 | 35 | @media screen and (min-width: @screen-sm-min) { 36 | padding: (@jumbotron-padding * 1.6) 0; 37 | 38 | .container &, 39 | .container-fluid & { 40 | padding-left: (@jumbotron-padding * 2); 41 | padding-right: (@jumbotron-padding * 2); 42 | } 43 | 44 | h1, 45 | .h1 { 46 | font-size: (@font-size-base * 4.5); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordController.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 33 | $this->passwords = $passwords; 34 | 35 | $this->middleware('guest'); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:hover, 12 | &:focus, 13 | &.focus, 14 | &:active, 15 | &.active, 16 | .open > .dropdown-toggle& { 17 | color: @color; 18 | background-color: darken(@background, 10%); 19 | border-color: darken(@border, 12%); 20 | } 21 | &:active, 22 | &.active, 23 | .open > .dropdown-toggle& { 24 | background-image: none; 25 | } 26 | &.disabled, 27 | &[disabled], 28 | fieldset[disabled] & { 29 | &, 30 | &:hover, 31 | &:focus, 32 | &.focus, 33 | &:active, 34 | &.active { 35 | background-color: @background; 36 | border-color: @border; 37 | } 38 | } 39 | 40 | .badge { 41 | color: @background; 42 | background-color: @color; 43 | } 44 | } 45 | 46 | // Button sizes 47 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 48 | padding: @padding-vertical @padding-horizontal; 49 | font-size: @font-size; 50 | line-height: @line-height; 51 | border-radius: @border-radius; 52 | } 53 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | @import "tables.less"; 16 | @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | @import "modals.less"; 44 | @import "tooltip.less"; 45 | @import "popovers.less"; 46 | @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | 18 | realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'), 19 | realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'), 20 | realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'), 21 | realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'), 22 | realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'), 23 | 24 | ], 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Compiled File Providers 29 | |-------------------------------------------------------------------------- 30 | | 31 | | Here you may list service providers which define a "compiles" function 32 | | that returns additional files that should be compiled, providing an 33 | | easy way to get common files from any packages you are utilizing. 34 | | 35 | */ 36 | 37 | 'providers' => [ 38 | // 39 | ], 40 | 41 | ]; 42 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | 36 | // Hover state, but only for links 37 | a& { 38 | &:hover, 39 | &:focus { 40 | color: @badge-link-hover-color; 41 | text-decoration: none; 42 | cursor: pointer; 43 | } 44 | } 45 | 46 | // Account for badges in navs 47 | .list-group-item.active > &, 48 | .nav-pills > .active > a > & { 49 | color: @badge-active-color; 50 | background-color: @badge-active-bg; 51 | } 52 | .list-group-item > & { 53 | float: right; 54 | } 55 | .list-group-item > & + & { 56 | margin-right: 5px; 57 | } 58 | .nav-pills > li > a > & { 59 | margin-left: 3px; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Authy/Service.php: -------------------------------------------------------------------------------- 1 | 5 |
6 |
7 |
8 |
Reset Password
9 |
10 | @if (session('status')) 11 |
12 | {{ session('status') }} 13 |
14 | @endif 15 | 16 | @if (count($errors) > 0) 17 |
18 | Whoops! There were some problems with your input.

19 |
    20 | @foreach ($errors->all() as $error) 21 |
  • {{ $error }}
  • 22 | @endforeach 23 |
24 |
25 | @endif 26 | 27 |
28 | 29 | 30 |
31 | 32 |
33 | 34 |
35 |
36 | 37 |
38 |
39 | 42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | 50 | @endsection 51 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthyController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 20 | } 21 | 22 | /** 23 | * Check One Touch authorization status 24 | * 25 | * @param Request $request 26 | * @return \Illuminate\Http\JsonResponse 27 | */ 28 | public function status(Request $request) 29 | { 30 | $oneTouch = OneTouch::where('uuid', '=', Session::get('one_touch_uuid'))->firstOrFail(); 31 | $status = $oneTouch->status; 32 | if ($status == 'approved') { 33 | Auth::login(User::find(Session::get('id'))); 34 | } 35 | return response()->json(['status' => $status]); 36 | } 37 | 38 | /** 39 | * Public webhook for Authy 40 | * 41 | * @param Request $request 42 | * @return string 43 | */ 44 | public function callback(Request $request) 45 | { 46 | $uuid = $request->input('uuid'); 47 | $oneTouch = OneTouch::where('uuid', '=', $uuid)->first(); 48 | if ($oneTouch != null) { 49 | $oneTouch->status = $request->input('status'); 50 | $oneTouch->save(); 51 | return "ok"; 52 | } 53 | return "invalid uuid: $uuid"; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /resources/views/auth/two-factor.blade.php: -------------------------------------------------------------------------------- 1 | @extends('app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Login
9 |
10 | @if (count($errors) > 0) 11 |
12 | Whoops! There were some problems with your input.

13 |
    14 | @foreach ($errors->all() as $error) 15 |
  • {{ $error }}
  • 16 | @endforeach 17 |
18 |
19 | @endif 20 | 21 |
22 | 23 | 24 |
25 | 26 |
27 | 28 |
29 |
30 | 31 |
32 |
33 | 36 | 37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | @endsection 46 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | 'Illuminate\Contracts\Http\Kernel', 31 | 'App\Http\Kernel' 32 | ); 33 | 34 | $app->singleton( 35 | 'Illuminate\Contracts\Console\Kernel', 36 | 'App\Console\Kernel' 37 | ); 38 | 39 | $app->singleton( 40 | 'Illuminate\Contracts\Debug\ExceptionHandler', 41 | 'App\Exceptions\Handler' 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /tests/AuthyControllerTest.php: -------------------------------------------------------------------------------- 1 | $uuid]); 25 | 26 | $this->json('POST', 27 | "/authy/callback", 28 | [ 29 | "callback_action" => "approval_request_status", 30 | "uuid" => "$uuid", 31 | "status" => "approved", 32 | "approval_request" => []]) 33 | ->see('ok'); 34 | 35 | $one_touch = OneTouch::where('uuid', '=', $uuid)->first(); 36 | 37 | $this->assertEquals('approved', $one_touch->status); 38 | 39 | $one_touch->delete(); 40 | 41 | } 42 | 43 | 44 | public function testStatusAction() 45 | { 46 | $uuid = 'f5c96706-fcb3-4186-b13e-5a2b0943f780'; 47 | 48 | $one_touch = OneTouch::create(['uuid' => $uuid]); 49 | $user = User::create(['name' => 'joe', 'password' => 'pass', 'email' => 'joe@example.com', 50 | 'phone_number' => '123456789', 'country_code' => '+1']); 51 | 52 | $this->withSession(['one_touch_uuid' => $uuid, 'id' => $user->id])->get("authy/status") 53 | ->seeJson(['status' => 'pending']); 54 | 55 | $one_touch->delete(); 56 | $user->delete(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make('Illuminate\Contracts\Console\Kernel'); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissible alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 41 | .alert-dismissible { 42 | padding-right: (@alert-padding + 20); 43 | 44 | // Adjust close link position 45 | .close { 46 | position: relative; 47 | top: -2px; 48 | right: -21px; 49 | color: inherit; 50 | } 51 | } 52 | 53 | // Alternate styles 54 | // 55 | // Generate contextual modifier classes for colorizing the alert. 56 | 57 | .alert-success { 58 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 59 | } 60 | .alert-info { 61 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 62 | } 63 | .alert-warning { 64 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 65 | } 66 | .alert-danger { 67 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 68 | } 69 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | authy_id != $authy_id) { 41 | $this->authy_id = $authy_id; 42 | $this->save(); 43 | } 44 | } 45 | 46 | /** 47 | * @param $status string 48 | */ 49 | public function updateVerificationStatus($status) { 50 | // reset oneTouch status 51 | if ($this->authy_status != $status) { 52 | $this->authy_status = $status; 53 | $this->save(); 54 | } 55 | } 56 | 57 | public function updateOneTouchUuid($uuid) { 58 | if ($this->authy_one_touch_uuid != $uuid) { 59 | $this->authy_one_touch_uuid = $uuid; 60 | $this->save(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /resources/views/auth/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 |
10 | @if (count($errors) > 0) 11 |
12 | Whoops! There were some problems with your input.

13 |
    14 | @foreach ($errors->all() as $error) 15 |
  • {{ $error }}
  • 16 | @endforeach 17 |
18 |
19 | @endif 20 | 21 |
22 | 23 | 24 | 25 |
26 | 27 |
28 | 29 |
30 |
31 | 32 |
33 | 34 |
35 | 36 |
37 |
38 | 39 |
40 | 41 |
42 | 43 |
44 |
45 | 46 |
47 |
48 | 51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | @endsection 60 | -------------------------------------------------------------------------------- /app/Http/Middleware/ValidateAuthyRequest.php: -------------------------------------------------------------------------------- 1 | $v) { 27 | if (is_array($v)) { 28 | ksort($v); 29 | $new_params[$k] = $v; 30 | foreach ($v as $k2 => $v2) { 31 | if (is_array($v2)) { 32 | ksort($v2); 33 | $new_params[$k][$k2] = $v2; 34 | foreach ($v2 as $k3 => $v3) { 35 | $v3 = $this->check_bool($v3); 36 | $new_params[$k][$k2][$k3] = $v3; 37 | } 38 | } else { 39 | $v2 = $this->check_bool($v2); 40 | $new_params[$k][$k2] = $v2; 41 | } 42 | 43 | } 44 | } else { 45 | $v = $this->check_bool($v); 46 | $new_params[$k] = $v; 47 | } 48 | } 49 | ksort($new_params); 50 | return $new_params; 51 | } 52 | 53 | public function handle($request, Closure $next) 54 | { 55 | $key = config('app.authy_api_key'); 56 | $url = $request->url(); 57 | $params = $request->all(); 58 | $nonce = $request->header("X-Authy-Signature-Nonce"); 59 | $theirs = $request->header('X-Authy-Signature'); 60 | 61 | $sorted_params = $this->sort_params($params); 62 | $query = http_build_query($sorted_params); 63 | $message = $nonce . '|' . $request->method() . '|' . $url . '|' . $query; 64 | 65 | $s = hash_hmac('sha256', $message, $key, true); 66 | $mine = base64_encode($s); 67 | 68 | if ($theirs != $mine) { 69 | return "Not a valid Authy request."; 70 | } else { 71 | return $next($request); 72 | } 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader for 15 | | our application. We just need to utilize it! We'll simply require it 16 | | into the script here so that we don't have to worry about manual 17 | | loading any of our classes later on. It feels nice to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let us turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight our users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/app.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have prepared for them. 46 | | 47 | */ 48 | 49 | $kernel = $app->make('Illuminate\Contracts\Http\Kernel'); 50 | 51 | $response = $kernel->handle( 52 | $request = Illuminate\Http\Request::capture() 53 | ); 54 | 55 | $response->send(); 56 | 57 | $kernel->terminate($request, $response); 58 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | 'local', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Default Cloud Filesystem Disk 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Many applications store files both locally and in the cloud. For this 26 | | reason, you may specify a default "cloud" driver here. This driver 27 | | will be bound as the Cloud disk implementation in the container. 28 | | 29 | */ 30 | 31 | 'cloud' => 's3', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Filesystem Disks 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here you may configure as many filesystem "disks" as you wish, and you 39 | | may even configure multiple disks of the same driver. Defaults have 40 | | been setup for each driver as an example of the required options. 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path().'/app', 49 | ], 50 | 51 | 's3' => [ 52 | 'driver' => 's3', 53 | 'key' => 'your-key', 54 | 'secret' => 'your-secret', 55 | 'region' => 'your-region', 56 | 'bucket' => 'your-bucket', 57 | ], 58 | 59 | 'rackspace' => [ 60 | 'driver' => 'rackspace', 61 | 'username' => 'your-username', 62 | 'key' => 'your-key', 63 | 'container' => 'your-container', 64 | 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', 65 | 'region' => 'IAD', 66 | ], 67 | 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Cache Stores 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may define all of the cache "stores" for your application as 24 | | well as their drivers. You may even define multiple stores for the 25 | | same cache driver to group types of items stored in your caches. 26 | | 27 | */ 28 | 29 | 'stores' => [ 30 | 31 | 'apc' => [ 32 | 'driver' => 'apc' 33 | ], 34 | 35 | 'array' => [ 36 | 'driver' => 'array' 37 | ], 38 | 39 | 'database' => [ 40 | 'driver' => 'database', 41 | 'table' => 'cache', 42 | 'connection' => null, 43 | ], 44 | 45 | 'file' => [ 46 | 'driver' => 'file', 47 | 'path' => storage_path().'/framework/cache', 48 | ], 49 | 50 | 'memcached' => [ 51 | 'driver' => 'memcached', 52 | 'servers' => [ 53 | [ 54 | 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100 55 | ], 56 | ], 57 | ], 58 | 59 | 'redis' => [ 60 | 'driver' => 'redis', 61 | 'connection' => 'default', 62 | ], 63 | 64 | ], 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Cache Key Prefix 69 | |-------------------------------------------------------------------------- 70 | | 71 | | When utilizing a RAM based store such as APC or Memcached, there might 72 | | be other applications utilizing the same cache. So, we'll specify a 73 | | value to get prefixed to all our keys so we can avoid collisions. 74 | | 75 | */ 76 | 77 | 'prefix' => 'laravel', 78 | 79 | ]; 80 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: @line-height-computed; 29 | margin-bottom: @line-height-computed; 30 | background-color: @progress-bg; 31 | border-radius: @progress-border-radius; 32 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: @font-size-small; 41 | line-height: @line-height-computed; 42 | color: @progress-bar-color; 43 | text-align: center; 44 | background-color: @progress-bar-bg; 45 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | .transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | #gradient > .striped(); 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | .animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | .progress-bar-variant(@progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | .progress-bar-variant(@progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | .progress-bar-variant(@progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | .progress-bar-variant(@progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'App\User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reset Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the options for resetting passwords including the view 52 | | that is your password reset e-mail. You can also set the name of the 53 | | table that maintains all of the reset tokens for your application. 54 | | 55 | | The expire time is the number of minutes that the reset token should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'password' => [ 62 | 'email' => 'emails.password', 63 | 'table' => 'password_resets', 64 | 'expire' => 60, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | color: @pagination-hover-color; 44 | background-color: @pagination-hover-bg; 45 | border-color: @pagination-hover-border; 46 | } 47 | } 48 | 49 | > .active > a, 50 | > .active > span { 51 | &, 52 | &:hover, 53 | &:focus { 54 | z-index: 2; 55 | color: @pagination-active-color; 56 | background-color: @pagination-active-bg; 57 | border-color: @pagination-active-border; 58 | cursor: default; 59 | } 60 | } 61 | 62 | > .disabled { 63 | > span, 64 | > span:hover, 65 | > span:focus, 66 | > a, 67 | > a:hover, 68 | > a:focus { 69 | color: @pagination-disabled-color; 70 | background-color: @pagination-disabled-bg; 71 | border-color: @pagination-disabled-border; 72 | cursor: @cursor-disabled; 73 | } 74 | } 75 | } 76 | 77 | // Sizing 78 | // -------------------------------------------------- 79 | 80 | // Large 81 | .pagination-lg { 82 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large); 83 | } 84 | 85 | // Small 86 | .pagination-sm { 87 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small); 88 | } 89 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Queue Connections 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may configure the connection information for each server that 27 | | is used by your application. A default configuration has been added 28 | | for each back-end shipped with Laravel. You are free to add more. 29 | | 30 | */ 31 | 32 | 'connections' => [ 33 | 34 | 'sync' => [ 35 | 'driver' => 'sync', 36 | ], 37 | 38 | 'database' => [ 39 | 'driver' => 'database', 40 | 'table' => 'jobs', 41 | 'queue' => 'default', 42 | 'expire' => 60, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'ttr' => 60, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => 'your-public-key', 55 | 'secret' => 'your-secret-key', 56 | 'queue' => 'your-queue-url', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'iron' => [ 61 | 'driver' => 'iron', 62 | 'host' => 'mq-aws-us-east-1.iron.io', 63 | 'token' => 'your-token', 64 | 'project' => 'your-project-id', 65 | 'queue' => 'your-queue-name', 66 | 'encrypt' => true, 67 | ], 68 | 69 | 'redis' => [ 70 | 'driver' => 'redis', 71 | 'queue' => 'default', 72 | 'expire' => 60, 73 | ], 74 | 75 | ], 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Failed Queue Jobs 80 | |-------------------------------------------------------------------------- 81 | | 82 | | These options configure the behavior of failed queue job logging so you 83 | | can control which database and table are used to store the jobs that 84 | | have failed. You may change them to any database / table you wish. 85 | | 86 | */ 87 | 88 | 'failed' => [ 89 | 'database' => 'mysql', 'table' => 'failed_jobs', 90 | ], 91 | 92 | ]; 93 | -------------------------------------------------------------------------------- /config/trustedproxy.php: -------------------------------------------------------------------------------- 1 | getClientIp() 23 | * always gets the originating client IP, no matter 24 | * how many proxies that client's request has 25 | * subsequently passed through. 26 | */ 27 | 'proxies' => '**', 28 | 29 | /* 30 | * Or, to trust all proxies that connect 31 | * directly to your server, uncomment this: 32 | */ 33 | # 'proxies' => '*', 34 | 35 | /* 36 | * Or, to trust ALL proxies, including those that 37 | * are in a chain of forwarding, uncomment this: 38 | */ 39 | # 'proxies' => '**', 40 | 41 | /* 42 | * Default Header Names 43 | * 44 | * Change these if the proxy does 45 | * not send the default header names. 46 | * 47 | * Note that headers such as X-Forwarded-For 48 | * are transformed to HTTP_X_FORWARDED_FOR format. 49 | * 50 | * The following are Symfony defaults, found in 51 | * \Symfony\Component\HttpFoundation\Request::$trustedHeaders 52 | * 53 | * You may optionally set headers to 'null' here if you'd like 54 | * for them to be considered untrusted instead. Ex: 55 | * 56 | * Illuminate\Http\Request::HEADER_CLIENT_HOST => null, 57 | * 58 | * WARNING: If you're using AWS Elastic Load Balancing or Heroku, 59 | * the FORWARDED and X_FORWARDED_HOST headers should be set to null 60 | * as they are currently unsupported there. 61 | */ 62 | 'headers' => [ 63 | (defined('Illuminate\Http\Request::HEADER_FORWARDED') ? Illuminate\Http\Request::HEADER_FORWARDED : 'forwarded') => 'FORWARDED', 64 | Illuminate\Http\Request::HEADER_CLIENT_IP => 'X_FORWARDED_FOR', 65 | Illuminate\Http\Request::HEADER_CLIENT_HOST => 'X_FORWARDED_HOST', 66 | Illuminate\Http\Request::HEADER_CLIENT_PROTO => 'X_FORWARDED_PROTO', 67 | Illuminate\Http\Request::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT', 68 | ] 69 | ]; 70 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/print.less: -------------------------------------------------------------------------------- 1 | /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ 2 | 3 | // ========================================================================== 4 | // Print styles. 5 | // Inlined to avoid the additional HTTP request: h5bp.com/r 6 | // ========================================================================== 7 | 8 | @media print { 9 | *, 10 | *:before, 11 | *:after { 12 | background: transparent !important; 13 | color: #000 !important; // Black prints faster: h5bp.com/s 14 | box-shadow: none !important; 15 | text-shadow: none !important; 16 | } 17 | 18 | a, 19 | a:visited { 20 | text-decoration: underline; 21 | } 22 | 23 | a[href]:after { 24 | content: " (" attr(href) ")"; 25 | } 26 | 27 | abbr[title]:after { 28 | content: " (" attr(title) ")"; 29 | } 30 | 31 | // Don't show links that are fragment identifiers, 32 | // or use the `javascript:` pseudo protocol 33 | a[href^="#"]:after, 34 | a[href^="javascript:"]:after { 35 | content: ""; 36 | } 37 | 38 | pre, 39 | blockquote { 40 | border: 1px solid #999; 41 | page-break-inside: avoid; 42 | } 43 | 44 | thead { 45 | display: table-header-group; // h5bp.com/t 46 | } 47 | 48 | tr, 49 | img { 50 | page-break-inside: avoid; 51 | } 52 | 53 | img { 54 | max-width: 100% !important; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Bootstrap specific changes start 70 | // 71 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 72 | // Once fixed, we can just straight up remove this. 73 | select { 74 | background: #fff !important; 75 | } 76 | 77 | // Bootstrap components 78 | .navbar { 79 | display: none; 80 | } 81 | .btn, 82 | .dropup > .btn { 83 | > .caret { 84 | border-top-color: #000 !important; 85 | } 86 | } 87 | .label { 88 | border: 1px solid #000; 89 | } 90 | 91 | .table { 92 | border-collapse: collapse !important; 93 | 94 | td, 95 | th { 96 | background-color: #fff !important; 97 | } 98 | } 99 | .table-bordered { 100 | th, 101 | td { 102 | border: 1px solid #ddd !important; 103 | } 104 | } 105 | 106 | // Bootstrap specific changes end 107 | } 108 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Register
9 |
10 | @if (count($errors) > 0) 11 |
12 | Whoops! There were some problems with your input.

13 |
    14 | @foreach ($errors->all() as $error) 15 |
  • {{ $error }}
  • 16 | @endforeach 17 |
18 |
19 | @endif 20 | 21 |
22 | 23 | 24 |
25 | 26 |
27 | 28 |
29 |
30 | 31 |
32 | 33 |
34 | 35 |
36 |
37 | 38 |
39 | 40 |
41 | 42 |
43 |
44 | 45 |
46 | 47 |
48 | 49 |
50 |
51 | 52 | 53 |
54 | 55 |
56 | 57 |
58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 |
66 | 67 |
68 |
69 | 72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | @endsection 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Two-Factor Authentication with Laravel and Authy 2 | 3 | In this example application, you will learn how to create a login system for Laravel applications secured with 2FA using Authy. 4 | 5 | [Learn more about this code in our interactive code walkthrough](https://www.twilio.com/docs/howto/walkthrough/two-factor-authentication/php/laravel). 6 | 7 | ## Run the Application 8 | 9 | 1. Clone the repository and `cd` into it. 10 | 1. Install the application dependencies with [Composer](https://getcomposer.org/) 11 | 12 | ```bash 13 | $ composer install 14 | ``` 15 | 1. The application uses PostgreSQL as persistence layer. If you 16 | don't have it already, you should install it. The easiest way is by 17 | using [Postgres.app](http://postgresapp.com/). 18 | 19 | 1. Create a database. 20 | 21 | ```bash 22 | $ createdb authy_laravel 23 | ``` 24 | 1. Copy the sample configuration file and edit it to match your configuration. 25 | 26 | ```bash 27 | $ cp .env.example .env 28 | ``` 29 | 30 | You can find your Authy Api Key for Production at https://www.twilio.com/console/authy/. 31 | 32 | 1. Generating an `APP_KEY`: 33 | 34 | ```bash 35 | $ php artisan key:generate 36 | ``` 37 | 1. Running the migrations: 38 | 39 | ```bash 40 | $ php artisan migrate 41 | ``` 42 | 43 | 1. Expose your application to the wider internet using ngrok. You can look 44 | [here](#expose-the-application-to-the-wider-internet) for more details. This step 45 | is important because the application won't work as expected if you run it through the 46 | localhost. 47 | 48 | ```bash 49 | $ ngrok http 8000 50 | ``` 51 | 52 | Once ngrok is running, open up your browser and go to your ngrok URL. 53 | It will look something like this: `http://9a159ccf.ngrok.io` 54 | 55 | 1. Running the application using Artisan. 56 | 57 | ```bash 58 | $ php artisan serve 59 | ``` 60 | 61 | 1. Go to https://www.twilio.com/console/authy/. On the menu to the right you'll find the 62 | **Settings**. Go to **OneTouch settings** and update the _Endpoint/URL_ with the 63 | endpoint you created. Something like this: 64 | 65 | `http://[your-ngrok-subdomain].ngrok.io/authy/callback` 66 | 67 | If you deployed this application to production, the the Endpoint/URL should look like this: 68 | 69 | `http://[your-domain].com/authy/callback` 70 | 71 | ## Run the tests 72 | 73 | 1. Download phpunit version 4 74 | 75 | ```bash 76 | $ wget https://phar.phpunit.de/phpunit-4.0.9.phar -O phpunit.phar 77 | ``` 78 | 79 | 1. Run phpunit 80 | 81 | ```bash 82 | $ php phpunit.phar 83 | ``` 84 | 85 | ## Meta 86 | 87 | * No warranty expressed or implied. Software is as is. Diggity. 88 | * [MIT License](http://www.opensource.org/licenses/mit-license.html) 89 | * Lovingly crafted by Twilio Developer Education. 90 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: @text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: @border-color; 23 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken(@border-color, 10%); 26 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); 27 | .box-shadow(@shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: @text-color; 33 | border-color: @border-color; 34 | background-color: @background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: @text-color; 39 | } 40 | } 41 | 42 | 43 | // Form control focus state 44 | // 45 | // Generate a customized focus state and for any input with the specified color, 46 | // which defaults to the `@input-border-focus` variable. 47 | // 48 | // We highly encourage you to not customize the default value, but instead use 49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 50 | // WebKit's default styles, but applicable to a wider range of browsers. Its 51 | // usability and accessibility should be taken into account with any change. 52 | // 53 | // Example usage: change the default blue border and shadow to white for better 54 | // contrast against a dark gray background. 55 | .form-control-focus(@color: @input-border-focus) { 56 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 57 | &:focus { 58 | border-color: @color; 59 | outline: 0; 60 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 61 | } 62 | } 63 | 64 | // Form control sizing 65 | // 66 | // Relative text size, padding, and border-radii changes for form controls. For 67 | // horizontal sizing, wrap controls in the predefined grid classes. ` 21 |
22 | 23 |
24 | 25 |
26 |
27 | Cancel 28 | 29 | 30 | 31 | 32 | 33 | 34 | @endsection 35 | 36 | @section('content') 37 |
38 |
39 |
40 |
41 |
Login
42 |
43 | @if (count($errors) > 0) 44 |
45 | Whoops! There were some problems with your input.

46 |
    47 | @foreach ($errors->all() as $error) 48 |
  • {{ $error }}
  • 49 | @endforeach 50 |
51 |
52 | @endif 53 | 54 |
55 | 56 | 57 |
58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 |
70 | 71 |
72 |
73 |
74 | 77 |
78 |
79 |
80 | 81 |
82 |
83 | 86 | 87 | Forgot Your Password? 88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | @endsection 97 | 98 | @section('js') 99 | 100 | @endsection 101 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/popovers.less: -------------------------------------------------------------------------------- 1 | // 2 | // Popovers 3 | // -------------------------------------------------- 4 | 5 | 6 | .popover { 7 | position: absolute; 8 | top: 0; 9 | left: 0; 10 | z-index: @zindex-popover; 11 | display: none; 12 | max-width: @popover-max-width; 13 | padding: 1px; 14 | // Reset font and text propertes given new insertion method 15 | font-family: @font-family-base; 16 | font-size: @font-size-base; 17 | font-weight: normal; 18 | line-height: @line-height-base; 19 | text-align: left; 20 | background-color: @popover-bg; 21 | background-clip: padding-box; 22 | border: 1px solid @popover-fallback-border-color; 23 | border: 1px solid @popover-border-color; 24 | border-radius: @border-radius-large; 25 | .box-shadow(0 5px 10px rgba(0,0,0,.2)); 26 | 27 | // Overrides for proper insertion 28 | white-space: normal; 29 | 30 | // Offset the popover to account for the popover arrow 31 | &.top { margin-top: -@popover-arrow-width; } 32 | &.right { margin-left: @popover-arrow-width; } 33 | &.bottom { margin-top: @popover-arrow-width; } 34 | &.left { margin-left: -@popover-arrow-width; } 35 | } 36 | 37 | .popover-title { 38 | margin: 0; // reset heading margin 39 | padding: 8px 14px; 40 | font-size: @font-size-base; 41 | background-color: @popover-title-bg; 42 | border-bottom: 1px solid darken(@popover-title-bg, 5%); 43 | border-radius: (@border-radius-large - 1) (@border-radius-large - 1) 0 0; 44 | } 45 | 46 | .popover-content { 47 | padding: 9px 14px; 48 | } 49 | 50 | // Arrows 51 | // 52 | // .arrow is outer, .arrow:after is inner 53 | 54 | .popover > .arrow { 55 | &, 56 | &:after { 57 | position: absolute; 58 | display: block; 59 | width: 0; 60 | height: 0; 61 | border-color: transparent; 62 | border-style: solid; 63 | } 64 | } 65 | .popover > .arrow { 66 | border-width: @popover-arrow-outer-width; 67 | } 68 | .popover > .arrow:after { 69 | border-width: @popover-arrow-width; 70 | content: ""; 71 | } 72 | 73 | .popover { 74 | &.top > .arrow { 75 | left: 50%; 76 | margin-left: -@popover-arrow-outer-width; 77 | border-bottom-width: 0; 78 | border-top-color: @popover-arrow-outer-fallback-color; // IE8 fallback 79 | border-top-color: @popover-arrow-outer-color; 80 | bottom: -@popover-arrow-outer-width; 81 | &:after { 82 | content: " "; 83 | bottom: 1px; 84 | margin-left: -@popover-arrow-width; 85 | border-bottom-width: 0; 86 | border-top-color: @popover-arrow-color; 87 | } 88 | } 89 | &.right > .arrow { 90 | top: 50%; 91 | left: -@popover-arrow-outer-width; 92 | margin-top: -@popover-arrow-outer-width; 93 | border-left-width: 0; 94 | border-right-color: @popover-arrow-outer-fallback-color; // IE8 fallback 95 | border-right-color: @popover-arrow-outer-color; 96 | &:after { 97 | content: " "; 98 | left: 1px; 99 | bottom: -@popover-arrow-width; 100 | border-left-width: 0; 101 | border-right-color: @popover-arrow-color; 102 | } 103 | } 104 | &.bottom > .arrow { 105 | left: 50%; 106 | margin-left: -@popover-arrow-outer-width; 107 | border-top-width: 0; 108 | border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback 109 | border-bottom-color: @popover-arrow-outer-color; 110 | top: -@popover-arrow-outer-width; 111 | &:after { 112 | content: " "; 113 | top: 1px; 114 | margin-left: -@popover-arrow-width; 115 | border-top-width: 0; 116 | border-bottom-color: @popover-arrow-color; 117 | } 118 | } 119 | 120 | &.left > .arrow { 121 | top: 50%; 122 | right: -@popover-arrow-outer-width; 123 | margin-top: -@popover-arrow-outer-width; 124 | border-right-width: 0; 125 | border-left-color: @popover-arrow-outer-fallback-color; // IE8 fallback 126 | border-left-color: @popover-arrow-outer-color; 127 | &:after { 128 | content: " "; 129 | right: 1px; 130 | border-right-width: 0; 131 | border-left-color: @popover-arrow-color; 132 | bottom: -@popover-arrow-width; 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/modals.less: -------------------------------------------------------------------------------- 1 | // 2 | // Modals 3 | // -------------------------------------------------- 4 | 5 | // .modal-open - body class for killing the scroll 6 | // .modal - container to scroll within 7 | // .modal-dialog - positioning shell for the actual modal 8 | // .modal-content - actual modal w/ bg and corners and shit 9 | 10 | // Kill the scroll on the body 11 | .modal-open { 12 | overflow: hidden; 13 | } 14 | 15 | // Container that the modal scrolls within 16 | .modal { 17 | display: none; 18 | overflow: hidden; 19 | position: fixed; 20 | top: 0; 21 | right: 0; 22 | bottom: 0; 23 | left: 0; 24 | z-index: @zindex-modal; 25 | -webkit-overflow-scrolling: touch; 26 | 27 | // Prevent Chrome on Windows from adding a focus outline. For details, see 28 | // https://github.com/twbs/bootstrap/pull/10951. 29 | outline: 0; 30 | 31 | // When fading in the modal, animate it to slide down 32 | &.fade .modal-dialog { 33 | .translate(0, -25%); 34 | .transition-transform(~"0.3s ease-out"); 35 | } 36 | &.in .modal-dialog { .translate(0, 0) } 37 | } 38 | .modal-open .modal { 39 | overflow-x: hidden; 40 | overflow-y: auto; 41 | } 42 | 43 | // Shell div to position the modal with bottom padding 44 | .modal-dialog { 45 | position: relative; 46 | width: auto; 47 | margin: 10px; 48 | } 49 | 50 | // Actual modal 51 | .modal-content { 52 | position: relative; 53 | background-color: @modal-content-bg; 54 | border: 1px solid @modal-content-fallback-border-color; //old browsers fallback (ie8 etc) 55 | border: 1px solid @modal-content-border-color; 56 | border-radius: @border-radius-large; 57 | .box-shadow(0 3px 9px rgba(0,0,0,.5)); 58 | background-clip: padding-box; 59 | // Remove focus outline from opened modal 60 | outline: 0; 61 | } 62 | 63 | // Modal background 64 | .modal-backdrop { 65 | position: absolute; 66 | top: 0; 67 | right: 0; 68 | left: 0; 69 | background-color: @modal-backdrop-bg; 70 | // Fade for backdrop 71 | &.fade { .opacity(0); } 72 | &.in { .opacity(@modal-backdrop-opacity); } 73 | } 74 | 75 | // Modal header 76 | // Top section of the modal w/ title and dismiss 77 | .modal-header { 78 | padding: @modal-title-padding; 79 | border-bottom: 1px solid @modal-header-border-color; 80 | min-height: (@modal-title-padding + @modal-title-line-height); 81 | } 82 | // Close icon 83 | .modal-header .close { 84 | margin-top: -2px; 85 | } 86 | 87 | // Title text within header 88 | .modal-title { 89 | margin: 0; 90 | line-height: @modal-title-line-height; 91 | } 92 | 93 | // Modal body 94 | // Where all modal content resides (sibling of .modal-header and .modal-footer) 95 | .modal-body { 96 | position: relative; 97 | padding: @modal-inner-padding; 98 | } 99 | 100 | // Footer (for actions) 101 | .modal-footer { 102 | padding: @modal-inner-padding; 103 | text-align: right; // right align buttons 104 | border-top: 1px solid @modal-footer-border-color; 105 | &:extend(.clearfix all); // clear it in case folks use .pull-* classes on buttons 106 | 107 | // Properly space out buttons 108 | .btn + .btn { 109 | margin-left: 5px; 110 | margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs 111 | } 112 | // but override that for button groups 113 | .btn-group .btn + .btn { 114 | margin-left: -1px; 115 | } 116 | // and override it for block buttons as well 117 | .btn-block + .btn-block { 118 | margin-left: 0; 119 | } 120 | } 121 | 122 | // Measure scrollbar width for padding body during modal show/hide 123 | .modal-scrollbar-measure { 124 | position: absolute; 125 | top: -9999px; 126 | width: 50px; 127 | height: 50px; 128 | overflow: scroll; 129 | } 130 | 131 | // Scale up the modal 132 | @media (min-width: @screen-sm-min) { 133 | // Automatically set modal's width for larger viewports 134 | .modal-dialog { 135 | width: @modal-md; 136 | margin: 30px auto; 137 | } 138 | .modal-content { 139 | .box-shadow(0 5px 15px rgba(0,0,0,.5)); 140 | } 141 | 142 | // Modal sizes 143 | .modal-sm { width: @modal-sm; } 144 | } 145 | 146 | @media (min-width: @screen-md-min) { 147 | .modal-lg { width: @modal-lg; } 148 | } 149 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/buttons.less: -------------------------------------------------------------------------------- 1 | // 2 | // Buttons 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // -------------------------------------------------- 8 | 9 | .btn { 10 | display: inline-block; 11 | margin-bottom: 0; // For input.btn 12 | font-weight: @btn-font-weight; 13 | text-align: center; 14 | vertical-align: middle; 15 | touch-action: manipulation; 16 | cursor: pointer; 17 | background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 18 | border: 1px solid transparent; 19 | white-space: nowrap; 20 | .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @border-radius-base); 21 | .user-select(none); 22 | 23 | &, 24 | &:active, 25 | &.active { 26 | &:focus, 27 | &.focus { 28 | .tab-focus(); 29 | } 30 | } 31 | 32 | &:hover, 33 | &:focus, 34 | &.focus { 35 | color: @btn-default-color; 36 | text-decoration: none; 37 | } 38 | 39 | &:active, 40 | &.active { 41 | outline: 0; 42 | background-image: none; 43 | .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); 44 | } 45 | 46 | &.disabled, 47 | &[disabled], 48 | fieldset[disabled] & { 49 | cursor: @cursor-disabled; 50 | pointer-events: none; // Future-proof disabling of clicks 51 | .opacity(.65); 52 | .box-shadow(none); 53 | } 54 | } 55 | 56 | 57 | // Alternate buttons 58 | // -------------------------------------------------- 59 | 60 | .btn-default { 61 | .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border); 62 | } 63 | .btn-primary { 64 | .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border); 65 | } 66 | // Success appears as green 67 | .btn-success { 68 | .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border); 69 | } 70 | // Info appears as blue-green 71 | .btn-info { 72 | .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border); 73 | } 74 | // Warning appears as orange 75 | .btn-warning { 76 | .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border); 77 | } 78 | // Danger and error appear as red 79 | .btn-danger { 80 | .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border); 81 | } 82 | 83 | 84 | // Link buttons 85 | // ------------------------- 86 | 87 | // Make a button look and behave like a link 88 | .btn-link { 89 | color: @link-color; 90 | font-weight: normal; 91 | border-radius: 0; 92 | 93 | &, 94 | &:active, 95 | &.active, 96 | &[disabled], 97 | fieldset[disabled] & { 98 | background-color: transparent; 99 | .box-shadow(none); 100 | } 101 | &, 102 | &:hover, 103 | &:focus, 104 | &:active { 105 | border-color: transparent; 106 | } 107 | &:hover, 108 | &:focus { 109 | color: @link-hover-color; 110 | text-decoration: underline; 111 | background-color: transparent; 112 | } 113 | &[disabled], 114 | fieldset[disabled] & { 115 | &:hover, 116 | &:focus { 117 | color: @btn-link-disabled-color; 118 | text-decoration: none; 119 | } 120 | } 121 | } 122 | 123 | 124 | // Button Sizes 125 | // -------------------------------------------------- 126 | 127 | .btn-lg { 128 | // line-height: ensure even-numbered height of button next to large input 129 | .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large); 130 | } 131 | .btn-sm { 132 | // line-height: ensure proper height of button next to small input 133 | .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small); 134 | } 135 | .btn-xs { 136 | .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @border-radius-small); 137 | } 138 | 139 | 140 | // Block button 141 | // -------------------------------------------------- 142 | 143 | .btn-block { 144 | display: block; 145 | width: 100%; 146 | } 147 | 148 | // Vertically space out multiple block buttons 149 | .btn-block + .btn-block { 150 | margin-top: 5px; 151 | } 152 | 153 | // Specificity overrides 154 | input[type="submit"], 155 | input[type="reset"], 156 | input[type="button"] { 157 | &.btn-block { 158 | width: 100%; 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/gradients.less: -------------------------------------------------------------------------------- 1 | // Gradients 2 | 3 | #gradient { 4 | 5 | // Horizontal gradient, from left to right 6 | // 7 | // Creates two color stops, start and end, by specifying a color and position for each color stop. 8 | // Color stops are not available in IE9 and below. 9 | .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) { 10 | background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+ 11 | background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12 12 | background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ 13 | background-repeat: repeat-x; 14 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down 15 | } 16 | 17 | // Vertical gradient, from top to bottom 18 | // 19 | // Creates two color stops, start and end, by specifying a color and position for each color stop. 20 | // Color stops are not available in IE9 and below. 21 | .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) { 22 | background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+ 23 | background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Opera 12 24 | background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ 25 | background-repeat: repeat-x; 26 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down 27 | } 28 | 29 | .directional(@start-color: #555; @end-color: #333; @deg: 45deg) { 30 | background-repeat: repeat-x; 31 | background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+ 32 | background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12 33 | background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ 34 | } 35 | .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) { 36 | background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color); 37 | background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color); 38 | background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color); 39 | background-repeat: no-repeat; 40 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback 41 | } 42 | .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) { 43 | background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color); 44 | background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color); 45 | background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color); 46 | background-repeat: no-repeat; 47 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback 48 | } 49 | .radial(@inner-color: #555; @outer-color: #333) { 50 | background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color); 51 | background-image: radial-gradient(circle, @inner-color, @outer-color); 52 | background-repeat: no-repeat; 53 | } 54 | .striped(@color: rgba(255,255,255,.15); @angle: 45deg) { 55 | background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent); 56 | background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent); 57 | background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | 'smtp', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Mailgun mail service which will provide reliable deliveries. 28 | | 29 | */ 30 | 31 | 'host' => 'smtp.mailgun.org', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to deliver e-mails to 39 | | users of the application. Like the host we have set this value to 40 | | stay compatible with the Mailgun e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => 587, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => ['address' => null, 'name' => null], 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => 'tls', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => null, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => null, 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Mail "Pretend" 114 | |-------------------------------------------------------------------------- 115 | | 116 | | When this option is enabled, e-mail will not actually be sent over the 117 | | web and will instead be written to your application's logs files so 118 | | you may inspect the message. This is great for local development. 119 | | 120 | */ 121 | 122 | 'pretend' => false, 123 | 124 | ]; 125 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthController.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 42 | $this->registrar = $registrar; 43 | $this->authy = $authy; 44 | 45 | $this->middleware('guest', ['except' => 'getLogout']); 46 | } 47 | 48 | public function postLogin(Request $request) 49 | { 50 | $credentials = $request->only('email', 'password'); 51 | if (Auth::validate($credentials)) { 52 | $user = User::where('email', '=', $request->input('email'))->firstOrFail(); 53 | 54 | Session::set('password_validated', true); 55 | Session::set('id', $user->id); 56 | 57 | if ($this->authy->verifyUserStatus($user->authy_id)->registered) { 58 | $uuid = $this->authy->sendOneTouch($user->authy_id, 'Request to Login to Twilio demo app'); 59 | 60 | OneTouch::create(['uuid' => $uuid]); 61 | 62 | Session::set('one_touch_uuid', $uuid); 63 | 64 | return response()->json(['status' => 'ok']); 65 | } else 66 | return response()->json(['status' => 'verify']); 67 | 68 | } else { 69 | return response()->json(['status' => 'failed', 70 | 'message' => 'The email and password combination you entered is incorrect.']); 71 | } 72 | } 73 | 74 | public function getTwoFactor() 75 | { 76 | $message = Session::get('message'); 77 | 78 | return view('auth/two-factor', ['message' => $message]); 79 | } 80 | 81 | public function postTwoFactor(Request $request) 82 | { 83 | if (!Session::get('password_validated') || !Session::get('id')) { 84 | return redirect('/auth/login'); 85 | } 86 | 87 | if (isset($_POST['token'])) { 88 | $user = User::find(Session::get('id')); 89 | if ($this->authy->verifyToken($user->authy_id, $request->input('token'))) { 90 | Auth::login($user); 91 | return redirect()->intended('/home'); 92 | } else { 93 | return redirect('/auth/two-factor')->withErrors([ 94 | 'token' => 'The token you entered is incorrect', 95 | ]); 96 | } 97 | } 98 | } 99 | 100 | public function postRegister(Request $request) 101 | { 102 | $validator = $this->registrar->validator($request->all()); 103 | if ($validator->fails()) { 104 | $this->throwValidationException( 105 | $request, $validator 106 | ); 107 | } 108 | $user = $this->registrar->create($request->all()); 109 | 110 | Session::set('password_validated', true); 111 | Session::set('id', $user->id); 112 | 113 | $authy_id = $this->authy->register($user->email, $user->phone_number, $user->country_code); 114 | 115 | $user->updateAuthyId($authy_id); 116 | 117 | if ($this->authy->verifyUserStatus($authy_id)->registered) 118 | $message = "Open Authy app in your phone to see the verification code"; 119 | else { 120 | $this->authy->sendToken($authy_id); 121 | $message = "You will receive an SMS with the verification code"; 122 | } 123 | 124 | return redirect('/auth/two-factor')->with('message', $message); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/input-groups.less: -------------------------------------------------------------------------------- 1 | // 2 | // Input groups 3 | // -------------------------------------------------- 4 | 5 | // Base styles 6 | // ------------------------- 7 | .input-group { 8 | position: relative; // For dropdowns 9 | display: table; 10 | border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table 11 | 12 | // Undo padding and float of grid classes 13 | &[class*="col-"] { 14 | float: none; 15 | padding-left: 0; 16 | padding-right: 0; 17 | } 18 | 19 | .form-control { 20 | // Ensure that the input is always above the *appended* addon button for 21 | // proper border colors. 22 | position: relative; 23 | z-index: 2; 24 | 25 | // IE9 fubars the placeholder attribute in text inputs and the arrows on 26 | // select elements in input groups. To fix it, we float the input. Details: 27 | // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855 28 | float: left; 29 | 30 | width: 100%; 31 | margin-bottom: 0; 32 | } 33 | } 34 | 35 | // Sizing options 36 | // 37 | // Remix the default form control sizing classes into new ones for easier 38 | // manipulation. 39 | 40 | .input-group-lg > .form-control, 41 | .input-group-lg > .input-group-addon, 42 | .input-group-lg > .input-group-btn > .btn { 43 | .input-lg(); 44 | } 45 | .input-group-sm > .form-control, 46 | .input-group-sm > .input-group-addon, 47 | .input-group-sm > .input-group-btn > .btn { 48 | .input-sm(); 49 | } 50 | 51 | 52 | // Display as table-cell 53 | // ------------------------- 54 | .input-group-addon, 55 | .input-group-btn, 56 | .input-group .form-control { 57 | display: table-cell; 58 | 59 | &:not(:first-child):not(:last-child) { 60 | border-radius: 0; 61 | } 62 | } 63 | // Addon and addon wrapper for buttons 64 | .input-group-addon, 65 | .input-group-btn { 66 | width: 1%; 67 | white-space: nowrap; 68 | vertical-align: middle; // Match the inputs 69 | } 70 | 71 | // Text input groups 72 | // ------------------------- 73 | .input-group-addon { 74 | padding: @padding-base-vertical @padding-base-horizontal; 75 | font-size: @font-size-base; 76 | font-weight: normal; 77 | line-height: 1; 78 | color: @input-color; 79 | text-align: center; 80 | background-color: @input-group-addon-bg; 81 | border: 1px solid @input-group-addon-border-color; 82 | border-radius: @border-radius-base; 83 | 84 | // Sizing 85 | &.input-sm { 86 | padding: @padding-small-vertical @padding-small-horizontal; 87 | font-size: @font-size-small; 88 | border-radius: @border-radius-small; 89 | } 90 | &.input-lg { 91 | padding: @padding-large-vertical @padding-large-horizontal; 92 | font-size: @font-size-large; 93 | border-radius: @border-radius-large; 94 | } 95 | 96 | // Nuke default margins from checkboxes and radios to vertically center within. 97 | input[type="radio"], 98 | input[type="checkbox"] { 99 | margin-top: 0; 100 | } 101 | } 102 | 103 | // Reset rounded corners 104 | .input-group .form-control:first-child, 105 | .input-group-addon:first-child, 106 | .input-group-btn:first-child > .btn, 107 | .input-group-btn:first-child > .btn-group > .btn, 108 | .input-group-btn:first-child > .dropdown-toggle, 109 | .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), 110 | .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { 111 | .border-right-radius(0); 112 | } 113 | .input-group-addon:first-child { 114 | border-right: 0; 115 | } 116 | .input-group .form-control:last-child, 117 | .input-group-addon:last-child, 118 | .input-group-btn:last-child > .btn, 119 | .input-group-btn:last-child > .btn-group > .btn, 120 | .input-group-btn:last-child > .dropdown-toggle, 121 | .input-group-btn:first-child > .btn:not(:first-child), 122 | .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { 123 | .border-left-radius(0); 124 | } 125 | .input-group-addon:last-child { 126 | border-left: 0; 127 | } 128 | 129 | // Button input groups 130 | // ------------------------- 131 | .input-group-btn { 132 | position: relative; 133 | // Jankily prevent input button groups from wrapping with `white-space` and 134 | // `font-size` in combination with `inline-block` on buttons. 135 | font-size: 0; 136 | white-space: nowrap; 137 | 138 | // Negative margin for spacing, position for bringing hovered/focused/actived 139 | // element above the siblings. 140 | > .btn { 141 | position: relative; 142 | + .btn { 143 | margin-left: -1px; 144 | } 145 | // Bring the "active" button to the front 146 | &:hover, 147 | &:focus, 148 | &:active { 149 | z-index: 2; 150 | } 151 | } 152 | 153 | // Negative margin to only have a 1px border between the two 154 | &:first-child { 155 | > .btn, 156 | > .btn-group { 157 | margin-right: -1px; 158 | } 159 | } 160 | &:last-child { 161 | > .btn, 162 | > .btn-group { 163 | margin-left: -1px; 164 | } 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Default Database Connection Name 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may specify which of the database connections below you wish 37 | | to use as your default connection for all database work. Of course 38 | | you may use many connections at once using the Database library. 39 | */ 40 | 41 | 'default' => env('DB_DEFAULT', 'pgsql'), 42 | 43 | /* 44 | |-------------------------------------------------------------------------- 45 | | Database Connections 46 | |-------------------------------------------------------------------------- 47 | | 48 | | Here are each of the database connections setup for your application. 49 | | Of course, examples of configuring each database platform that is 50 | | supported by Laravel is shown below to make development simple. 51 | | 52 | | 53 | | All database work in Laravel is done through the PHP PDO facilities 54 | | so make sure you have the driver for your particular database of 55 | | choice installed on your machine before you begin development. 56 | | 57 | */ 58 | 59 | 'connections' => [ 60 | 61 | 'sqlite' => [ 62 | 'driver' => 'sqlite', 63 | 'database' => storage_path() . '/database.sqlite', 64 | 'prefix' => '', 65 | ], 66 | 67 | 'sqlite_memory' => [ 68 | 'driver' => 'sqlite', 69 | 'database' => ':memory:', 70 | 'prefix' => '', 71 | ], 72 | 73 | 'mysql' => [ 74 | 'driver' => 'mysql', 75 | 'host' => env('DB_HOST', 'localhost'), 76 | 'database' => env('DB_DATABASE', 'aquarius'), 77 | 'username' => env('DB_USERNAME', 'root'), 78 | 'password' => env('DB_PASSWORD', 'root'), 79 | 'charset' => 'utf8', 80 | 'collation' => 'utf8_unicode_ci', 81 | 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock', 82 | 'prefix' => '', 83 | 'strict' => false, 84 | ], 85 | 86 | 'pgsql' => [ 87 | 'driver' => 'pgsql', 88 | 'host' => env('DB_HOST', $host), 89 | 'database' => env('DB_DATABASE', $database), 90 | 'username' => env('DB_USERNAME', $username), 91 | 'password' => env('DB_PASSWORD', $password), 92 | 'charset' => 'utf8', 93 | 'prefix' => '', 94 | 'schema' => 'public', 95 | ], 96 | 97 | 'sqlsrv' => [ 98 | 'driver' => 'sqlsrv', 99 | 'host' => env('DB_HOST', 'localhost'), 100 | 'database' => env('DB_DATABASE', 'forge'), 101 | 'username' => env('DB_USERNAME', 'forge'), 102 | 'password' => env('DB_PASSWORD', ''), 103 | 'prefix' => '', 104 | ], 105 | 106 | ], 107 | 108 | /* 109 | |-------------------------------------------------------------------------- 110 | | Migration Repository Table 111 | |-------------------------------------------------------------------------- 112 | | 113 | | This table keeps track of all the migrations that have already run for 114 | | your application. Using this information, we can determine which of 115 | | the migrations on disk haven't actually been run in the database. 116 | | 117 | */ 118 | 119 | 'migrations' => 'migrations', 120 | 121 | /* 122 | |-------------------------------------------------------------------------- 123 | | Redis Databases 124 | |-------------------------------------------------------------------------- 125 | | 126 | | Redis is an open source, fast, and advanced key-value store that also 127 | | provides a richer set of commands than a typical key-value systems 128 | | such as APC or Memcached. Laravel makes it easy to dig right in. 129 | | 130 | */ 131 | 132 | 'redis' => [ 133 | 134 | 'cluster' => false, 135 | 136 | 'default' => [ 137 | 'host' => '127.0.0.1', 138 | 'port' => 6379, 139 | 'database' => 0, 140 | ], 141 | 142 | ], 143 | 144 | ]; 145 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/responsive-utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Responsive: Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // IE10 in Windows (Phone) 8 7 | // 8 | // Support for responsive views via media queries is kind of borked in IE10, for 9 | // Surface/desktop in split view and for Windows Phone 8. This particular fix 10 | // must be accompanied by a snippet of JavaScript to sniff the user agent and 11 | // apply some conditional CSS to *only* the Surface/desktop Windows 8. Look at 12 | // our Getting Started page for more information on this bug. 13 | // 14 | // For more information, see the following: 15 | // 16 | // Issue: https://github.com/twbs/bootstrap/issues/10497 17 | // Docs: http://getbootstrap.com/getting-started/#support-ie10-width 18 | // Source: http://timkadlec.com/2013/01/windows-phone-8-and-device-width/ 19 | // Source: http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/ 20 | 21 | @-ms-viewport { 22 | width: device-width; 23 | } 24 | 25 | 26 | // Visibility utilities 27 | // Note: Deprecated .visible-xs, .visible-sm, .visible-md, and .visible-lg as of v3.2.0 28 | .visible-xs, 29 | .visible-sm, 30 | .visible-md, 31 | .visible-lg { 32 | .responsive-invisibility(); 33 | } 34 | 35 | .visible-xs-block, 36 | .visible-xs-inline, 37 | .visible-xs-inline-block, 38 | .visible-sm-block, 39 | .visible-sm-inline, 40 | .visible-sm-inline-block, 41 | .visible-md-block, 42 | .visible-md-inline, 43 | .visible-md-inline-block, 44 | .visible-lg-block, 45 | .visible-lg-inline, 46 | .visible-lg-inline-block { 47 | display: none !important; 48 | } 49 | 50 | .visible-xs { 51 | @media (max-width: @screen-xs-max) { 52 | .responsive-visibility(); 53 | } 54 | } 55 | .visible-xs-block { 56 | @media (max-width: @screen-xs-max) { 57 | display: block !important; 58 | } 59 | } 60 | .visible-xs-inline { 61 | @media (max-width: @screen-xs-max) { 62 | display: inline !important; 63 | } 64 | } 65 | .visible-xs-inline-block { 66 | @media (max-width: @screen-xs-max) { 67 | display: inline-block !important; 68 | } 69 | } 70 | 71 | .visible-sm { 72 | @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { 73 | .responsive-visibility(); 74 | } 75 | } 76 | .visible-sm-block { 77 | @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { 78 | display: block !important; 79 | } 80 | } 81 | .visible-sm-inline { 82 | @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { 83 | display: inline !important; 84 | } 85 | } 86 | .visible-sm-inline-block { 87 | @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { 88 | display: inline-block !important; 89 | } 90 | } 91 | 92 | .visible-md { 93 | @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { 94 | .responsive-visibility(); 95 | } 96 | } 97 | .visible-md-block { 98 | @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { 99 | display: block !important; 100 | } 101 | } 102 | .visible-md-inline { 103 | @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { 104 | display: inline !important; 105 | } 106 | } 107 | .visible-md-inline-block { 108 | @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { 109 | display: inline-block !important; 110 | } 111 | } 112 | 113 | .visible-lg { 114 | @media (min-width: @screen-lg-min) { 115 | .responsive-visibility(); 116 | } 117 | } 118 | .visible-lg-block { 119 | @media (min-width: @screen-lg-min) { 120 | display: block !important; 121 | } 122 | } 123 | .visible-lg-inline { 124 | @media (min-width: @screen-lg-min) { 125 | display: inline !important; 126 | } 127 | } 128 | .visible-lg-inline-block { 129 | @media (min-width: @screen-lg-min) { 130 | display: inline-block !important; 131 | } 132 | } 133 | 134 | .hidden-xs { 135 | @media (max-width: @screen-xs-max) { 136 | .responsive-invisibility(); 137 | } 138 | } 139 | .hidden-sm { 140 | @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { 141 | .responsive-invisibility(); 142 | } 143 | } 144 | .hidden-md { 145 | @media (min-width: @screen-md-min) and (max-width: @screen-md-max) { 146 | .responsive-invisibility(); 147 | } 148 | } 149 | .hidden-lg { 150 | @media (min-width: @screen-lg-min) { 151 | .responsive-invisibility(); 152 | } 153 | } 154 | 155 | 156 | // Print utilities 157 | // 158 | // Media queries are placed on the inside to be mixin-friendly. 159 | 160 | // Note: Deprecated .visible-print as of v3.2.0 161 | .visible-print { 162 | .responsive-invisibility(); 163 | 164 | @media print { 165 | .responsive-visibility(); 166 | } 167 | } 168 | .visible-print-block { 169 | display: none !important; 170 | 171 | @media print { 172 | display: block !important; 173 | } 174 | } 175 | .visible-print-inline { 176 | display: none !important; 177 | 178 | @media print { 179 | display: inline !important; 180 | } 181 | } 182 | .visible-print-inline-block { 183 | display: none !important; 184 | 185 | @media print { 186 | display: inline-block !important; 187 | } 188 | } 189 | 190 | .hidden-print { 191 | @media print { 192 | .responsive-invisibility(); 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | "The :attribute must be accepted.", 17 | "active_url" => "The :attribute is not a valid URL.", 18 | "after" => "The :attribute must be a date after :date.", 19 | "alpha" => "The :attribute may only contain letters.", 20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", 21 | "alpha_num" => "The :attribute may only contain letters and numbers.", 22 | "array" => "The :attribute must be an array.", 23 | "before" => "The :attribute must be a date before :date.", 24 | "between" => [ 25 | "numeric" => "The :attribute must be between :min and :max.", 26 | "file" => "The :attribute must be between :min and :max kilobytes.", 27 | "string" => "The :attribute must be between :min and :max characters.", 28 | "array" => "The :attribute must have between :min and :max items.", 29 | ], 30 | "boolean" => "The :attribute field must be true or false.", 31 | "confirmed" => "The :attribute confirmation does not match.", 32 | "date" => "The :attribute is not a valid date.", 33 | "date_format" => "The :attribute does not match the format :format.", 34 | "different" => "The :attribute and :other must be different.", 35 | "digits" => "The :attribute must be :digits digits.", 36 | "digits_between" => "The :attribute must be between :min and :max digits.", 37 | "email" => "The :attribute must be a valid email address.", 38 | "filled" => "The :attribute field is required.", 39 | "exists" => "The selected :attribute is invalid.", 40 | "image" => "The :attribute must be an image.", 41 | "in" => "The selected :attribute is invalid.", 42 | "integer" => "The :attribute must be an integer.", 43 | "ip" => "The :attribute must be a valid IP address.", 44 | "max" => [ 45 | "numeric" => "The :attribute may not be greater than :max.", 46 | "file" => "The :attribute may not be greater than :max kilobytes.", 47 | "string" => "The :attribute may not be greater than :max characters.", 48 | "array" => "The :attribute may not have more than :max items.", 49 | ], 50 | "mimes" => "The :attribute must be a file of type: :values.", 51 | "min" => [ 52 | "numeric" => "The :attribute must be at least :min.", 53 | "file" => "The :attribute must be at least :min kilobytes.", 54 | "string" => "The :attribute must be at least :min characters.", 55 | "array" => "The :attribute must have at least :min items.", 56 | ], 57 | "not_in" => "The selected :attribute is invalid.", 58 | "numeric" => "The :attribute must be a number.", 59 | "regex" => "The :attribute format is invalid.", 60 | "required" => "The :attribute field is required.", 61 | "required_if" => "The :attribute field is required when :other is :value.", 62 | "required_with" => "The :attribute field is required when :values is present.", 63 | "required_with_all" => "The :attribute field is required when :values is present.", 64 | "required_without" => "The :attribute field is required when :values is not present.", 65 | "required_without_all" => "The :attribute field is required when none of :values are present.", 66 | "same" => "The :attribute and :other must match.", 67 | "size" => [ 68 | "numeric" => "The :attribute must be :size.", 69 | "file" => "The :attribute must be :size kilobytes.", 70 | "string" => "The :attribute must be :size characters.", 71 | "array" => "The :attribute must contain :size items.", 72 | ], 73 | "unique" => "The :attribute has already been taken.", 74 | "url" => "The :attribute format is invalid.", 75 | "timezone" => "The :attribute must be a valid zone.", 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Custom Validation Language Lines 80 | |-------------------------------------------------------------------------- 81 | | 82 | | Here you may specify custom validation messages for attributes using the 83 | | convention "attribute.rule" to name the lines. This makes it quick to 84 | | specify a specific custom language line for a given attribute rule. 85 | | 86 | */ 87 | 88 | 'custom' => [ 89 | 'attribute-name' => [ 90 | 'rule-name' => 'custom-message', 91 | ], 92 | ], 93 | 94 | /* 95 | |-------------------------------------------------------------------------- 96 | | Custom Validation Attributes 97 | |-------------------------------------------------------------------------- 98 | | 99 | | The following language lines are used to swap attribute place-holders 100 | | with something more reader friendly such as E-Mail Address instead 101 | | of "email". This simply helps us make messages a little cleaner. 102 | | 103 | */ 104 | 105 | 'attributes' => [], 106 | 107 | ]; 108 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path().'/framework/sessions', 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Sweeping Lottery 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Some session drivers must manually sweep their storage location to get 94 | | rid of old sessions from storage. Here are the chances that it will 95 | | happen on a given request. By default, the odds are 2 out of 100. 96 | | 97 | */ 98 | 99 | 'lottery' => [2, 100], 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Cookie Name 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Here you may change the name of the cookie used to identify a session 107 | | instance by ID. The name specified here will get used every time a 108 | | new session cookie is created by the framework for every driver. 109 | | 110 | */ 111 | 112 | 'cookie' => 'laravel_session', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Path 117 | |-------------------------------------------------------------------------- 118 | | 119 | | The session cookie path determines the path for which the cookie will 120 | | be regarded as available. Typically, this will be the root path of 121 | | your application but you are free to change this when necessary. 122 | | 123 | */ 124 | 125 | 'path' => '/', 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Session Cookie Domain 130 | |-------------------------------------------------------------------------- 131 | | 132 | | Here you may change the domain of the cookie used to identify a session 133 | | in your application. This will determine which domains the cookie is 134 | | available to in your application. A sensible default has been set. 135 | | 136 | */ 137 | 138 | 'domain' => null, 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | HTTPS Only Cookies 143 | |-------------------------------------------------------------------------- 144 | | 145 | | By setting this option to true, session cookies will only be sent back 146 | | to the server if the browser has a HTTPS connection. This will keep 147 | | the cookie from being sent to you if it can not be done securely. 148 | | 149 | */ 150 | 151 | 'secure' => false, 152 | 153 | ]; 154 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/tables.less: -------------------------------------------------------------------------------- 1 | // 2 | // Tables 3 | // -------------------------------------------------- 4 | 5 | 6 | table { 7 | background-color: @table-bg; 8 | } 9 | caption { 10 | padding-top: @table-cell-padding; 11 | padding-bottom: @table-cell-padding; 12 | color: @text-muted; 13 | text-align: left; 14 | } 15 | th { 16 | text-align: left; 17 | } 18 | 19 | 20 | // Baseline styles 21 | 22 | .table { 23 | width: 100%; 24 | max-width: 100%; 25 | margin-bottom: @line-height-computed; 26 | // Cells 27 | > thead, 28 | > tbody, 29 | > tfoot { 30 | > tr { 31 | > th, 32 | > td { 33 | padding: @table-cell-padding; 34 | line-height: @line-height-base; 35 | vertical-align: top; 36 | border-top: 1px solid @table-border-color; 37 | } 38 | } 39 | } 40 | // Bottom align for column headings 41 | > thead > tr > th { 42 | vertical-align: bottom; 43 | border-bottom: 2px solid @table-border-color; 44 | } 45 | // Remove top border from thead by default 46 | > caption + thead, 47 | > colgroup + thead, 48 | > thead:first-child { 49 | > tr:first-child { 50 | > th, 51 | > td { 52 | border-top: 0; 53 | } 54 | } 55 | } 56 | // Account for multiple tbody instances 57 | > tbody + tbody { 58 | border-top: 2px solid @table-border-color; 59 | } 60 | 61 | // Nesting 62 | .table { 63 | background-color: @body-bg; 64 | } 65 | } 66 | 67 | 68 | // Condensed table w/ half padding 69 | 70 | .table-condensed { 71 | > thead, 72 | > tbody, 73 | > tfoot { 74 | > tr { 75 | > th, 76 | > td { 77 | padding: @table-condensed-cell-padding; 78 | } 79 | } 80 | } 81 | } 82 | 83 | 84 | // Bordered version 85 | // 86 | // Add borders all around the table and between all the columns. 87 | 88 | .table-bordered { 89 | border: 1px solid @table-border-color; 90 | > thead, 91 | > tbody, 92 | > tfoot { 93 | > tr { 94 | > th, 95 | > td { 96 | border: 1px solid @table-border-color; 97 | } 98 | } 99 | } 100 | > thead > tr { 101 | > th, 102 | > td { 103 | border-bottom-width: 2px; 104 | } 105 | } 106 | } 107 | 108 | 109 | // Zebra-striping 110 | // 111 | // Default zebra-stripe styles (alternating gray and transparent backgrounds) 112 | 113 | .table-striped { 114 | > tbody > tr:nth-child(odd) { 115 | background-color: @table-bg-accent; 116 | } 117 | } 118 | 119 | 120 | // Hover effect 121 | // 122 | // Placed here since it has to come after the potential zebra striping 123 | 124 | .table-hover { 125 | > tbody > tr:hover { 126 | background-color: @table-bg-hover; 127 | } 128 | } 129 | 130 | 131 | // Table cell sizing 132 | // 133 | // Reset default table behavior 134 | 135 | table col[class*="col-"] { 136 | position: static; // Prevent border hiding in Firefox and IE9/10 (see https://github.com/twbs/bootstrap/issues/11623) 137 | float: none; 138 | display: table-column; 139 | } 140 | table { 141 | td, 142 | th { 143 | &[class*="col-"] { 144 | position: static; // Prevent border hiding in Firefox and IE9/10 (see https://github.com/twbs/bootstrap/issues/11623) 145 | float: none; 146 | display: table-cell; 147 | } 148 | } 149 | } 150 | 151 | 152 | // Table backgrounds 153 | // 154 | // Exact selectors below required to override `.table-striped` and prevent 155 | // inheritance to nested tables. 156 | 157 | // Generate the contextual variants 158 | .table-row-variant(active; @table-bg-active); 159 | .table-row-variant(success; @state-success-bg); 160 | .table-row-variant(info; @state-info-bg); 161 | .table-row-variant(warning; @state-warning-bg); 162 | .table-row-variant(danger; @state-danger-bg); 163 | 164 | 165 | // Responsive tables 166 | // 167 | // Wrap your tables in `.table-responsive` and we'll make them mobile friendly 168 | // by enabling horizontal scrolling. Only applies <768px. Everything above that 169 | // will display normally. 170 | 171 | .table-responsive { 172 | overflow-x: auto; 173 | min-height: 0.01%; // Workaround for IE9 bug (see https://github.com/twbs/bootstrap/issues/14837) 174 | 175 | @media screen and (max-width: @screen-xs-max) { 176 | width: 100%; 177 | margin-bottom: (@line-height-computed * 0.75); 178 | overflow-y: hidden; 179 | -ms-overflow-style: -ms-autohiding-scrollbar; 180 | border: 1px solid @table-border-color; 181 | 182 | // Tighten up spacing 183 | > .table { 184 | margin-bottom: 0; 185 | 186 | // Ensure the content doesn't wrap 187 | > thead, 188 | > tbody, 189 | > tfoot { 190 | > tr { 191 | > th, 192 | > td { 193 | white-space: nowrap; 194 | } 195 | } 196 | } 197 | } 198 | 199 | // Special overrides for the bordered tables 200 | > .table-bordered { 201 | border: 0; 202 | 203 | // Nuke the appropriate borders so that the parent can handle them 204 | > thead, 205 | > tbody, 206 | > tfoot { 207 | > tr { 208 | > th:first-child, 209 | > td:first-child { 210 | border-left: 0; 211 | } 212 | > th:last-child, 213 | > td:last-child { 214 | border-right: 0; 215 | } 216 | } 217 | } 218 | 219 | // Only nuke the last row's bottom-border in `tbody` and `tfoot` since 220 | // chances are there will be only one `tr` in a `thead` and that would 221 | // remove the border altogether. 222 | > tbody, 223 | > tfoot { 224 | > tr:last-child { 225 | > th, 226 | > td { 227 | border-bottom: 0; 228 | } 229 | } 230 | } 231 | 232 | } 233 | } 234 | } 235 | --------------------------------------------------------------------------------