.
9 |
10 | .list-group {
11 | // No need to set list-style: none; since .list-group-item is block level
12 | margin-bottom: 20px;
13 | padding-left: 0; // reset padding because ul and ol
14 | }
15 |
16 |
17 | // Individual list items
18 | //
19 | // Use on `li`s or `div`s within the `.list-group` parent.
20 |
21 | .list-group-item {
22 | position: relative;
23 | display: block;
24 | padding: 10px 15px;
25 | // Place the border on the list items and negative margin up for better styling
26 | margin-bottom: -1px;
27 | background-color: @list-group-bg;
28 | border: 1px solid @list-group-border;
29 |
30 | // Round the first and last items
31 | &:first-child {
32 | .border-top-radius(@list-group-border-radius);
33 | }
34 | &:last-child {
35 | margin-bottom: 0;
36 | .border-bottom-radius(@list-group-border-radius);
37 | }
38 | }
39 |
40 |
41 | // Linked list items
42 | //
43 | // Use anchor elements instead of `li`s or `div`s to create linked list items.
44 | // Includes an extra `.active` modifier class for showing selected items.
45 |
46 | a.list-group-item {
47 | color: @list-group-link-color;
48 |
49 | .list-group-item-heading {
50 | color: @list-group-link-heading-color;
51 | }
52 |
53 | // Hover state
54 | &:hover,
55 | &:focus {
56 | text-decoration: none;
57 | color: @list-group-link-hover-color;
58 | background-color: @list-group-hover-bg;
59 | }
60 | }
61 |
62 | .list-group-item {
63 | // Disabled state
64 | &.disabled,
65 | &.disabled:hover,
66 | &.disabled:focus {
67 | background-color: @list-group-disabled-bg;
68 | color: @list-group-disabled-color;
69 | cursor: @cursor-disabled;
70 |
71 | // Force color to inherit for custom content
72 | .list-group-item-heading {
73 | color: inherit;
74 | }
75 | .list-group-item-text {
76 | color: @list-group-disabled-text-color;
77 | }
78 | }
79 |
80 | // Active class on item itself, not parent
81 | &.active,
82 | &.active:hover,
83 | &.active:focus {
84 | z-index: 2; // Place active items above their siblings for proper border styling
85 | color: @list-group-active-color;
86 | background-color: @list-group-active-bg;
87 | border-color: @list-group-active-border;
88 |
89 | // Force color to inherit for custom content
90 | .list-group-item-heading,
91 | .list-group-item-heading > small,
92 | .list-group-item-heading > .small {
93 | color: inherit;
94 | }
95 | .list-group-item-text {
96 | color: @list-group-active-text-color;
97 | }
98 | }
99 | }
100 |
101 |
102 | // Contextual variants
103 | //
104 | // Add modifier classes to change text and background color on individual items.
105 | // Organizationally, this must come after the `:hover` states.
106 |
107 | .list-group-item-variant(success; @state-success-bg; @state-success-text);
108 | .list-group-item-variant(info; @state-info-bg; @state-info-text);
109 | .list-group-item-variant(warning; @state-warning-bg; @state-warning-text);
110 | .list-group-item-variant(danger; @state-danger-bg; @state-danger-text);
111 |
112 |
113 | // Custom content options
114 | //
115 | // Extra classes for creating well-formatted content within `.list-group-item`s.
116 |
117 | .list-group-item-heading {
118 | margin-top: 0;
119 | margin-bottom: 5px;
120 | }
121 | .list-group-item-text {
122 | margin-bottom: 0;
123 | line-height: 1.3;
124 | }
125 |
--------------------------------------------------------------------------------
/SETUP.markdown:
--------------------------------------------------------------------------------
1 |
2 | # Two Factor Auth (TFA or 2FA) in Laravel 5.0
3 |
4 | ## Setup
5 |
6 | my guess is that we're assuming you already have this done, documenting for my benefit
7 |
8 | ### MAMP or similar?
9 |
10 | ### [Install composer](https://getcomposer.org/download/)
11 | if you haven't already
12 |
13 | ```
14 | curl -sS https://getcomposer.org/installer | php
15 | ```
16 |
17 | Or maybe update composer:
18 | ```
19 | /usr/local/bin/composer self-update
20 | ```
21 |
22 | ### Install Laravel 5.0
23 |
24 | ```
25 | composer global require "laravel/installer=~1.1"
26 | ```
27 |
28 | ### Install homestead for VM?
29 | * punting on this for now
30 |
31 | ### Create a new project
32 |
33 | ```
34 | laravel new two-factor-auth
35 | ```
36 |
37 | Start MAMP for MySQL
38 | Update ```database.php``` with mysql settings
39 |
40 |
41 | ## Include Authy PHP developer kit
42 |
43 | (Following copy is from [PHP Client for Authy Github](https://github.com/authy/authy-php))
44 |
45 | Include it in your ```composer.json```
46 | ```json
47 | {
48 | "require": {
49 | "authy/php": "2.*"
50 | }
51 | }
52 | ```
53 |
54 | ## Users
55 |
56 | This is from Authy and Laravel post mentioned below in resources:
57 |
58 | ```
59 | php artisan make:migration create_users_table
60 | ```
61 |
62 | Make it look like this:
63 |
64 | ```php
65 | increments('id');
82 | $table->string('email');
83 | $table->string('username');
84 | $table->string('password');
85 | $table->string('authy')->nullable();
86 | $table->timestamps();
87 | });
88 | }
89 |
90 | /**
91 | * Reverse the migrations.
92 | *
93 | * @return void
94 | */
95 | public function down()
96 | {
97 | Schema::drop('users');
98 | }
99 |
100 | }
101 | ```
102 |
103 | To use this client you just need to use Authy_Api and initialize it with your API KEY
104 |
105 | ```
106 | $authy_api = new Authy\AuthyApi('#your_api_key');
107 | ```
108 |
109 | Creating users is very easy, you need to pass an email, a cellphone and optionally a country code:
110 |
111 | ```
112 | $user = $authy_api->registerUser('new_user@email.com', '405-342-5699', 1); //email, cellphone, country_code
113 | ```
114 |
115 | You can easily see if the user was created by calling ok(). If request went right, you need to store the authy id in your database. Use user->id() to get this id in your database.
116 |
117 | ```
118 | if($user->ok())
119 | // store user->id() in your user database
120 | else
121 | foreach($user->errors() as $field => $message) {
122 | printf("$field = $message");
123 | }
124 | ```
125 |
126 | it returns a dictionary explaining what went wrong with the request. Errors will be in plain English and can be passed back to the user.
127 |
128 | ## Resources
129 | * Laracasts - [What's new in 5.0?](https://laracasts.com/series/whats-new-in-laravel-5)
130 | * [Laravel 5 docs](http://laravel.com/docs/5.0)
131 | * [This dude's post](http://blog.enge.me/post/installing-two-factor-authentication-with-authy) on Authy and Laravel
132 | * [Authy's PHP developer kit](https://github.com/authy/authy-php)
133 |
134 | ## Targeted Search Phrases:
135 | Think we're just going hard after combinations of:
136 | * Laravel
137 | * Laravel 5.0
138 | * Two factor auth
139 | * 2FA
140 | * TFA
141 |
--------------------------------------------------------------------------------
/resources/assets/less/bootstrap/mixins/grid.less:
--------------------------------------------------------------------------------
1 | // Grid system
2 | //
3 | // Generate semantic grid columns with these mixins.
4 |
5 | // Centered container element
6 | .container-fixed(@gutter: @grid-gutter-width) {
7 | margin-right: auto;
8 | margin-left: auto;
9 | padding-left: (@gutter / 2);
10 | padding-right: (@gutter / 2);
11 | &:extend(.clearfix all);
12 | }
13 |
14 | // Creates a wrapper for a series of columns
15 | .make-row(@gutter: @grid-gutter-width) {
16 | margin-left: (@gutter / -2);
17 | margin-right: (@gutter / -2);
18 | &:extend(.clearfix all);
19 | }
20 |
21 | // Generate the extra small columns
22 | .make-xs-column(@columns; @gutter: @grid-gutter-width) {
23 | position: relative;
24 | float: left;
25 | width: percentage((@columns / @grid-columns));
26 | min-height: 1px;
27 | padding-left: (@gutter / 2);
28 | padding-right: (@gutter / 2);
29 | }
30 | .make-xs-column-offset(@columns) {
31 | margin-left: percentage((@columns / @grid-columns));
32 | }
33 | .make-xs-column-push(@columns) {
34 | left: percentage((@columns / @grid-columns));
35 | }
36 | .make-xs-column-pull(@columns) {
37 | right: percentage((@columns / @grid-columns));
38 | }
39 |
40 | // Generate the small columns
41 | .make-sm-column(@columns; @gutter: @grid-gutter-width) {
42 | position: relative;
43 | min-height: 1px;
44 | padding-left: (@gutter / 2);
45 | padding-right: (@gutter / 2);
46 |
47 | @media (min-width: @screen-sm-min) {
48 | float: left;
49 | width: percentage((@columns / @grid-columns));
50 | }
51 | }
52 | .make-sm-column-offset(@columns) {
53 | @media (min-width: @screen-sm-min) {
54 | margin-left: percentage((@columns / @grid-columns));
55 | }
56 | }
57 | .make-sm-column-push(@columns) {
58 | @media (min-width: @screen-sm-min) {
59 | left: percentage((@columns / @grid-columns));
60 | }
61 | }
62 | .make-sm-column-pull(@columns) {
63 | @media (min-width: @screen-sm-min) {
64 | right: percentage((@columns / @grid-columns));
65 | }
66 | }
67 |
68 | // Generate the medium columns
69 | .make-md-column(@columns; @gutter: @grid-gutter-width) {
70 | position: relative;
71 | min-height: 1px;
72 | padding-left: (@gutter / 2);
73 | padding-right: (@gutter / 2);
74 |
75 | @media (min-width: @screen-md-min) {
76 | float: left;
77 | width: percentage((@columns / @grid-columns));
78 | }
79 | }
80 | .make-md-column-offset(@columns) {
81 | @media (min-width: @screen-md-min) {
82 | margin-left: percentage((@columns / @grid-columns));
83 | }
84 | }
85 | .make-md-column-push(@columns) {
86 | @media (min-width: @screen-md-min) {
87 | left: percentage((@columns / @grid-columns));
88 | }
89 | }
90 | .make-md-column-pull(@columns) {
91 | @media (min-width: @screen-md-min) {
92 | right: percentage((@columns / @grid-columns));
93 | }
94 | }
95 |
96 | // Generate the large columns
97 | .make-lg-column(@columns; @gutter: @grid-gutter-width) {
98 | position: relative;
99 | min-height: 1px;
100 | padding-left: (@gutter / 2);
101 | padding-right: (@gutter / 2);
102 |
103 | @media (min-width: @screen-lg-min) {
104 | float: left;
105 | width: percentage((@columns / @grid-columns));
106 | }
107 | }
108 | .make-lg-column-offset(@columns) {
109 | @media (min-width: @screen-lg-min) {
110 | margin-left: percentage((@columns / @grid-columns));
111 | }
112 | }
113 | .make-lg-column-push(@columns) {
114 | @media (min-width: @screen-lg-min) {
115 | left: percentage((@columns / @grid-columns));
116 | }
117 | }
118 | .make-lg-column-pull(@columns) {
119 | @media (min-width: @screen-lg-min) {
120 | right: percentage((@columns / @grid-columns));
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/app/Services/Authy.php:
--------------------------------------------------------------------------------
1 | api = new \Authy\AuthyApi(config('app.authy_api_key'));
20 | }
21 |
22 | /**
23 | * @param $message
24 | * @param $errors
25 | * @param bool $throw
26 | * @throws \Exception
27 | */
28 | private static function failed($message, $errors, $throw = true)
29 | {
30 | foreach($errors as $field => $message) {
31 | Log::error("Authy Error: {$field} = {$message}\n");
32 | }
33 | if($throw) {
34 | throw new \Exception($message);
35 | }
36 | Log::error($message);
37 | }
38 |
39 | /**
40 | * @param $email
41 | * @param $phone_number
42 | * @param $country_code
43 | * @return int
44 | * @throws \Exception
45 | */
46 | function register($email, $phone_number, $country_code)
47 | {
48 | $user = $this->api->registerUser($email, $phone_number, $country_code);
49 |
50 | if ($user->ok()) {
51 | return $user->id();
52 | }
53 |
54 | self::failed("Could not register user in Authy", $user->errors());
55 | }
56 |
57 | /**
58 | * @param $authy_id
59 | * @param $message
60 | * @return string
61 | * @throws \Exception
62 | */
63 | public function sendOneTouch($authy_id, $message)
64 | {
65 | $response = $this->api->createApprovalRequest($authy_id, $message);
66 |
67 | if($response->ok()) {
68 | return $response->bodyvar('approval_request')->uuid;
69 | }
70 | self::failed("Could not request One Touch", $response->errors());
71 | }
72 |
73 | /**
74 | * @param $uuid
75 | * @return bool Verification status
76 | * @throws \Exception
77 | */
78 | public function verifyOneTouch($uuid)
79 | {
80 | $response = $this->api->getApprovalRequest($uuid);
81 |
82 | if($response->ok()) {
83 | return (bool) $response->bodyvar('status');
84 | }
85 | self::failed("OneTouch.php verification failed", $response->errors());
86 | }
87 |
88 | /**
89 | * @param $authy_id
90 | * @return bool
91 | * @throws \Exception
92 | */
93 | public function sendToken($authy_id)
94 | {
95 | $response = $this->api->requestSms($authy_id);
96 | if($response->ok()) {
97 | return (bool) $response->bodyvar('success');
98 | }
99 | self::failed("OneTouch.php verification failed", $response->errors());
100 | }
101 |
102 | /**
103 | * @param $authy_id
104 | * @param $token
105 | * @return bool
106 | * @throws \Exception Nothing will be thrown here
107 | */
108 | public function verifyToken($authy_id, $token)
109 | {
110 | $response = $this->api->verifyToken($authy_id, $token);
111 |
112 | if($response->ok()) {
113 | return $response->ok();
114 | }
115 | self::failed("Token verification failed", $response->errors(), false);
116 | }
117 |
118 | /**
119 | * @param $authy_id
120 | * @return \Authy\value status
121 | * @throws \Exception if request to api fails
122 | */
123 | public function verifyUserStatus($authy_id) {
124 | $response = $this->api->userStatus($authy_id);
125 | if($response->ok()) {
126 | return $response->bodyvar('status');
127 | }
128 | self::failed("Status verification failed!", $response->errors());
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/resources/views/auth/login.blade.php:
--------------------------------------------------------------------------------
1 | @extends('app')
2 | @section('modals')
3 |
4 |
5 |
6 |
9 |
10 |
11 | Waiting for OneTouch Approval, check your phone ...
12 |
13 |
14 |
15 |
16 | Authy OneTouch not available
17 |
18 |
Please enter your Token
19 |
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 |
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 |
--------------------------------------------------------------------------------