├── public
├── favicon.ico
├── robots.txt
├── mix-manifest.json
├── .htaccess
├── web.config
├── index.php
└── svg
│ ├── 404.svg
│ ├── 503.svg
│ ├── 403.svg
│ └── 500.svg
├── database
├── .gitignore
├── seeds
│ └── DatabaseSeeder.php
├── migrations
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ └── 2014_10_12_000000_create_users_table.php
└── factories
│ └── UserFactory.php
├── resources
├── assets
│ ├── js
│ │ ├── components.js
│ │ ├── app.js
│ │ ├── directives.js
│ │ └── bootstrap.js
│ └── sass
│ │ ├── editor.scss
│ │ ├── app.scss
│ │ ├── components
│ │ ├── _layout.scss
│ │ ├── _top-dialog.scss
│ │ └── _form.scss
│ │ ├── _components.scss
│ │ └── _settings.scss
├── views
│ ├── multi-checkbox
│ │ └── index.blade.php
│ ├── dependable-dropdown
│ │ └── index.blade.php
│ ├── main
│ │ └── index.blade.php
│ └── template
│ │ ├── partials
│ │ └── navigation.blade.php
│ │ └── app.blade.php
└── lang
│ └── en
│ ├── pagination.php
│ ├── auth.php
│ ├── passwords.php
│ └── validation.php
├── bootstrap
├── cache
│ └── .gitignore
└── app.php
├── storage
├── logs
│ └── .gitignore
├── app
│ ├── public
│ │ └── .gitignore
│ └── .gitignore
└── framework
│ ├── testing
│ └── .gitignore
│ ├── views
│ └── .gitignore
│ ├── cache
│ ├── data
│ │ └── .gitignore
│ └── .gitignore
│ ├── sessions
│ └── .gitignore
│ └── .gitignore
├── .gitattributes
├── .gitignore
├── webpack.mix.js
├── .editorconfig
├── app
├── Http
│ ├── Middleware
│ │ ├── EncryptCookies.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── TrimStrings.php
│ │ ├── TrustProxies.php
│ │ ├── Authenticate.php
│ │ ├── VerifyCsrfToken.php
│ │ └── RedirectIfAuthenticated.php
│ ├── Controllers
│ │ ├── Controller.php
│ │ ├── Auth
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── ResetPasswordController.php
│ │ │ ├── VerificationController.php
│ │ │ └── RegisterController.php
│ │ ├── MainController.php
│ │ ├── MultiCheckboxController.php
│ │ └── DependableDropdownController.php
│ ├── Requests
│ │ ├── StoreDropdownRequest.php
│ │ ├── StoreMainRequest.php
│ │ └── AttributesRequest.php
│ └── Kernel.php
├── Providers
│ ├── BroadcastServiceProvider.php
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── helpers.php
├── Category.php
├── User.php
├── Console
│ └── Kernel.php
├── Rules
│ └── Password.php
├── Exceptions
│ └── Handler.php
└── Components
│ └── Validation
│ ├── Validator.php
│ ├── ValidationServiceProvider.php
│ └── Factory.php
├── tests
├── CreatesApplication.php
├── Feature
│ ├── DropdownTest.php
│ └── MainTest.php
├── TestCase.php
└── Unit
│ └── HelperTest.php
├── routes
├── channels.php
├── api.php
├── console.php
└── web.php
├── server.php
├── .env.example
├── package.json
├── config
├── view.php
├── services.php
├── hashing.php
├── broadcasting.php
├── filesystems.php
├── queue.php
├── logging.php
├── cache.php
├── auth.php
├── database.php
├── mail.php
├── session.php
└── app.php
├── readme.md
├── phpunit.xml
├── composer.json
└── artisan
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/resources/assets/js/components.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/resources/assets/sass/editor.scss:
--------------------------------------------------------------------------------
1 | @import "app";
2 |
3 | body {
4 |
5 | padding: 1rem;
6 |
7 | }
--------------------------------------------------------------------------------
/resources/views/multi-checkbox/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('template.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 | @endsection
--------------------------------------------------------------------------------
/resources/views/dependable-dropdown/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('template.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 | @endsection
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/resources/assets/js/app.js:
--------------------------------------------------------------------------------
1 | require('./bootstrap');
2 | require('./directives');
3 | require('./components');
4 |
5 | (new Vue({ el: '#app'}));
6 |
--------------------------------------------------------------------------------
/resources/assets/sass/app.scss:
--------------------------------------------------------------------------------
1 | @import url("https://fonts.googleapis.com/css?family=Roboto+Condensed");
2 | @import "settings";
3 | @import "components";
--------------------------------------------------------------------------------
/storage/framework/.gitignore:
--------------------------------------------------------------------------------
1 | config.php
2 | routes.php
3 | schedule-*
4 | compiled.php
5 | services.json
6 | events.scanned.php
7 | routes.scanned.php
8 | down
9 |
--------------------------------------------------------------------------------
/resources/assets/js/directives.js:
--------------------------------------------------------------------------------
1 | Vue.directive('focus', {
2 | inserted: (element, binding) => {
3 | if (binding.value === true) {
4 | element.focus();
5 | }
6 | }
7 | });
--------------------------------------------------------------------------------
/public/mix-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "/js/app.js": "/js/app.js?id=fce5807d87a0830626d4",
3 | "/css/app.css": "/css/app.css?id=341c403a387018e8346c",
4 | "/css/editor.css": "/css/editor.css?id=57aab3aa640abdcf4d42"
5 | }
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | .env
7 | .phpunit.result.cache
8 | Homestead.json
9 | Homestead.yaml
10 | npm-debug.log
11 | yarn-error.log
12 | .idea/
13 | package-lock.json
14 |
--------------------------------------------------------------------------------
/resources/views/main/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('template.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 | @endsection
8 |
9 | @push('footer-scripts')
10 |
11 | @endpush
--------------------------------------------------------------------------------
/webpack.mix.js:
--------------------------------------------------------------------------------
1 | const mix = require('laravel-mix');
2 |
3 | mix
4 | .js('resources/assets/js/app.js', 'public/js')
5 | .sass('resources/assets/sass/app.scss', 'public/css')
6 | .sass('resources/assets/sass/editor.scss', 'public/css')
7 | .sourceMaps()
8 | .version();
9 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.yml]
15 | indent_size = 2
16 |
--------------------------------------------------------------------------------
/resources/assets/sass/components/_layout.scss:
--------------------------------------------------------------------------------
1 | .divider {
2 |
3 | height: 0;
4 | width: 100%;
5 | display: table;
6 | margin-bottom: $global-margin;
7 | padding-bottom: $global-padding;
8 | border-bottom: solid 1px $medium-gray;
9 |
10 | }
11 |
12 | #responsive-menu {
13 |
14 | margin-bottom: 2rem;
15 |
16 | }
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call(UsersTableSeeder::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
19 |
20 | return $app;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | postJson(route('dependable_dropdown.store'));
15 |
16 | $response->assertJson($this->validationError([
17 | 'brand' => ['required'],
18 | 'colour' => ['required'],
19 | 'size' => ['required'],
20 | ]));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
16 | });
17 |
--------------------------------------------------------------------------------
/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | get('/user', function (Request $request) {
17 | return $request->user();
18 | });
19 |
--------------------------------------------------------------------------------
/app/helpers.php:
--------------------------------------------------------------------------------
1 | hasMany(static::class, 'cat_parent_id', 'id');
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/resources/lang/en/pagination.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
18 | })->describe('Display an inspiring quote');
19 |
--------------------------------------------------------------------------------
/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | $message,
22 | 'errors' => $response
23 | ];
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/server.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | $uri = urldecode(
11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
12 | );
13 |
14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the
15 | // built-in PHP web server. This provides a convenient way to test a Laravel
16 | // application without having installed a "real" web server software here.
17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
18 | return false;
19 | }
20 |
21 | require_once __DIR__.'/public/index.php';
22 |
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/home');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Handle Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/app/User.php:
--------------------------------------------------------------------------------
1 | 'These credentials do not match our records.',
17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/app/Providers/AuthServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 |
9 | DB_CONNECTION=mysql
10 | DB_HOST=127.0.0.1
11 | DB_PORT=3306
12 | DB_DATABASE=homestead
13 | DB_USERNAME=homestead
14 | DB_PASSWORD=secret
15 |
16 | BROADCAST_DRIVER=log
17 | CACHE_DRIVER=file
18 | QUEUE_CONNECTION=sync
19 | SESSION_DRIVER=file
20 | SESSION_LIFETIME=120
21 |
22 | REDIS_HOST=127.0.0.1
23 | REDIS_PASSWORD=null
24 | REDIS_PORT=6379
25 |
26 | MAIL_DRIVER=smtp
27 | MAIL_HOST=smtp.mailtrap.io
28 | MAIL_PORT=2525
29 | MAIL_USERNAME=null
30 | MAIL_PASSWORD=null
31 | MAIL_ENCRYPTION=null
32 |
33 | PUSHER_APP_ID=
34 | PUSHER_APP_KEY=
35 | PUSHER_APP_SECRET=
36 | PUSHER_APP_CLUSTER=mt1
37 |
38 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
39 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
40 |
--------------------------------------------------------------------------------
/tests/Unit/HelperTest.php:
--------------------------------------------------------------------------------
1 | assertTrue(is_empty(''));
15 | $this->assertTrue(is_empty(false));
16 | $this->assertTrue(is_empty(null));
17 | }
18 |
19 | /**
20 | * @test
21 | */
22 | public function identifies_non_empty_value()
23 | {
24 | $this->assertFalse(is_not_empty(''));
25 | $this->assertFalse(is_not_empty(false));
26 | $this->assertFalse(is_not_empty(null));
27 |
28 | $this->assertTrue(is_not_empty(0));
29 | $this->assertTrue(is_not_empty('1'));
30 | $this->assertTrue(is_not_empty(' '));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/routes/web.php:
--------------------------------------------------------------------------------
1 | name('main');
4 |
5 | Route::post('/', 'MainController@store')->name('main.store');
6 |
7 |
8 | Route::get('/multi-checkbox', 'MultiCheckboxController@index')->name('multi_checkbox');
9 |
10 | Route::post('/multi-checkbox/destroy', 'MultiCheckboxController@destroy')->name('multi_checkbox.destroy');
11 |
12 | Route::any('/multi-checkbox/export', 'MultiCheckboxController@export')->name('multi_checkbox.export');
13 |
14 |
15 | Route::get('/dependable-dropdown', 'DependableDropdownController@index')->name('dependable_dropdown');
16 |
17 | Route::post('/dependable-dropdown/attributes', 'DependableDropdownController@attributes')->name('dependable_dropdown.attributes');
18 |
19 | Route::post('/dependable-dropdown/store', 'DependableDropdownController@store')->name('dependable_dropdown.store');
20 |
--------------------------------------------------------------------------------
/resources/views/template/partials/navigation.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Providers/EventServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | parent::boot();
31 |
32 | //
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/resources/lang/en/passwords.php:
--------------------------------------------------------------------------------
1 | 'Passwords must be at least six characters and match the confirmation.',
17 | 'reset' => 'Your password has been reset!',
18 | 'sent' => 'We have e-mailed your password reset link!',
19 | 'token' => 'This password reset token is invalid.',
20 | 'user' => "We can't find a user with that e-mail address.",
21 |
22 | ];
23 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | define(App\User::class, function (Faker $faker) {
17 | return [
18 | 'name' => $faker->name,
19 | 'email' => $faker->unique()->safeEmail,
20 | 'email_verified_at' => now(),
21 | 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
22 | 'remember_token' => str_random(10),
23 | ];
24 | });
25 |
--------------------------------------------------------------------------------
/resources/views/template/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{ config('app.name') }}
8 |
9 |
10 |
11 |
12 |
13 |
14 | @include('template.partials.navigation')
15 |
16 | @yield('content')
17 |
18 |
19 | @stack('footer-scripts')
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/public/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name');
19 | $table->string('email')->unique();
20 | $table->timestamp('email_verified_at')->nullable();
21 | $table->string('password');
22 | $table->rememberToken();
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('users');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Http/Controllers/MainController.php:
--------------------------------------------------------------------------------
1 | runningUnitTests()) {
31 | sleep(3);
32 | }
33 |
34 | return new JsonResponse([
35 | 'behaviour' => 'confirmWithDialogAndReset',
36 | 'message' => 'Your request has been processed successfully.'
37 | ]);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
28 | // ->hourly();
29 | }
30 |
31 | /**
32 | * Register the commands for the application.
33 | *
34 | * @return void
35 | */
36 | protected function commands()
37 | {
38 | $this->load(__DIR__.'/Commands');
39 |
40 | require base_path('routes/console.php');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Http/Requests/StoreDropdownRequest.php:
--------------------------------------------------------------------------------
1 | 'required',
39 | 'colour' => 'required',
40 | 'size' => 'required',
41 | ];
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/Rules/Password.php:
--------------------------------------------------------------------------------
1 | middleware('guest')->except('logout');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ResetPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "watch": "npm run development -- --watch",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "devDependencies": {
13 | "axios": "^0.21.1",
14 | "cross-env": "^7.0.2",
15 | "foundation-sites": "^6.6.1",
16 | "laravel-mix": "^5.0.1",
17 | "resolve-url-loader": "^3.1.1",
18 | "sass": "^1.26.3",
19 | "sass-loader": "^8.0.2",
20 | "vue": "^2.6.11",
21 | "vue-template-compiler": "^2.6.11"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('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' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # Advanced Form Component with VueJs
2 |
3 | Exercise files for the course ***Advanced Form Component with VueJs***
4 |
5 | ### Email regex
6 |
7 | ```php
8 | /^[a-zA-Z0-9._\-]+@[a-zA-Z0-9]+([.\-]?[a-zA-Z0-9]+)?([\.]{1}[a-zA-Z]{2,4}){1,4}$/
9 | ```
10 |
11 | ### Password regex
12 |
13 | ```php
14 | /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@#$!%*?&])[A-Za-z\d@#$!%*?&]{6,30}$/
15 | ```
16 |
17 | ### CKEditor toolbar
18 |
19 | ```javascript
20 | full: [
21 | { name: 'document', items : [ 'Source', '-', 'Maximize'] },
22 | { name: 'editing', items : [ 'Replace', '-', 'SelectAll', 'ShowBlocks' ] },
23 | { name: 'clipboard', items : [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
24 | { name: 'links', items : [ 'Link', 'Unlink' ] },
25 | { name: 'insert', items : [ 'Image', 'Table', 'pbckcode', 'Templates', 'qrc', 'SpecialChar' ] },
26 | { name: 'basicstyles', items : [ 'Bold', 'Italic', 'Underline', 'Strike', '-', 'RemoveFormat' ] },
27 | { name: 'paragraph', items : [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] },
28 | { name: 'stylesmenus', items : [ 'Subscript', 'Styles', 'Format', 'CmdTokens' ] }
29 | ]
30 | ```
31 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/VerificationController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
38 | $this->middleware('signed')->only('verify');
39 | $this->middleware('throttle:6,1')->only('verify', 'resend');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | ./tests/Unit
14 |
15 |
16 |
17 | ./tests/Feature
18 |
19 |
20 |
21 |
22 | ./app
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'ses' => [
24 | 'key' => env('SES_KEY'),
25 | 'secret' => env('SES_SECRET'),
26 | 'region' => env('SES_REGION', 'us-east-1'),
27 | ],
28 |
29 | 'sparkpost' => [
30 | 'secret' => env('SPARKPOST_SECRET'),
31 | ],
32 |
33 | 'stripe' => [
34 | 'model' => App\User::class,
35 | 'key' => env('STRIPE_KEY'),
36 | 'secret' => env('STRIPE_SECRET'),
37 | 'webhook' => [
38 | 'secret' => env('STRIPE_WEBHOOK_SECRET'),
39 | 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
40 | ],
41 | ],
42 |
43 | ];
44 |
--------------------------------------------------------------------------------
/app/Http/Controllers/MultiCheckboxController.php:
--------------------------------------------------------------------------------
1 | with('sessionDialog', session('sessionDialog'));
20 | }
21 |
22 | /**
23 | * Remove records.
24 | *
25 | * @param \Illuminate\Http\Request $request
26 | * @return \Illuminate\Http\JsonResponse
27 | */
28 | public function destroy(Request $request): JsonResponse
29 | {
30 | if (!app()->runningUnitTests()) {
31 | sleep(3);
32 | }
33 |
34 | $message = 'The following records have been removed successfully: "';
35 | $message .= implode(', ', $request->input('items'));
36 | $message .= '"';
37 |
38 | session()->flash('sessionDialog', json_encode([
39 | 'type' => 'top-alert',
40 | 'message' => $message,
41 | ]));
42 |
43 | return new JsonResponse;
44 | }
45 |
46 | /**
47 | * Export records.
48 | *
49 | * @param \Illuminate\Http\Request $request
50 | * @return array
51 | */
52 | public function export(Request $request): array
53 | {
54 | // used different name for the index
55 | return $request->input('records');
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/Http/Requests/StoreMainRequest.php:
--------------------------------------------------------------------------------
1 | ['required', 'in:1,2,3,4,5'],
30 | 'first_name' => ['present', 'min:2', 'max:30'],
31 | 'last_name' => ['required', 'min:2', 'max:30'],
32 | 'email' => ['required', 'email'],
33 | 'password' => ['required', new Password],
34 | 'address' => 'array',
35 | 'address.line_1' => 'required',
36 | 'address.line_2' => 'present',
37 | 'address.town' => 'required',
38 | 'address.post_code' => ['required', 'max:10'],
39 | 'share' => ['required', 'in:a'],
40 | 'privacy' => 'required',
41 | 'terms' => 'accepted',
42 | 'colours' => ['required', 'array', 'min:2', 'max:2'],
43 | 'city' => ['required', 'in:1,2,3,6'],
44 | 'fruit' => ['required', 'array'],
45 | 'excerpt' => ['required', 'min:3', 'max:10'],
46 | 'body' => 'required',
47 | ];
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/Components/Validation/Validator.php:
--------------------------------------------------------------------------------
1 | passes($attribute, $value)) {
21 |
22 | if (!request()->expectsJson()) {
23 | parent::validateUsingCustomRule($attribute, $value, $rule);
24 | return;
25 | }
26 |
27 | $this->failedRules[$attribute][$rule->rule()] = [];
28 |
29 | $this->messages->add($attribute, $rule->rule());
30 | }
31 | }
32 |
33 | /**
34 | * Add a failed rule and error message to the collection.
35 | *
36 | * @param string $attribute
37 | * @param string $rule
38 | * @param array $parameters
39 | * @return void
40 | */
41 | public function addFailure($attribute, $rule, $parameters = [])
42 | {
43 | if (!request()->expectsJson()) {
44 | parent::addFailure($attribute, $rule, $parameters);
45 | return;
46 | }
47 |
48 | $this->messages->add($attribute, Str::snake($rule));
49 |
50 | $this->failedRules[$attribute][$rule] = $parameters;
51 | }
52 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/DependableDropdownController.php:
--------------------------------------------------------------------------------
1 | with('sizes', AttributesRequest::sizes());
22 | }
23 |
24 | /**
25 | * Get list of names.
26 | *
27 | * @param \App\Http\Requests\AttributesRequest $request
28 | * @return array
29 | */
30 | public function attributes(AttributesRequest $request): array
31 | {
32 | return [
33 | 'records' => $request->data(),
34 | 'summary' => [
35 | 'total' => $request->nonEmpty()->count() === 3 ? number_format($request->items['brand'], 2) : 0
36 | ]
37 | ];
38 | }
39 |
40 | /**
41 | * Store data.
42 | *
43 | * @param \App\Http\Requests\StoreDropdownRequest $request
44 | * @return \Illuminate\Http\JsonResponse
45 | */
46 | public function store(StoreDropdownRequest $request): JsonResponse
47 | {
48 | if (!app()->runningUnitTests()) {
49 | sleep(3);
50 | }
51 |
52 | return new JsonResponse([
53 | 'behaviour' => 'confirmWithDialogAndReset',
54 | 'message' => 'Your request has been processed successfully.'
55 | ]);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/resources/assets/sass/components/_top-dialog.scss:
--------------------------------------------------------------------------------
1 | #top-dialog {
2 |
3 | &,
4 | &::before,
5 | .dialog {
6 |
7 | transition: all 0.6s;
8 |
9 | }
10 |
11 | &.overlay {
12 |
13 | &::before {
14 |
15 | content: '';
16 | display: block;
17 | width: 100%;
18 | height: 100%;
19 | z-index: 9999;
20 |
21 | position: fixed;
22 | top: 0;
23 | left: 0;
24 |
25 | background-color: rgba(0, 0, 0, 0.8);
26 |
27 | }
28 |
29 | }
30 |
31 | .dialog {
32 |
33 | display: block;
34 | width: 100%;
35 | z-index: 999999;
36 |
37 | position: fixed;
38 | top: -100%;
39 | left: 0;
40 |
41 | padding: 1.8rem;
42 | text-align: center;
43 |
44 | nav {
45 |
46 | &, a, span {
47 |
48 | margin-bottom: 0;
49 |
50 | }
51 |
52 | }
53 |
54 | &.active {
55 |
56 | top: 0;
57 |
58 | }
59 |
60 | &.alert {
61 |
62 | background-color: $success-color;
63 |
64 | &, a:not(.button) {
65 |
66 | color: $white;
67 |
68 | }
69 |
70 | }
71 |
72 | &.warning {
73 |
74 | background-color: $alert-color;
75 |
76 | &, a:not(.button) {
77 |
78 | color: $white;
79 |
80 | }
81 |
82 | }
83 |
84 | &.confirm {
85 |
86 | background-color: $alert-color;
87 |
88 | &, a:not(.button) {
89 |
90 | color: $white;
91 |
92 | }
93 |
94 | }
95 |
96 | }
97 |
98 | @include breakpoint(medium) {
99 |
100 | z-index: 999999;
101 |
102 | position: fixed;
103 | top: 0;
104 | left: 0;
105 |
106 | }
107 |
108 | }
--------------------------------------------------------------------------------
/resources/assets/sass/components/_form.scss:
--------------------------------------------------------------------------------
1 | [v-cloak] {
2 |
3 | display: none;
4 |
5 | }
6 |
7 | label {
8 |
9 | .validation {
10 |
11 | color: $alert-color;
12 |
13 | span {
14 |
15 | &.block {
16 |
17 | display: block;
18 |
19 | }
20 |
21 | }
22 |
23 | }
24 |
25 | }
26 |
27 | form {
28 |
29 | input, select, textarea {
30 |
31 | transition: all 0.26s ease-out;
32 |
33 | }
34 |
35 | select[multiple] {
36 |
37 | height: 7rem;
38 |
39 | }
40 |
41 | .invalid {
42 |
43 | input[type="text"],
44 | input[type="email"],
45 | input[type="password"],
46 | input[type="number"],
47 | input[type="date"],
48 | input[type="datetime"],
49 | input[type="time"],
50 | select,
51 | textarea,
52 | .cke {
53 |
54 | border-color: $alert-color;
55 |
56 | }
57 |
58 | }
59 |
60 | .checkbox-group {
61 |
62 | list-style: none;
63 | padding: 0;
64 | margin: 0 0 $global-margin;
65 |
66 | .checkbox-group-item {
67 |
68 | position: relative;
69 |
70 | input[type="checkbox"],
71 | input[type="radio"] {
72 |
73 | position: absolute;
74 | top: 0.3rem;
75 | left: 0;
76 | margin: 0;
77 |
78 | }
79 |
80 | label {
81 |
82 | padding-left: 1rem;
83 |
84 | }
85 |
86 | }
87 |
88 | > div:not(.checkbox-group-item) {
89 |
90 | .checkbox-group-item {
91 |
92 | input[type="checkbox"],
93 | input[type="radio"] {
94 |
95 | top: 0.2rem;
96 |
97 | }
98 |
99 | }
100 |
101 | }
102 |
103 | }
104 |
105 | }
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 1024,
48 | 'threads' => 2,
49 | 'time' => 2,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
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 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'encrypted' => true,
41 | ],
42 | ],
43 |
44 | 'redis' => [
45 | 'driver' => 'redis',
46 | 'connection' => 'default',
47 | ],
48 |
49 | 'log' => [
50 | 'driver' => 'log',
51 | ],
52 |
53 | 'null' => [
54 | 'driver' => 'null',
55 | ],
56 |
57 | ],
58 |
59 | ];
60 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | mapApiRoutes();
39 |
40 | $this->mapWebRoutes();
41 |
42 | //
43 | }
44 |
45 | /**
46 | * Define the "web" routes for the application.
47 | *
48 | * These routes all receive session state, CSRF protection, etc.
49 | *
50 | * @return void
51 | */
52 | protected function mapWebRoutes()
53 | {
54 | Route::middleware('web')
55 | ->namespace($this->namespace)
56 | ->group(base_path('routes/web.php'));
57 | }
58 |
59 | /**
60 | * Define the "api" routes for the application.
61 | *
62 | * These routes are typically stateless.
63 | *
64 | * @return void
65 | */
66 | protected function mapApiRoutes()
67 | {
68 | Route::prefix('api')
69 | ->middleware('api')
70 | ->namespace($this->namespace)
71 | ->group(base_path('routes/api.php'));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The Laravel Framework.",
5 | "keywords": [
6 | "framework",
7 | "laravel"
8 | ],
9 | "license": "MIT",
10 | "require": {
11 | "php": "^7.1.3",
12 | "fideloper/proxy": "^4.0",
13 | "laravel/framework": "5.8.*",
14 | "laravel/tinker": "^1.0"
15 | },
16 | "require-dev": {
17 | "beyondcode/laravel-dump-server": "^1.0",
18 | "filp/whoops": "^2.0",
19 | "fzaninotto/faker": "^1.4",
20 | "mockery/mockery": "^1.0",
21 | "nunomaduro/collision": "^2.0",
22 | "phpunit/phpunit": "^7.0"
23 | },
24 | "config": {
25 | "optimize-autoloader": true,
26 | "preferred-install": "dist",
27 | "sort-packages": true
28 | },
29 | "extra": {
30 | "laravel": {
31 | "dont-discover": []
32 | }
33 | },
34 | "autoload": {
35 | "psr-4": {
36 | "App\\": "app/"
37 | },
38 | "classmap": [
39 | "database/seeds",
40 | "database/factories"
41 | ],
42 | "files": [
43 | "app/helpers.php"
44 | ]
45 | },
46 | "autoload-dev": {
47 | "psr-4": {
48 | "Tests\\": "tests/"
49 | }
50 | },
51 | "minimum-stability": "dev",
52 | "prefer-stable": true,
53 | "scripts": {
54 | "post-autoload-dump": [
55 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
56 | "@php artisan package:discover --ansi"
57 | ],
58 | "post-root-package-install": [
59 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
60 | ],
61 | "post-create-project-cmd": [
62 | "@php artisan key:generate --ansi"
63 | ]
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | define('LARAVEL_START', microtime(true));
11 |
12 | /*
13 | |--------------------------------------------------------------------------
14 | | Register The Auto Loader
15 | |--------------------------------------------------------------------------
16 | |
17 | | Composer provides a convenient, automatically generated class loader for
18 | | our application. We just need to utilize it! We'll simply require it
19 | | into the script here so that we don't have to worry about manual
20 | | loading any of our classes later on. It feels great to relax.
21 | |
22 | */
23 |
24 | require __DIR__.'/../vendor/autoload.php';
25 |
26 | /*
27 | |--------------------------------------------------------------------------
28 | | Turn On The Lights
29 | |--------------------------------------------------------------------------
30 | |
31 | | We need to illuminate PHP development, so let us turn on the lights.
32 | | This bootstraps the framework and gets it ready for use, then it
33 | | will load up this application so that we can run it and send
34 | | the responses back to the browser and delight our users.
35 | |
36 | */
37 |
38 | $app = require_once __DIR__.'/../bootstrap/app.php';
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Run The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once we have the application, we can handle the incoming request
46 | | through the kernel, and send the associated response back to
47 | | the client's browser allowing them to enjoy the creative
48 | | and wonderful application we have prepared for them.
49 | |
50 | */
51 |
52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
53 |
54 | $response = $kernel->handle(
55 | $request = Illuminate\Http\Request::capture()
56 | );
57 |
58 | $response->send();
59 |
60 | $kernel->terminate($request, $response);
61 |
--------------------------------------------------------------------------------
/app/Components/Validation/ValidationServiceProvider.php:
--------------------------------------------------------------------------------
1 | registerPresenceVerifier();
25 |
26 | $this->registerValidationFactory();
27 | }
28 |
29 | /**
30 | * Register the validation factory.
31 | *
32 | * @return void
33 | */
34 | protected function registerValidationFactory()
35 | {
36 | $this->app->singleton('validator', function ($app) {
37 | $validator = new Factory($app['translator'], $app);
38 |
39 | // The validation presence verifier is responsible for determining the existence of
40 | // values in a given data collection which is typically a relational database or
41 | // other persistent data stores. It is used to check for "uniqueness" as well.
42 | if (isset($app['db'], $app['validation.presence'])) {
43 | $validator->setPresenceVerifier($app['validation.presence']);
44 | }
45 |
46 | return $validator;
47 | });
48 | }
49 |
50 | /**
51 | * Register the database presence verifier.
52 | *
53 | * @return void
54 | */
55 | protected function registerPresenceVerifier()
56 | {
57 | $this->app->singleton('validation.presence', function ($app) {
58 | return new DatabasePresenceVerifier($app['db']);
59 | });
60 | }
61 |
62 | /**
63 | * Get the services provided by the provider.
64 | *
65 | * @return array
66 | */
67 | public function provides()
68 | {
69 | return [
70 | 'validator', 'validation.presence',
71 | ];
72 | }
73 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/RegisterController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
41 | }
42 |
43 | /**
44 | * Get a validator for an incoming registration request.
45 | *
46 | * @param array $data
47 | * @return \Illuminate\Contracts\Validation\Validator
48 | */
49 | protected function validator(array $data)
50 | {
51 | return Validator::make($data, [
52 | 'name' => ['required', 'string', 'max:255'],
53 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
54 | 'password' => ['required', 'string', 'min:6', 'confirmed'],
55 | ]);
56 | }
57 |
58 | /**
59 | * Create a new user instance after a valid registration.
60 | *
61 | * @param array $data
62 | * @return \App\User
63 | */
64 | protected function create(array $data)
65 | {
66 | return User::create([
67 | 'name' => $data['name'],
68 | 'email' => $data['email'],
69 | 'password' => Hash::make($data['password']),
70 | ]);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Cloud Filesystem Disk
21 | |--------------------------------------------------------------------------
22 | |
23 | | Many applications store files both locally and in the cloud. For this
24 | | reason, you may specify a default "cloud" driver here. This driver
25 | | will be bound as the Cloud disk implementation in the container.
26 | |
27 | */
28 |
29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Filesystem Disks
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here you may configure as many filesystem "disks" as you wish, and you
37 | | may even configure multiple disks of the same driver. Defaults have
38 | | been setup for each driver as an example of the required options.
39 | |
40 | | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'public' => [
52 | 'driver' => 'local',
53 | 'root' => storage_path('app/public'),
54 | 'url' => env('APP_URL').'/storage',
55 | 'visibility' => 'public',
56 | ],
57 |
58 | 's3' => [
59 | 'driver' => 's3',
60 | 'key' => env('AWS_ACCESS_KEY_ID'),
61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
62 | 'region' => env('AWS_DEFAULT_REGION'),
63 | 'bucket' => env('AWS_BUCKET'),
64 | 'url' => env('AWS_URL'),
65 | ],
66 |
67 | ],
68 |
69 | ];
70 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | ],
43 |
44 | 'beanstalkd' => [
45 | 'driver' => 'beanstalkd',
46 | 'host' => 'localhost',
47 | 'queue' => 'default',
48 | 'retry_after' => 90,
49 | ],
50 |
51 | 'sqs' => [
52 | 'driver' => 'sqs',
53 | 'key' => env('SQS_KEY', 'your-public-key'),
54 | 'secret' => env('SQS_SECRET', 'your-secret-key'),
55 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
56 | 'queue' => env('SQS_QUEUE', 'your-queue-name'),
57 | 'region' => env('SQS_REGION', 'us-east-1'),
58 | ],
59 |
60 | 'redis' => [
61 | 'driver' => 'redis',
62 | 'connection' => 'default',
63 | 'queue' => env('REDIS_QUEUE', 'default'),
64 | 'retry_after' => 90,
65 | 'block_for' => null,
66 | ],
67 |
68 | ],
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Failed Queue Jobs
73 | |--------------------------------------------------------------------------
74 | |
75 | | These options configure the behavior of failed queue job logging so you
76 | | can control which database and table are used to store the jobs that
77 | | have failed. You may change them to any database / table you wish.
78 | |
79 | */
80 |
81 | 'failed' => [
82 | 'database' => env('DB_CONNECTION', 'mysql'),
83 | 'table' => 'failed_jobs',
84 | ],
85 |
86 | ];
87 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Log Channels
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may configure the log channels for your application. Out of
27 | | the box, Laravel uses the Monolog PHP logging library. This gives
28 | | you a variety of powerful log handlers / formatters to utilize.
29 | |
30 | | Available Drivers: "single", "daily", "slack", "syslog",
31 | | "errorlog", "monolog",
32 | | "custom", "stack"
33 | |
34 | */
35 |
36 | 'channels' => [
37 | 'stack' => [
38 | 'driver' => 'stack',
39 | 'channels' => ['daily'],
40 | ],
41 |
42 | 'single' => [
43 | 'driver' => 'single',
44 | 'path' => storage_path('logs/laravel.log'),
45 | 'level' => 'debug',
46 | ],
47 |
48 | 'daily' => [
49 | 'driver' => 'daily',
50 | 'path' => storage_path('logs/laravel.log'),
51 | 'level' => 'debug',
52 | 'days' => 14,
53 | ],
54 |
55 | 'slack' => [
56 | 'driver' => 'slack',
57 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
58 | 'username' => 'Laravel Log',
59 | 'emoji' => ':boom:',
60 | 'level' => 'critical',
61 | ],
62 |
63 | 'papertrail' => [
64 | 'driver' => 'monolog',
65 | 'level' => 'debug',
66 | 'handler' => SyslogUdpHandler::class,
67 | 'handler_with' => [
68 | 'host' => env('PAPERTRAIL_URL'),
69 | 'port' => env('PAPERTRAIL_PORT'),
70 | ],
71 | ],
72 |
73 | 'stderr' => [
74 | 'driver' => 'monolog',
75 | 'handler' => StreamHandler::class,
76 | 'formatter' => env('LOG_STDERR_FORMATTER'),
77 | 'with' => [
78 | 'stream' => 'php://stderr',
79 | ],
80 | ],
81 |
82 | 'syslog' => [
83 | 'driver' => 'syslog',
84 | 'level' => 'debug',
85 | ],
86 |
87 | 'errorlog' => [
88 | 'driver' => 'errorlog',
89 | 'level' => 'debug',
90 | ],
91 | ],
92 |
93 | ];
94 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Cache Stores
25 | |--------------------------------------------------------------------------
26 | |
27 | | Here you may define all of the cache "stores" for your application as
28 | | well as their drivers. You may even define multiple stores for the
29 | | same cache driver to group types of items stored in your caches.
30 | |
31 | */
32 |
33 | 'stores' => [
34 |
35 | 'apc' => [
36 | 'driver' => 'apc',
37 | ],
38 |
39 | 'array' => [
40 | 'driver' => 'array',
41 | ],
42 |
43 | 'database' => [
44 | 'driver' => 'database',
45 | 'table' => 'cache',
46 | 'connection' => null,
47 | ],
48 |
49 | 'file' => [
50 | 'driver' => 'file',
51 | 'path' => storage_path('framework/cache/data'),
52 | ],
53 |
54 | 'memcached' => [
55 | 'driver' => 'memcached',
56 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
57 | 'sasl' => [
58 | env('MEMCACHED_USERNAME'),
59 | env('MEMCACHED_PASSWORD'),
60 | ],
61 | 'options' => [
62 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
63 | ],
64 | 'servers' => [
65 | [
66 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
67 | 'port' => env('MEMCACHED_PORT', 11211),
68 | 'weight' => 100,
69 | ],
70 | ],
71 | ],
72 |
73 | 'redis' => [
74 | 'driver' => 'redis',
75 | 'connection' => 'cache',
76 | ],
77 |
78 | ],
79 |
80 | /*
81 | |--------------------------------------------------------------------------
82 | | Cache Key Prefix
83 | |--------------------------------------------------------------------------
84 | |
85 | | When utilizing a RAM based store such as APC or Memcached, there might
86 | | be other applications utilizing the same cache. So, we'll specify a
87 | | value to get prefixed to all our keys so we can avoid collisions.
88 | |
89 | */
90 |
91 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
92 |
93 | ];
94 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
31 | \App\Http\Middleware\EncryptCookies::class,
32 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
33 | \Illuminate\Session\Middleware\StartSession::class,
34 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
35 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
36 | \App\Http\Middleware\VerifyCsrfToken::class,
37 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
38 | ],
39 |
40 | 'api' => [
41 | 'throttle:60,1',
42 | 'bindings',
43 | ],
44 | ];
45 |
46 | /**
47 | * The application's route middleware.
48 | *
49 | * These middleware may be assigned to groups or used individually.
50 | *
51 | * @var array
52 | */
53 | protected $routeMiddleware = [
54 | 'auth' => \App\Http\Middleware\Authenticate::class,
55 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
56 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
57 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
58 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
59 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
60 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
61 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
62 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
63 | ];
64 |
65 | /**
66 | * The priority-sorted list of middleware.
67 | *
68 | * This forces non-global middleware to always be in the given order.
69 | *
70 | * @var array
71 | */
72 | protected $middlewarePriority = [
73 | \Illuminate\Session\Middleware\StartSession::class,
74 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
75 | \App\Http\Middleware\Authenticate::class,
76 | \Illuminate\Session\Middleware\AuthenticateSession::class,
77 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
78 | \Illuminate\Auth\Middleware\Authorize::class,
79 | ];
80 | }
81 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 |
44 | 'api' => [
45 | 'driver' => 'token',
46 | 'provider' => 'users',
47 | ],
48 | ],
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | User Providers
53 | |--------------------------------------------------------------------------
54 | |
55 | | All authentication drivers have a user provider. This defines how the
56 | | users are actually retrieved out of your database or other storage
57 | | mechanisms used by this application to persist your user's data.
58 | |
59 | | If you have multiple user tables or models you may configure multiple
60 | | sources which represent each model / table. These sources may then
61 | | be assigned to any extra authentication guards you have defined.
62 | |
63 | | Supported: "database", "eloquent"
64 | |
65 | */
66 |
67 | 'providers' => [
68 | 'users' => [
69 | 'driver' => 'eloquent',
70 | 'model' => App\User::class,
71 | ],
72 |
73 | // 'users' => [
74 | // 'driver' => 'database',
75 | // 'table' => 'users',
76 | // ],
77 | ],
78 |
79 | /*
80 | |--------------------------------------------------------------------------
81 | | Resetting Passwords
82 | |--------------------------------------------------------------------------
83 | |
84 | | You may specify multiple password reset configurations if you have more
85 | | than one user table or model in the application and you want to have
86 | | separate password reset settings based on the specific user types.
87 | |
88 | | The expire time is the number of minutes that the reset token should be
89 | | considered valid. This security feature keeps tokens short-lived so
90 | | they have less time to be guessed. You may change this as needed.
91 | |
92 | */
93 |
94 | 'passwords' => [
95 | 'users' => [
96 | 'provider' => 'users',
97 | 'table' => 'password_resets',
98 | 'expire' => 60,
99 | ],
100 | ],
101 |
102 | ];
103 |
--------------------------------------------------------------------------------
/public/svg/404.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/Http/Requests/AttributesRequest.php:
--------------------------------------------------------------------------------
1 | 'required',
37 | 'items' => 'required|array'
38 | ];
39 | }
40 |
41 | /**
42 | * Get only non empty input.
43 | *
44 | * @return \Illuminate\Support\Collection
45 | */
46 | public function nonEmpty(): Collection
47 | {
48 | return collect($this->items)->filter('is_not_empty');
49 | }
50 |
51 | /**
52 | * Get sizes.
53 | *
54 | * @return \Illuminate\Support\Collection
55 | */
56 | public static function sizes(): Collection
57 | {
58 | return new Collection([
59 | [
60 | 'name' => 10,
61 | 'value' => 1,
62 | ],
63 | [
64 | 'name' => 12,
65 | 'value' => 2,
66 | ]
67 | ]);
68 | }
69 |
70 | /**
71 | * Get response data set.
72 | *
73 | * @return array
74 | */
75 | public function data(): array
76 | {
77 | switch($this->id) {
78 | case 'colour':
79 | return $this->colour();
80 | case 'brand':
81 | return $this->brand();
82 | default:
83 | return [];
84 | }
85 | }
86 |
87 | /**
88 | * Get colours.
89 | *
90 | * @return array
91 | */
92 | private function colour(): array
93 | {
94 | switch($this->items['size']) {
95 | case 1:
96 | return [
97 | [
98 | 'name' => 'Green',
99 | 'value' => 3
100 | ],
101 | [
102 | 'name' => 'Orange',
103 | 'value' => 4
104 | ]
105 | ];
106 | case 2:
107 | return [
108 | [
109 | 'name' => 'Brown',
110 | 'value' => 5
111 | ],
112 | [
113 | 'name' => 'Pink',
114 | 'value' => 6
115 | ]
116 | ];
117 | default:
118 | return [];
119 | }
120 | }
121 |
122 | /**
123 | * Get brands.
124 | *
125 | * @return array
126 | */
127 | private function brand(): array
128 | {
129 | switch($this->items['colour']) {
130 | case 3:
131 | return [
132 | [
133 | 'name' => 'Apple',
134 | 'value' => 7
135 | ],
136 | [
137 | 'name' => 'Orange',
138 | 'value' => 8
139 | ]
140 | ];
141 | case 4:
142 | return [
143 | [
144 | 'name' => 'Banana',
145 | 'value' => 9
146 | ],
147 | [
148 | 'name' => 'Peach',
149 | 'value' => 10
150 | ]
151 | ];
152 | case 5:
153 | return [
154 | [
155 | 'name' => 'Plum',
156 | 'value' => 11
157 | ],
158 | [
159 | 'name' => 'Avocado',
160 | 'value' => 12
161 | ]
162 | ];
163 | case 6:
164 | return [
165 | [
166 | 'name' => 'Strawberry',
167 | 'value' => 13
168 | ],
169 | [
170 | 'name' => 'Blueberry',
171 | 'value' => 14
172 | ]
173 | ];
174 | default:
175 | return [];
176 | }
177 | }
178 | }
179 |
--------------------------------------------------------------------------------
/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mysql'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Database Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here are each of the database connections setup for your application.
24 | | Of course, examples of configuring each database platform that is
25 | | supported by Laravel is shown below to make development simple.
26 | |
27 | |
28 | | All database work in Laravel is done through the PHP PDO facilities
29 | | so make sure you have the driver for your particular database of
30 | | choice installed on your machine before you begin development.
31 | |
32 | */
33 |
34 | 'connections' => [
35 |
36 | 'sqlite' => [
37 | 'driver' => 'sqlite',
38 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
39 | 'prefix' => '',
40 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
41 | ],
42 |
43 | 'mysql' => [
44 | 'driver' => 'mysql',
45 | 'host' => env('DB_HOST', '127.0.0.1'),
46 | 'port' => env('DB_PORT', '3306'),
47 | 'database' => env('DB_DATABASE', 'forge'),
48 | 'username' => env('DB_USERNAME', 'forge'),
49 | 'password' => env('DB_PASSWORD', ''),
50 | 'unix_socket' => env('DB_SOCKET', ''),
51 | 'charset' => 'utf8mb4',
52 | 'collation' => 'utf8mb4_unicode_ci',
53 | 'prefix' => '',
54 | 'prefix_indexes' => true,
55 | 'strict' => true,
56 | 'engine' => null,
57 | ],
58 |
59 | 'pgsql' => [
60 | 'driver' => 'pgsql',
61 | 'host' => env('DB_HOST', '127.0.0.1'),
62 | 'port' => env('DB_PORT', '5432'),
63 | 'database' => env('DB_DATABASE', 'forge'),
64 | 'username' => env('DB_USERNAME', 'forge'),
65 | 'password' => env('DB_PASSWORD', ''),
66 | 'charset' => 'utf8',
67 | 'prefix' => '',
68 | 'prefix_indexes' => true,
69 | 'schema' => 'public',
70 | 'sslmode' => 'prefer',
71 | ],
72 |
73 | 'sqlsrv' => [
74 | 'driver' => 'sqlsrv',
75 | 'host' => env('DB_HOST', 'localhost'),
76 | 'port' => env('DB_PORT', '1433'),
77 | 'database' => env('DB_DATABASE', 'forge'),
78 | 'username' => env('DB_USERNAME', 'forge'),
79 | 'password' => env('DB_PASSWORD', ''),
80 | 'charset' => 'utf8',
81 | 'prefix' => '',
82 | 'prefix_indexes' => true,
83 | ],
84 |
85 | ],
86 |
87 | /*
88 | |--------------------------------------------------------------------------
89 | | Migration Repository Table
90 | |--------------------------------------------------------------------------
91 | |
92 | | This table keeps track of all the migrations that have already run for
93 | | your application. Using this information, we can determine which of
94 | | the migrations on disk haven't actually been run in the database.
95 | |
96 | */
97 |
98 | 'migrations' => 'migrations',
99 |
100 | /*
101 | |--------------------------------------------------------------------------
102 | | Redis Databases
103 | |--------------------------------------------------------------------------
104 | |
105 | | Redis is an open source, fast, and advanced key-value store that also
106 | | provides a richer body of commands than a typical key-value system
107 | | such as APC or Memcached. Laravel makes it easy to dig right in.
108 | |
109 | */
110 |
111 | 'redis' => [
112 |
113 | 'client' => 'predis',
114 |
115 | 'default' => [
116 | 'host' => env('REDIS_HOST', '127.0.0.1'),
117 | 'password' => env('REDIS_PASSWORD', null),
118 | 'port' => env('REDIS_PORT', 6379),
119 | 'database' => env('REDIS_DB', 0),
120 | ],
121 |
122 | 'cache' => [
123 | 'host' => env('REDIS_HOST', '127.0.0.1'),
124 | 'password' => env('REDIS_PASSWORD', null),
125 | 'port' => env('REDIS_PORT', 6379),
126 | 'database' => env('REDIS_CACHE_DB', 1),
127 | ],
128 |
129 | ],
130 |
131 | ];
132 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_DRIVER', 'smtp'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | SMTP Host Address
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may provide the host address of the SMTP server used by your
27 | | applications. A default option is provided that is compatible with
28 | | the Mailgun mail service which will provide reliable deliveries.
29 | |
30 | */
31 |
32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | SMTP Host Port
37 | |--------------------------------------------------------------------------
38 | |
39 | | This is the SMTP port used by your application to deliver e-mails to
40 | | users of the application. Like the host we have set this value to
41 | | stay compatible with the Mailgun e-mail application by default.
42 | |
43 | */
44 |
45 | 'port' => env('MAIL_PORT', 587),
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Global "From" Address
50 | |--------------------------------------------------------------------------
51 | |
52 | | You may wish for all e-mails sent by your application to be sent from
53 | | the same address. Here, you may specify a name and address that is
54 | | used globally for all e-mails that are sent by your application.
55 | |
56 | */
57 |
58 | 'from' => [
59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
60 | 'name' => env('MAIL_FROM_NAME', 'Example'),
61 | ],
62 |
63 | /*
64 | |--------------------------------------------------------------------------
65 | | E-Mail Encryption Protocol
66 | |--------------------------------------------------------------------------
67 | |
68 | | Here you may specify the encryption protocol that should be used when
69 | | the application send e-mail messages. A sensible default using the
70 | | transport layer security protocol should provide great security.
71 | |
72 | */
73 |
74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | SMTP Server Username
79 | |--------------------------------------------------------------------------
80 | |
81 | | If your SMTP server requires a username for authentication, you should
82 | | set it here. This will get used to authenticate with your server on
83 | | connection. You may also set the "password" value below this one.
84 | |
85 | */
86 |
87 | 'username' => env('MAIL_USERNAME'),
88 |
89 | 'password' => env('MAIL_PASSWORD'),
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Sendmail System Path
94 | |--------------------------------------------------------------------------
95 | |
96 | | When using the "sendmail" driver to send e-mails, we will need to know
97 | | the path to where Sendmail lives on this server. A default path has
98 | | been provided here, which will work well on most of your systems.
99 | |
100 | */
101 |
102 | 'sendmail' => '/usr/sbin/sendmail -bs',
103 |
104 | /*
105 | |--------------------------------------------------------------------------
106 | | Markdown Mail Settings
107 | |--------------------------------------------------------------------------
108 | |
109 | | If you are using Markdown based email rendering, you may configure your
110 | | theme and component paths here, allowing you to customize the design
111 | | of the emails. Or, you may simply stick with the Laravel defaults!
112 | |
113 | */
114 |
115 | 'markdown' => [
116 | 'theme' => 'default',
117 |
118 | 'paths' => [
119 | resource_path('views/vendor/mail'),
120 | ],
121 | ],
122 |
123 | /*
124 | |--------------------------------------------------------------------------
125 | | Log Channel
126 | |--------------------------------------------------------------------------
127 | |
128 | | If you are using the "log" driver, you may specify the logging channel
129 | | if you prefer to keep mail messages separate from other log entries
130 | | for simpler reading. Otherwise, the default channel will be used.
131 | |
132 | */
133 |
134 | 'log_channel' => env('MAIL_LOG_CHANNEL'),
135 |
136 | ];
137 |
--------------------------------------------------------------------------------
/public/svg/503.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/svg/403.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/Feature/MainTest.php:
--------------------------------------------------------------------------------
1 | 1,
21 | 'first_name' => 'Jon',
22 | 'last_name' => 'Doe',
23 | 'email' => 'jon@doe.com',
24 | 'password' => 'Pa55w0rd!',
25 | 'address' => [
26 | 'line_1' => 'Address line 1',
27 | 'line_2' => 'Address line 2',
28 | 'town' => 'London',
29 | 'post_code' => 'LN20'
30 | ],
31 | 'share' => 'a',
32 | 'privacy' => true,
33 | 'terms' => true,
34 | 'colours' => ['blue', 'green'],
35 | 'city' => 1,
36 | 'fruit' => ['apple', 'banana'],
37 | 'excerpt' => 'Excerpt',
38 | 'body' => 'Header
',
39 | ], $replace);
40 | }
41 |
42 | /**
43 | * @test
44 | */
45 | public function validation_fails_with_empty_request()
46 | {
47 | $response = $this->postJson(route('main.store'));
48 |
49 | $response->assertExactJson($this->validationError([
50 | 'title' => ['required'],
51 | 'first_name' => ['present'],
52 | 'last_name' => ['required'],
53 | 'email' => ['required'],
54 | 'password' => ['required'],
55 | 'address.line_1' => ['required'],
56 | 'address.line_2' => ['present'],
57 | 'address.town' => ['required'],
58 | 'address.post_code' => ['required'],
59 | 'share' => ['required'],
60 | 'privacy' => ['required'],
61 | 'terms' => ['accepted'],
62 | 'colours' => ['required'],
63 | 'city' => ['required'],
64 | 'fruit' => ['required'],
65 | 'excerpt' => ['required'],
66 | 'body' => ['required'],
67 | ]));
68 | }
69 |
70 | /**
71 | * @test
72 | */
73 | public function validation_fails_with_minimum_string_length_not_met()
74 | {
75 | $response = $this->postJson(route('main.store'), $this->data([
76 | 'first_name' => 'S',
77 | 'last_name' => 'S',
78 | 'excerpt' => 'Ex',
79 | ]));
80 |
81 | $response->assertExactJson($this->validationError([
82 | 'first_name' => ['min'],
83 | 'last_name' => ['min'],
84 | 'excerpt' => ['min'],
85 | ]));
86 | }
87 |
88 | /**
89 | * @test
90 | */
91 | public function validation_fails_with_maximum_string_length_exceeded()
92 | {
93 | $response = $this->postJson(route('main.store'), $this->data([
94 | 'first_name' => $string31 = Str::random(31),
95 | 'last_name' => $string31,
96 | 'address' => [
97 | 'post_code' => '12345678910'
98 | ],
99 | 'excerpt' => '12345678910',
100 | ]));
101 |
102 | $response->assertExactJson($this->validationError([
103 | 'first_name' => ['max'],
104 | 'last_name' => ['max'],
105 | 'address.post_code' => ['max'],
106 | 'excerpt' => ['max'],
107 | ]));
108 | }
109 |
110 | /**
111 | * @test
112 | */
113 | public function validation_fails_with_minimum_array_count_not_met()
114 | {
115 | // need it this way because replace recursive won't replace if empty array
116 | $response = $this->postJson(route('main.store'), array_merge(
117 | $this->data(),
118 | ['colours' => ['blue']]
119 | ));
120 |
121 | $response->assertExactJson($this->validationError([
122 | 'colours' => ['min'],
123 | ]));
124 | }
125 |
126 | /**
127 | * @test
128 | */
129 | public function validation_fails_with_maximum_array_count_exceeded()
130 | {
131 | $response = $this->postJson(route('main.store'), $this->data([
132 | 'colours' => ['blue', 'orange', 'yellow']
133 | ]));
134 |
135 | $response->assertExactJson($this->validationError([
136 | 'colours' => ['max'],
137 | ]));
138 | }
139 |
140 | /**
141 | * @test
142 | */
143 | public function validation_fails_with_invalid_password()
144 | {
145 | $response = $this->postJson(route('main.store'), $this->data([
146 | 'password' => 'password'
147 | ]));
148 |
149 | $response->assertExactJson($this->validationError([
150 | 'password' => ['password'],
151 | ]));
152 | }
153 |
154 | /**
155 | * @test
156 | */
157 | public function validation_fails_with_invalid_checkbox_value()
158 | {
159 | $data = $this->data([
160 | 'share' => 'b',
161 | 'terms' => false,
162 | ]);
163 |
164 | unset($data['privacy']);
165 |
166 | $response = $this->postJson(route('main.store'), $data);
167 |
168 | $response->assertExactJson($this->validationError([
169 | 'share' => ['in'],
170 | 'privacy' => ['required'],
171 | 'terms' => ['accepted'],
172 | ]));
173 | }
174 |
175 | /**
176 | * @test
177 | */
178 | public function validation_fails_with_value_not_found_in_collection()
179 | {
180 | $response = $this->postJson(route('main.store'), $this->data([
181 | 'title' => 6,
182 | 'city' => 4,
183 | ]));
184 |
185 | $response->assertExactJson($this->validationError([
186 | 'title' => ['in'],
187 | 'city' => ['in'],
188 | ]));
189 | }
190 |
191 | /**
192 | * @test
193 | */
194 | public function validation_succeeds_with_json_response()
195 | {
196 | $response = $this->postJson(route('main.store'), $this->data());
197 |
198 | $response->assertExactJson([
199 | 'behaviour' => 'confirmWithDialogAndReset',
200 | 'message' => 'Your request has been processed successfully.'
201 | ]);
202 | }
203 | }
204 |
--------------------------------------------------------------------------------
/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Session Lifetime
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may specify the number of minutes that you wish the session
29 | | to be allowed to remain idle before it expires. If you want them
30 | | to immediately expire on the browser closing, set that option.
31 | |
32 | */
33 |
34 | 'lifetime' => env('SESSION_LIFETIME', 120),
35 |
36 | 'expire_on_close' => false,
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Session Encryption
41 | |--------------------------------------------------------------------------
42 | |
43 | | This option allows you to easily specify that all of your session data
44 | | should be encrypted before it is stored. All encryption will be run
45 | | automatically by Laravel and you can use the Session like normal.
46 | |
47 | */
48 |
49 | 'encrypt' => false,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Session File Location
54 | |--------------------------------------------------------------------------
55 | |
56 | | When using the native session driver, we need a location where session
57 | | files may be stored. A default has been set for you but a different
58 | | location may be specified. This is only needed for file sessions.
59 | |
60 | */
61 |
62 | 'files' => storage_path('framework/sessions'),
63 |
64 | /*
65 | |--------------------------------------------------------------------------
66 | | Session Database Connection
67 | |--------------------------------------------------------------------------
68 | |
69 | | When using the "database" or "redis" session drivers, you may specify a
70 | | connection that should be used to manage these sessions. This should
71 | | correspond to a connection in your database configuration options.
72 | |
73 | */
74 |
75 | 'connection' => env('SESSION_CONNECTION', null),
76 |
77 | /*
78 | |--------------------------------------------------------------------------
79 | | Session Database Table
80 | |--------------------------------------------------------------------------
81 | |
82 | | When using the "database" session driver, you may specify the table we
83 | | should use to manage the sessions. Of course, a sensible default is
84 | | provided for you; however, you are free to change this as needed.
85 | |
86 | */
87 |
88 | 'table' => 'sessions',
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Session Cache Store
93 | |--------------------------------------------------------------------------
94 | |
95 | | When using the "apc" or "memcached" session drivers, you may specify a
96 | | cache store that should be used for these sessions. This value must
97 | | correspond with one of the application's configured cache stores.
98 | |
99 | */
100 |
101 | 'store' => env('SESSION_STORE', null),
102 |
103 | /*
104 | |--------------------------------------------------------------------------
105 | | Session Sweeping Lottery
106 | |--------------------------------------------------------------------------
107 | |
108 | | Some session drivers must manually sweep their storage location to get
109 | | rid of old sessions from storage. Here are the chances that it will
110 | | happen on a given request. By default, the odds are 2 out of 100.
111 | |
112 | */
113 |
114 | 'lottery' => [2, 100],
115 |
116 | /*
117 | |--------------------------------------------------------------------------
118 | | Session Cookie Name
119 | |--------------------------------------------------------------------------
120 | |
121 | | Here you may change the name of the cookie used to identify a session
122 | | instance by ID. The name specified here will get used every time a
123 | | new session cookie is created by the framework for every driver.
124 | |
125 | */
126 |
127 | 'cookie' => env(
128 | 'SESSION_COOKIE',
129 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
130 | ),
131 |
132 | /*
133 | |--------------------------------------------------------------------------
134 | | Session Cookie Path
135 | |--------------------------------------------------------------------------
136 | |
137 | | The session cookie path determines the path for which the cookie will
138 | | be regarded as available. Typically, this will be the root path of
139 | | your application but you are free to change this when necessary.
140 | |
141 | */
142 |
143 | 'path' => '/',
144 |
145 | /*
146 | |--------------------------------------------------------------------------
147 | | Session Cookie Domain
148 | |--------------------------------------------------------------------------
149 | |
150 | | Here you may change the domain of the cookie used to identify a session
151 | | in your application. This will determine which domains the cookie is
152 | | available to in your application. A sensible default has been set.
153 | |
154 | */
155 |
156 | 'domain' => env('SESSION_DOMAIN', null),
157 |
158 | /*
159 | |--------------------------------------------------------------------------
160 | | HTTPS Only Cookies
161 | |--------------------------------------------------------------------------
162 | |
163 | | By setting this option to true, session cookies will only be sent back
164 | | to the server if the browser has a HTTPS connection. This will keep
165 | | the cookie from being sent to you if it can not be done securely.
166 | |
167 | */
168 |
169 | 'secure' => env('SESSION_SECURE_COOKIE', false),
170 |
171 | /*
172 | |--------------------------------------------------------------------------
173 | | HTTP Access Only
174 | |--------------------------------------------------------------------------
175 | |
176 | | Setting this value to true will prevent JavaScript from accessing the
177 | | value of the cookie and the cookie will only be accessible through
178 | | the HTTP protocol. You are free to modify this option if needed.
179 | |
180 | */
181 |
182 | 'http_only' => true,
183 |
184 | /*
185 | |--------------------------------------------------------------------------
186 | | Same-Site Cookies
187 | |--------------------------------------------------------------------------
188 | |
189 | | This option determines how your cookies behave when cross-site requests
190 | | take place, and can be used to mitigate CSRF attacks. By default, we
191 | | do not enable this as other CSRF protection services are in place.
192 | |
193 | | Supported: "lax", "strict"
194 | |
195 | */
196 |
197 | 'same_site' => null,
198 |
199 | ];
200 |
--------------------------------------------------------------------------------
/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 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
20 | 'alpha' => 'The :attribute may only contain letters.',
21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.',
22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.',
23 | 'array' => 'The :attribute must be an array.',
24 | 'before' => 'The :attribute must be a date before :date.',
25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
26 | 'between' => [
27 | 'numeric' => 'The :attribute must be between :min and :max.',
28 | 'file' => 'The :attribute must be between :min and :max kilobytes.',
29 | 'string' => 'The :attribute must be between :min and :max characters.',
30 | 'array' => 'The :attribute must have between :min and :max items.',
31 | ],
32 | 'boolean' => 'The :attribute field must be true or false.',
33 | 'confirmed' => 'The :attribute confirmation does not match.',
34 | 'date' => 'The :attribute is not a valid date.',
35 | 'date_equals' => 'The :attribute must be a date equal to :date.',
36 | 'date_format' => 'The :attribute does not match the format :format.',
37 | 'different' => 'The :attribute and :other must be different.',
38 | 'digits' => 'The :attribute must be :digits digits.',
39 | 'digits_between' => 'The :attribute must be between :min and :max digits.',
40 | 'dimensions' => 'The :attribute has invalid image dimensions.',
41 | 'distinct' => 'The :attribute field has a duplicate value.',
42 | 'email' => 'The :attribute must be a valid email address.',
43 | 'exists' => 'The selected :attribute is invalid.',
44 | 'file' => 'The :attribute must be a file.',
45 | 'filled' => 'The :attribute field must have a value.',
46 | 'gt' => [
47 | 'numeric' => 'The :attribute must be greater than :value.',
48 | 'file' => 'The :attribute must be greater than :value kilobytes.',
49 | 'string' => 'The :attribute must be greater than :value characters.',
50 | 'array' => 'The :attribute must have more than :value items.',
51 | ],
52 | 'gte' => [
53 | 'numeric' => 'The :attribute must be greater than or equal :value.',
54 | 'file' => 'The :attribute must be greater than or equal :value kilobytes.',
55 | 'string' => 'The :attribute must be greater than or equal :value characters.',
56 | 'array' => 'The :attribute must have :value items or more.',
57 | ],
58 | 'image' => 'The :attribute must be an image.',
59 | 'in' => 'The selected :attribute is invalid.',
60 | 'in_array' => 'The :attribute field does not exist in :other.',
61 | 'integer' => 'The :attribute must be an integer.',
62 | 'ip' => 'The :attribute must be a valid IP address.',
63 | 'ipv4' => 'The :attribute must be a valid IPv4 address.',
64 | 'ipv6' => 'The :attribute must be a valid IPv6 address.',
65 | 'json' => 'The :attribute must be a valid JSON string.',
66 | 'lt' => [
67 | 'numeric' => 'The :attribute must be less than :value.',
68 | 'file' => 'The :attribute must be less than :value kilobytes.',
69 | 'string' => 'The :attribute must be less than :value characters.',
70 | 'array' => 'The :attribute must have less than :value items.',
71 | ],
72 | 'lte' => [
73 | 'numeric' => 'The :attribute must be less than or equal :value.',
74 | 'file' => 'The :attribute must be less than or equal :value kilobytes.',
75 | 'string' => 'The :attribute must be less than or equal :value characters.',
76 | 'array' => 'The :attribute must not have more than :value items.',
77 | ],
78 | 'max' => [
79 | 'numeric' => 'The :attribute may not be greater than :max.',
80 | 'file' => 'The :attribute may not be greater than :max kilobytes.',
81 | 'string' => 'The :attribute may not be greater than :max characters.',
82 | 'array' => 'The :attribute may not have more than :max items.',
83 | ],
84 | 'mimes' => 'The :attribute must be a file of type: :values.',
85 | 'mimetypes' => 'The :attribute must be a file of type: :values.',
86 | 'min' => [
87 | 'numeric' => 'The :attribute must be at least :min.',
88 | 'file' => 'The :attribute must be at least :min kilobytes.',
89 | 'string' => 'The :attribute must be at least :min characters.',
90 | 'array' => 'The :attribute must have at least :min items.',
91 | ],
92 | 'not_in' => 'The selected :attribute is invalid.',
93 | 'not_regex' => 'The :attribute format is invalid.',
94 | 'numeric' => 'The :attribute must be a number.',
95 | 'present' => 'The :attribute field must be present.',
96 | 'regex' => 'The :attribute format is invalid.',
97 | 'required' => 'The :attribute field is required.',
98 | 'required_if' => 'The :attribute field is required when :other is :value.',
99 | 'required_unless' => 'The :attribute field is required unless :other is in :values.',
100 | 'required_with' => 'The :attribute field is required when :values is present.',
101 | 'required_with_all' => 'The :attribute field is required when :values are present.',
102 | 'required_without' => 'The :attribute field is required when :values is not present.',
103 | 'required_without_all' => 'The :attribute field is required when none of :values are present.',
104 | 'same' => 'The :attribute and :other must match.',
105 | 'size' => [
106 | 'numeric' => 'The :attribute must be :size.',
107 | 'file' => 'The :attribute must be :size kilobytes.',
108 | 'string' => 'The :attribute must be :size characters.',
109 | 'array' => 'The :attribute must contain :size items.',
110 | ],
111 | 'starts_with' => 'The :attribute must start with one of the following: :values',
112 | 'string' => 'The :attribute must be a string.',
113 | 'timezone' => 'The :attribute must be a valid zone.',
114 | 'unique' => 'The :attribute has already been taken.',
115 | 'uploaded' => 'The :attribute failed to upload.',
116 | 'url' => 'The :attribute format is invalid.',
117 | 'uuid' => 'The :attribute must be a valid UUID.',
118 |
119 | /*
120 | |--------------------------------------------------------------------------
121 | | Custom Validation Language Lines
122 | |--------------------------------------------------------------------------
123 | |
124 | | Here you may specify custom validation messages for attributes using the
125 | | convention "attribute.rule" to name the lines. This makes it quick to
126 | | specify a specific custom language line for a given attribute rule.
127 | |
128 | */
129 |
130 | 'custom' => [
131 | 'attribute-name' => [
132 | 'rule-name' => 'custom-message',
133 | ],
134 | ],
135 |
136 | /*
137 | |--------------------------------------------------------------------------
138 | | Custom Validation Attributes
139 | |--------------------------------------------------------------------------
140 | |
141 | | The following language lines are used to swap our attribute placeholder
142 | | with something more reader friendly such as "E-Mail Address" instead
143 | | of "email". This simply helps us make our message more expressive.
144 | |
145 | */
146 |
147 | 'attributes' => [],
148 |
149 | ];
150 |
--------------------------------------------------------------------------------
/app/Components/Validation/Factory.php:
--------------------------------------------------------------------------------
1 | container = $container;
87 | $this->translator = $translator;
88 | }
89 |
90 | /**
91 | * Create a new Validator instance.
92 | *
93 | * @param array $data
94 | * @param array $rules
95 | * @param array $messages
96 | * @param array $customAttributes
97 | * @return \Illuminate\Validation\Validator
98 | */
99 | public function make(array $data, array $rules, array $messages = [], array $customAttributes = [])
100 | {
101 | // The presence verifier is responsible for checking the unique and exists data
102 | // for the validator. It is behind an interface so that multiple versions of
103 | // it may be written besides database. We'll inject it into the validator.
104 | $validator = $this->resolve(
105 | $data, $rules, $messages, $customAttributes
106 | );
107 |
108 | if (! is_null($this->verifier)) {
109 | $validator->setPresenceVerifier($this->verifier);
110 | }
111 |
112 | // Next we'll set the IoC container instance of the validator, which is used to
113 | // resolve out class based validator extensions. If it is not set then these
114 | // types of extensions will not be possible on these validation instances.
115 | if (! is_null($this->container)) {
116 | $validator->setContainer($this->container);
117 | }
118 |
119 | $this->addExtensions($validator);
120 |
121 | return $validator;
122 | }
123 |
124 | /**
125 | * Validate the given data against the provided rules.
126 | *
127 | * @param array $data
128 | * @param array $rules
129 | * @param array $messages
130 | * @param array $customAttributes
131 | * @return void
132 | *
133 | * @throws \Illuminate\Validation\ValidationException
134 | */
135 | public function validate(array $data, array $rules, array $messages = [], array $customAttributes = [])
136 | {
137 | $this->make($data, $rules, $messages, $customAttributes)->validate();
138 | }
139 |
140 | /**
141 | * Resolve a new Validator instance.
142 | *
143 | * @param array $data
144 | * @param array $rules
145 | * @param array $messages
146 | * @param array $customAttributes
147 | * @return \Illuminate\Validation\Validator
148 | */
149 | protected function resolve(array $data, array $rules, array $messages, array $customAttributes)
150 | {
151 | if (is_null($this->resolver)) {
152 | return new Validator($this->translator, $data, $rules, $messages, $customAttributes);
153 | }
154 |
155 | return call_user_func($this->resolver, $this->translator, $data, $rules, $messages, $customAttributes);
156 | }
157 |
158 | /**
159 | * Add the extensions to a validator instance.
160 | *
161 | * @param \App\Components\Validation\Validator $validator
162 | * @return void
163 | */
164 | protected function addExtensions(Validator $validator)
165 | {
166 | $validator->addExtensions($this->extensions);
167 |
168 | // Next, we will add the implicit extensions, which are similar to the required
169 | // and accepted rule in that they are run even if the attributes is not in a
170 | // array of data that is given to a validator instances via instantiation.
171 | $validator->addImplicitExtensions($this->implicitExtensions);
172 |
173 | $validator->addDependentExtensions($this->dependentExtensions);
174 |
175 | $validator->addReplacers($this->replacers);
176 |
177 | $validator->setFallbackMessages($this->fallbackMessages);
178 | }
179 |
180 | /**
181 | * Register a custom validator extension.
182 | *
183 | * @param string $rule
184 | * @param \Closure|string $extension
185 | * @param string $message
186 | * @return void
187 | */
188 | public function extend($rule, $extension, $message = null)
189 | {
190 | $this->extensions[$rule] = $extension;
191 |
192 | if ($message) {
193 | $this->fallbackMessages[Str::snake($rule)] = $message;
194 | }
195 | }
196 |
197 | /**
198 | * Register a custom implicit validator extension.
199 | *
200 | * @param string $rule
201 | * @param \Closure|string $extension
202 | * @param string $message
203 | * @return void
204 | */
205 | public function extendImplicit($rule, $extension, $message = null)
206 | {
207 | $this->implicitExtensions[$rule] = $extension;
208 |
209 | if ($message) {
210 | $this->fallbackMessages[Str::snake($rule)] = $message;
211 | }
212 | }
213 |
214 | /**
215 | * Register a custom dependent validator extension.
216 | *
217 | * @param string $rule
218 | * @param \Closure|string $extension
219 | * @param string $message
220 | * @return void
221 | */
222 | public function extendDependent($rule, $extension, $message = null)
223 | {
224 | $this->dependentExtensions[$rule] = $extension;
225 |
226 | if ($message) {
227 | $this->fallbackMessages[Str::snake($rule)] = $message;
228 | }
229 | }
230 |
231 | /**
232 | * Register a custom validator message replacer.
233 | *
234 | * @param string $rule
235 | * @param \Closure|string $replacer
236 | * @return void
237 | */
238 | public function replacer($rule, $replacer)
239 | {
240 | $this->replacers[$rule] = $replacer;
241 | }
242 |
243 | /**
244 | * Set the Validator instance resolver.
245 | *
246 | * @param \Closure $resolver
247 | * @return void
248 | */
249 | public function resolver(Closure $resolver)
250 | {
251 | $this->resolver = $resolver;
252 | }
253 |
254 | /**
255 | * Get the Translator implementation.
256 | *
257 | * @return \Illuminate\Contracts\Translation\Translator
258 | */
259 | public function getTranslator()
260 | {
261 | return $this->translator;
262 | }
263 |
264 | /**
265 | * Get the Presence Verifier implementation.
266 | *
267 | * @return \Illuminate\Validation\PresenceVerifierInterface
268 | */
269 | public function getPresenceVerifier()
270 | {
271 | return $this->verifier;
272 | }
273 |
274 | /**
275 | * Set the Presence Verifier implementation.
276 | *
277 | * @param \Illuminate\Validation\PresenceVerifierInterface $presenceVerifier
278 | * @return void
279 | */
280 | public function setPresenceVerifier(PresenceVerifierInterface $presenceVerifier)
281 | {
282 | $this->verifier = $presenceVerifier;
283 | }
284 | }
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_NAME', 'Laravel'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Application Environment
21 | |--------------------------------------------------------------------------
22 | |
23 | | This value determines the "environment" your application is currently
24 | | running in. This may determine how you prefer to configure various
25 | | services the application utilizes. Set this in your ".env" file.
26 | |
27 | */
28 |
29 | 'env' => env('APP_ENV', 'production'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Application Debug Mode
34 | |--------------------------------------------------------------------------
35 | |
36 | | When your application is in debug mode, detailed error messages with
37 | | stack traces will be shown on every error that occurs within your
38 | | application. If disabled, a simple generic error page is shown.
39 | |
40 | */
41 |
42 | 'debug' => env('APP_DEBUG', false),
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Application URL
47 | |--------------------------------------------------------------------------
48 | |
49 | | This URL is used by the console to properly generate URLs when using
50 | | the Artisan command line tool. You should set this to the root of
51 | | your application so that it is used when running Artisan tasks.
52 | |
53 | */
54 |
55 | 'url' => env('APP_URL', 'http://localhost'),
56 |
57 | 'asset_url' => env('ASSET_URL', null),
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | Application Timezone
62 | |--------------------------------------------------------------------------
63 | |
64 | | Here you may specify the default timezone for your application, which
65 | | will be used by the PHP date and date-time functions. We have gone
66 | | ahead and set this to a sensible default for you out of the box.
67 | |
68 | */
69 |
70 | 'timezone' => 'UTC',
71 |
72 | /*
73 | |--------------------------------------------------------------------------
74 | | Application Locale Configuration
75 | |--------------------------------------------------------------------------
76 | |
77 | | The application locale determines the default locale that will be used
78 | | by the translation service provider. You are free to set this value
79 | | to any of the locales which will be supported by the application.
80 | |
81 | */
82 |
83 | 'locale' => 'en',
84 |
85 | /*
86 | |--------------------------------------------------------------------------
87 | | Application Fallback Locale
88 | |--------------------------------------------------------------------------
89 | |
90 | | The fallback locale determines the locale to use when the current one
91 | | is not available. You may change the value to correspond to any of
92 | | the language folders that are provided through your application.
93 | |
94 | */
95 |
96 | 'fallback_locale' => 'en',
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Faker Locale
101 | |--------------------------------------------------------------------------
102 | |
103 | | This locale will be used by the Faker PHP library when generating fake
104 | | data for your database seeds. For example, this will be used to get
105 | | localized telephone numbers, street address information and more.
106 | |
107 | */
108 |
109 | 'faker_locale' => 'en_US',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Encryption Key
114 | |--------------------------------------------------------------------------
115 | |
116 | | This key is used by the Illuminate encrypter service and should be set
117 | | to a random, 32 character string, otherwise these encrypted strings
118 | | will not be safe. Please do this before deploying an application!
119 | |
120 | */
121 |
122 | 'key' => env('APP_KEY'),
123 |
124 | 'cipher' => 'AES-256-CBC',
125 |
126 | /*
127 | |--------------------------------------------------------------------------
128 | | Autoloaded Service Providers
129 | |--------------------------------------------------------------------------
130 | |
131 | | The service providers listed here will be automatically loaded on the
132 | | request to your application. Feel free to add your own services to
133 | | this array to grant expanded functionality to your applications.
134 | |
135 | */
136 |
137 | 'providers' => [
138 |
139 | /*
140 | * Laravel Framework Service Providers...
141 | */
142 | Illuminate\Auth\AuthServiceProvider::class,
143 | Illuminate\Broadcasting\BroadcastServiceProvider::class,
144 | Illuminate\Bus\BusServiceProvider::class,
145 | Illuminate\Cache\CacheServiceProvider::class,
146 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
147 | Illuminate\Cookie\CookieServiceProvider::class,
148 | Illuminate\Database\DatabaseServiceProvider::class,
149 | Illuminate\Encryption\EncryptionServiceProvider::class,
150 | Illuminate\Filesystem\FilesystemServiceProvider::class,
151 | Illuminate\Foundation\Providers\FoundationServiceProvider::class,
152 | Illuminate\Hashing\HashServiceProvider::class,
153 | Illuminate\Mail\MailServiceProvider::class,
154 | Illuminate\Notifications\NotificationServiceProvider::class,
155 | Illuminate\Pagination\PaginationServiceProvider::class,
156 | Illuminate\Pipeline\PipelineServiceProvider::class,
157 | Illuminate\Queue\QueueServiceProvider::class,
158 | Illuminate\Redis\RedisServiceProvider::class,
159 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
160 | Illuminate\Session\SessionServiceProvider::class,
161 | Illuminate\Translation\TranslationServiceProvider::class,
162 | Illuminate\View\ViewServiceProvider::class,
163 |
164 | /*
165 | * Package Service Providers...
166 | */
167 |
168 | /*
169 | * Application Service Providers...
170 | */
171 | App\Components\Validation\ValidationServiceProvider::class,
172 | App\Providers\AppServiceProvider::class,
173 | App\Providers\AuthServiceProvider::class,
174 | // App\Providers\BroadcastServiceProvider::class,
175 | App\Providers\EventServiceProvider::class,
176 | App\Providers\RouteServiceProvider::class,
177 |
178 | ],
179 |
180 | /*
181 | |--------------------------------------------------------------------------
182 | | Class Aliases
183 | |--------------------------------------------------------------------------
184 | |
185 | | This array of class aliases will be registered when this application
186 | | is started. However, feel free to register as many as you wish as
187 | | the aliases are "lazy" loaded so they don't hinder performance.
188 | |
189 | */
190 |
191 | 'aliases' => [
192 |
193 | 'App' => Illuminate\Support\Facades\App::class,
194 | 'Artisan' => Illuminate\Support\Facades\Artisan::class,
195 | 'Auth' => Illuminate\Support\Facades\Auth::class,
196 | 'Blade' => Illuminate\Support\Facades\Blade::class,
197 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
198 | 'Bus' => Illuminate\Support\Facades\Bus::class,
199 | 'Cache' => Illuminate\Support\Facades\Cache::class,
200 | 'Config' => Illuminate\Support\Facades\Config::class,
201 | 'Cookie' => Illuminate\Support\Facades\Cookie::class,
202 | 'Crypt' => Illuminate\Support\Facades\Crypt::class,
203 | 'DB' => Illuminate\Support\Facades\DB::class,
204 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
205 | 'Event' => Illuminate\Support\Facades\Event::class,
206 | 'File' => Illuminate\Support\Facades\File::class,
207 | 'Gate' => Illuminate\Support\Facades\Gate::class,
208 | 'Hash' => Illuminate\Support\Facades\Hash::class,
209 | 'Lang' => Illuminate\Support\Facades\Lang::class,
210 | 'Log' => Illuminate\Support\Facades\Log::class,
211 | 'Mail' => Illuminate\Support\Facades\Mail::class,
212 | 'Notification' => Illuminate\Support\Facades\Notification::class,
213 | 'Password' => Illuminate\Support\Facades\Password::class,
214 | 'Queue' => Illuminate\Support\Facades\Queue::class,
215 | 'Redirect' => Illuminate\Support\Facades\Redirect::class,
216 | 'Redis' => Illuminate\Support\Facades\Redis::class,
217 | 'Request' => Illuminate\Support\Facades\Request::class,
218 | 'Response' => Illuminate\Support\Facades\Response::class,
219 | 'Route' => Illuminate\Support\Facades\Route::class,
220 | 'Schema' => Illuminate\Support\Facades\Schema::class,
221 | 'Session' => Illuminate\Support\Facades\Session::class,
222 | 'Storage' => Illuminate\Support\Facades\Storage::class,
223 | 'URL' => Illuminate\Support\Facades\URL::class,
224 | 'Validator' => Illuminate\Support\Facades\Validator::class,
225 | 'View' => Illuminate\Support\Facades\View::class,
226 |
227 | ],
228 |
229 | ];
230 |
--------------------------------------------------------------------------------
/public/svg/500.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/assets/sass/_settings.scss:
--------------------------------------------------------------------------------
1 | // Foundation for Sites Settings
2 | // -----------------------------
3 | //
4 | // Table of Contents:
5 | //
6 | // 1. Global
7 | // 2. Breakpoints
8 | // 3. The Grid
9 | // 4. Base Typography
10 | // 5. Typography Helpers
11 | // 6. Abide
12 | // 7. Accordion
13 | // 8. Accordion Menu
14 | // 9. Badge
15 | // 10. Breadcrumbs
16 | // 11. Button
17 | // 12. Button Group
18 | // 13. Callout
19 | // 14. Card
20 | // 15. Close Button
21 | // 16. Drilldown
22 | // 17. Dropdown
23 | // 18. Dropdown Menu
24 | // 19. Flexbox Utilities
25 | // 20. Forms
26 | // 21. Label
27 | // 22. Media Object
28 | // 23. Menu
29 | // 24. Meter
30 | // 25. Off-canvas
31 | // 26. Orbit
32 | // 27. Pagination
33 | // 28. Progress Bar
34 | // 29. Prototype Arrow
35 | // 30. Prototype Border-Box
36 | // 31. Prototype Border-None
37 | // 32. Prototype Bordered
38 | // 33. Prototype Display
39 | // 34. Prototype Font-Styling
40 | // 35. Prototype List-Style-Type
41 | // 36. Prototype Overflow
42 | // 37. Prototype Position
43 | // 38. Prototype Rounded
44 | // 39. Prototype Separator
45 | // 40. Prototype Shadow
46 | // 41. Prototype Sizing
47 | // 42. Prototype Spacing
48 | // 43. Prototype Text-Decoration
49 | // 44. Prototype Text-Transformation
50 | // 45. Prototype Text-Utilities
51 | // 46. Responsive Embed
52 | // 47. Reveal
53 | // 48. Slider
54 | // 49. Switch
55 | // 50. Table
56 | // 51. Tabs
57 | // 52. Thumbnail
58 | // 53. Title Bar
59 | // 54. Tooltip
60 | // 55. Top Bar
61 | // 56. Xy Grid
62 |
63 | @import '../../../node_modules/foundation-sites/scss/util/util';
64 |
65 | // 1. Global
66 | // ---------
67 |
68 | $global-font-size: 100%;
69 | $global-width: rem-calc(1200);
70 | $global-lineheight: 1.5;
71 | $foundation-palette: (
72 | primary: #1779ba,
73 | secondary: #767676,
74 | success: #2da050,
75 | warning: #ffae00,
76 | alert: #cc4b37,
77 | );
78 | $light-gray: #e6e6e6;
79 | $medium-gray: #cacaca;
80 | $dark-gray: #8a8a8a;
81 | $black: #0a0a0a;
82 | $white: #fefefe;
83 | $body-background: $white;
84 | $body-font-color: $black;
85 | $body-font-family: 'Roboto Condensed', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
86 | $body-antialiased: true;
87 | $global-margin: 1rem;
88 | $global-padding: 1rem;
89 | $global-position: 1rem;
90 | $global-weight-normal: normal;
91 | $global-weight-bold: bold;
92 | $global-radius: 3px;
93 | $global-menu-padding: 0.7rem 1rem;
94 | $global-menu-nested-margin: 1rem;
95 | $global-text-direction: ltr;
96 | $global-flexbox: true;
97 | $global-prototype-breakpoints: false;
98 | $global-button-cursor: auto;
99 | $global-color-pick-contrast-tolerance: 0;
100 | $print-transparent-backgrounds: true;
101 |
102 | @include add-foundation-colors;
103 |
104 | // 2. Breakpoints
105 | // --------------
106 |
107 | $breakpoints: (
108 | small: 0,
109 | medium: 640px,
110 | large: 1024px,
111 | xlarge: 1200px,
112 | xxlarge: 1440px,
113 | );
114 | $print-breakpoint: large;
115 | $breakpoint-classes: (small medium large);
116 |
117 | // 3. The Grid
118 | // -----------
119 |
120 | $grid-row-width: $global-width;
121 | $grid-column-count: 12;
122 | $grid-column-gutter: (
123 | small: 20px,
124 | medium: 30px,
125 | );
126 | $grid-column-align-edge: true;
127 | $grid-column-alias: 'columns';
128 | $block-grid-max: 8;
129 |
130 | // 4. Base Typography
131 | // ------------------
132 |
133 | $header-font-family: $body-font-family;
134 | $header-font-weight: $global-weight-normal;
135 | $header-font-style: normal;
136 | $font-family-monospace: Consolas, 'Liberation Mono', Courier, monospace;
137 | $header-color: inherit;
138 | $header-lineheight: 1.4;
139 | $header-margin-bottom: 0.5rem;
140 | $header-styles: (
141 | small: (
142 | 'h1': ('font-size': 24),
143 | 'h2': ('font-size': 20),
144 | 'h3': ('font-size': 19),
145 | 'h4': ('font-size': 18),
146 | 'h5': ('font-size': 17),
147 | 'h6': ('font-size': 16),
148 | ),
149 | medium: (
150 | 'h1': ('font-size': 48),
151 | 'h2': ('font-size': 40),
152 | 'h3': ('font-size': 31),
153 | 'h4': ('font-size': 25),
154 | 'h5': ('font-size': 20),
155 | 'h6': ('font-size': 16),
156 | ),
157 | );
158 | $header-text-rendering: optimizeLegibility;
159 | $small-font-size: 80%;
160 | $header-small-font-color: $medium-gray;
161 | $paragraph-lineheight: 1.6;
162 | $paragraph-margin-bottom: 1rem;
163 | $paragraph-text-rendering: optimizeLegibility;
164 | $code-color: $black;
165 | $code-font-family: $font-family-monospace;
166 | $code-font-weight: $global-weight-normal;
167 | $code-background: $light-gray;
168 | $code-border: 1px solid $medium-gray;
169 | $code-padding: rem-calc(2 5 1);
170 | $anchor-color: $primary-color;
171 | $anchor-color-hover: scale-color($anchor-color, $lightness: -14%);
172 | $anchor-text-decoration: none;
173 | $anchor-text-decoration-hover: none;
174 | $hr-width: $global-width;
175 | $hr-border: 1px solid $medium-gray;
176 | $hr-margin: rem-calc(20) auto;
177 | $list-lineheight: $paragraph-lineheight;
178 | $list-margin-bottom: $paragraph-margin-bottom;
179 | $list-style-type: disc;
180 | $list-style-position: outside;
181 | $list-side-margin: 1.25rem;
182 | $list-nested-side-margin: 1.25rem;
183 | $defnlist-margin-bottom: 1rem;
184 | $defnlist-term-weight: $global-weight-bold;
185 | $defnlist-term-margin-bottom: 0.3rem;
186 | $blockquote-color: $dark-gray;
187 | $blockquote-padding: rem-calc(9 20 0 19);
188 | $blockquote-border: 1px solid $medium-gray;
189 | $cite-font-size: rem-calc(13);
190 | $cite-color: $dark-gray;
191 | $cite-pseudo-content: '\2014 \0020';
192 | $keystroke-font: $font-family-monospace;
193 | $keystroke-color: $black;
194 | $keystroke-background: $light-gray;
195 | $keystroke-padding: rem-calc(2 4 0);
196 | $keystroke-radius: $global-radius;
197 | $abbr-underline: 1px dotted $black;
198 |
199 | // 5. Typography Helpers
200 | // ---------------------
201 |
202 | $lead-font-size: $global-font-size * 1.25;
203 | $lead-lineheight: 1.6;
204 | $subheader-lineheight: 1.4;
205 | $subheader-color: $dark-gray;
206 | $subheader-font-weight: $global-weight-normal;
207 | $subheader-margin-top: 0.2rem;
208 | $subheader-margin-bottom: 0.5rem;
209 | $stat-font-size: 2.5rem;
210 |
211 | // 6. Abide
212 | // --------
213 |
214 | $abide-inputs: true;
215 | $abide-labels: true;
216 | $input-background-invalid: get-color(alert);
217 | $form-label-color-invalid: get-color(alert);
218 | $input-error-color: get-color(alert);
219 | $input-error-font-size: rem-calc(12);
220 | $input-error-font-weight: $global-weight-bold;
221 |
222 | // 7. Accordion
223 | // ------------
224 |
225 | $accordion-background: $white;
226 | $accordion-plusminus: true;
227 | $accordion-title-font-size: rem-calc(12);
228 | $accordion-item-color: $primary-color;
229 | $accordion-item-background-hover: $light-gray;
230 | $accordion-item-padding: 1.25rem 1rem;
231 | $accordion-content-background: $white;
232 | $accordion-content-border: 1px solid $light-gray;
233 | $accordion-content-color: $body-font-color;
234 | $accordion-content-padding: 1rem;
235 |
236 | // 8. Accordion Menu
237 | // -----------------
238 |
239 | $accordionmenu-padding: $global-menu-padding;
240 | $accordionmenu-nested-margin: $global-menu-nested-margin;
241 | $accordionmenu-submenu-padding: $accordionmenu-padding;
242 | $accordionmenu-arrows: true;
243 | $accordionmenu-arrow-color: $primary-color;
244 | $accordionmenu-item-background: null;
245 | $accordionmenu-border: null;
246 | $accordionmenu-submenu-toggle-background: null;
247 | $accordion-submenu-toggle-border: $accordionmenu-border;
248 | $accordionmenu-submenu-toggle-width: 40px;
249 | $accordionmenu-submenu-toggle-height: $accordionmenu-submenu-toggle-width;
250 | $accordionmenu-arrow-size: 6px;
251 |
252 | // 9. Badge
253 | // --------
254 |
255 | $badge-background: $primary-color;
256 | $badge-color: $white;
257 | $badge-color-alt: $black;
258 | $badge-palette: $foundation-palette;
259 | $badge-padding: 0.3em;
260 | $badge-minwidth: 2.1em;
261 | $badge-font-size: 0.6rem;
262 |
263 | // 10. Breadcrumbs
264 | // ---------------
265 |
266 | $breadcrumbs-margin: 0 0 $global-margin 0;
267 | $breadcrumbs-item-font-size: rem-calc(11);
268 | $breadcrumbs-item-color: $primary-color;
269 | $breadcrumbs-item-color-current: $black;
270 | $breadcrumbs-item-color-disabled: $medium-gray;
271 | $breadcrumbs-item-margin: 0.75rem;
272 | $breadcrumbs-item-uppercase: true;
273 | $breadcrumbs-item-separator: true;
274 | $breadcrumbs-item-separator-item: '/';
275 | $breadcrumbs-item-separator-item-rtl: '\\';
276 | $breadcrumbs-item-separator-color: $medium-gray;
277 |
278 | // 11. Button
279 | // ----------
280 |
281 | $button-font-family: inherit;
282 | $button-padding: 0.85em 1em;
283 | $button-margin: 0 0 $global-margin 0;
284 | $button-fill: solid;
285 | $button-background: $primary-color;
286 | $button-background-hover: scale-color($button-background, $lightness: -15%);
287 | $button-color: $white;
288 | $button-color-alt: $white;
289 | $button-radius: $global-radius;
290 | $button-hollow-border-width: 1px;
291 | $button-sizes: (
292 | tiny: 0.6rem,
293 | small: 0.75rem,
294 | default: 0.9rem,
295 | large: 1.25rem,
296 | );
297 | $button-palette: $foundation-palette;
298 | $button-opacity-disabled: 0.25;
299 | $button-background-hover-lightness: -20%;
300 | $button-hollow-hover-lightness: -50%;
301 | $button-transition: background-color 0.25s ease-out, color 0.25s ease-out;
302 | $button-responsive-expanded: false;
303 |
304 | // 12. Button Group
305 | // ----------------
306 |
307 | $buttongroup-margin: 1rem;
308 | $buttongroup-spacing: 1px;
309 | $buttongroup-child-selector: '.button';
310 | $buttongroup-expand-max: 6;
311 | $buttongroup-radius-on-each: false;
312 |
313 | // 13. Callout
314 | // -----------
315 |
316 | $callout-background: $white;
317 | $callout-background-fade: 85%;
318 | $callout-border: 1px solid rgba($black, 0.25);
319 | $callout-margin: 0 0 1rem 0;
320 | $callout-padding: 1rem;
321 | $callout-font-color: $body-font-color;
322 | $callout-font-color-alt: $body-background;
323 | $callout-radius: $global-radius;
324 | $callout-link-tint: 30%;
325 |
326 | // 14. Card
327 | // --------
328 |
329 | $card-background: $white;
330 | $card-font-color: $body-font-color;
331 | $card-divider-background: $light-gray;
332 | $card-border: 1px solid $light-gray;
333 | $card-shadow: none;
334 | $card-border-radius: $global-radius;
335 | $card-padding: $global-padding;
336 | $card-margin-bottom: $global-margin;
337 |
338 | // 15. Close Button
339 | // ----------------
340 |
341 | $closebutton-position: right top;
342 | $closebutton-offset-horizontal: (
343 | small: 0.66rem,
344 | medium: 1rem,
345 | );
346 | $closebutton-offset-vertical: (
347 | small: 0.33em,
348 | medium: 0.5rem,
349 | );
350 | $closebutton-size: (
351 | small: 1.5em,
352 | medium: 2em,
353 | );
354 | $closebutton-lineheight: 1;
355 | $closebutton-color: $dark-gray;
356 | $closebutton-color-hover: $black;
357 |
358 | // 16. Drilldown
359 | // -------------
360 |
361 | $drilldown-transition: transform 0.15s linear;
362 | $drilldown-arrows: true;
363 | $drilldown-padding: $global-menu-padding;
364 | $drilldown-nested-margin: 0;
365 | $drilldown-background: $white;
366 | $drilldown-submenu-padding: $drilldown-padding;
367 | $drilldown-submenu-background: $white;
368 | $drilldown-arrow-color: $primary-color;
369 | $drilldown-arrow-size: 6px;
370 |
371 | // 17. Dropdown
372 | // ------------
373 |
374 | $dropdown-padding: 1rem;
375 | $dropdown-background: $body-background;
376 | $dropdown-border: 1px solid $medium-gray;
377 | $dropdown-font-size: 1rem;
378 | $dropdown-width: 300px;
379 | $dropdown-radius: $global-radius;
380 | $dropdown-sizes: (
381 | tiny: 100px,
382 | small: 200px,
383 | large: 400px,
384 | );
385 |
386 | // 18. Dropdown Menu
387 | // -----------------
388 |
389 | $dropdownmenu-arrows: true;
390 | $dropdownmenu-arrow-color: $anchor-color;
391 | $dropdownmenu-arrow-size: 6px;
392 | $dropdownmenu-arrow-padding: 1.5rem;
393 | $dropdownmenu-min-width: 200px;
394 | $dropdownmenu-background: $white;
395 | $dropdownmenu-submenu-background: $dropdownmenu-background;
396 | $dropdownmenu-padding: $global-menu-padding;
397 | $dropdownmenu-nested-margin: 0;
398 | $dropdownmenu-submenu-padding: $dropdownmenu-padding;
399 | $dropdownmenu-border: 1px solid $medium-gray;
400 | $dropdown-menu-item-color-active: get-color(primary);
401 | $dropdown-menu-item-background-active: transparent;
402 |
403 | // 19. Flexbox Utilities
404 | // ---------------------
405 |
406 | $flex-source-ordering-count: 6;
407 | $flexbox-responsive-breakpoints: true;
408 |
409 | // 20. Forms
410 | // ---------
411 |
412 | $fieldset-border: 1px solid $medium-gray;
413 | $fieldset-padding: rem-calc(20);
414 | $fieldset-margin: rem-calc(18 0);
415 | $legend-padding: rem-calc(0 3);
416 | $form-spacing: rem-calc(16);
417 | $helptext-color: $black;
418 | $helptext-font-size: rem-calc(13);
419 | $helptext-font-style: italic;
420 | $input-prefix-color: $black;
421 | $input-prefix-background: $light-gray;
422 | $input-prefix-border: 1px solid $medium-gray;
423 | $input-prefix-padding: 1rem;
424 | $form-label-color: $black;
425 | $form-label-font-size: rem-calc(14);
426 | $form-label-font-weight: $global-weight-normal;
427 | $form-label-line-height: 1.8;
428 | $select-background: $white;
429 | $select-triangle-color: $dark-gray;
430 | $select-radius: $global-radius;
431 | $input-color: $black;
432 | $input-placeholder-color: $medium-gray;
433 | $input-font-family: inherit;
434 | $input-font-size: rem-calc(16);
435 | $input-font-weight: $global-weight-normal;
436 | $input-line-height: $global-lineheight;
437 | $input-background: $white;
438 | $input-background-focus: $white;
439 | $input-background-disabled: $light-gray;
440 | $input-border: 1px solid $medium-gray;
441 | $input-border-focus: 1px solid $dark-gray;
442 | $input-padding: $form-spacing / 2;
443 | $input-shadow: inset 0 1px 2px rgba($black, 0.1);
444 | $input-shadow-focus: 0 0 5px $medium-gray;
445 | $input-cursor-disabled: not-allowed;
446 | $input-transition: box-shadow 0.5s, border-color 0.25s ease-in-out;
447 | $input-number-spinners: true;
448 | $input-radius: $global-radius;
449 | $form-button-radius: $global-radius;
450 |
451 | // 21. Label
452 | // ---------
453 |
454 | $label-background: $primary-color;
455 | $label-color: $white;
456 | $label-color-alt: $black;
457 | $label-palette: $foundation-palette;
458 | $label-font-size: 0.8rem;
459 | $label-padding: 0.33333rem 0.5rem;
460 | $label-radius: $global-radius;
461 |
462 | // 22. Media Object
463 | // ----------------
464 |
465 | $mediaobject-margin-bottom: $global-margin;
466 | $mediaobject-section-padding: $global-padding;
467 | $mediaobject-image-width-stacked: 100%;
468 |
469 | // 23. Menu
470 | // --------
471 |
472 | $menu-margin: 0;
473 | $menu-nested-margin: $global-menu-nested-margin;
474 | $menu-items-padding: $global-menu-padding;
475 | $menu-simple-margin: 1rem;
476 | $menu-item-color-active: $white;
477 | $menu-item-background-active: get-color(primary);
478 | $menu-icon-spacing: 0.25rem;
479 | $menu-item-background-hover: $light-gray;
480 | $menu-state-back-compat: true;
481 | $menu-centered-back-compat: true;
482 | $menu-icons-back-compat: true;
483 |
484 | // 24. Meter
485 | // ---------
486 |
487 | $meter-height: 1rem;
488 | $meter-radius: $global-radius;
489 | $meter-background: $medium-gray;
490 | $meter-fill-good: $success-color;
491 | $meter-fill-medium: $warning-color;
492 | $meter-fill-bad: $alert-color;
493 |
494 | // 25. Off-canvas
495 | // --------------
496 |
497 | $offcanvas-sizes: (
498 | small: 250px,
499 | );
500 | $offcanvas-vertical-sizes: (
501 | small: 250px,
502 | );
503 | $offcanvas-background: $light-gray;
504 | $offcanvas-shadow: 0 0 10px rgba($black, 0.7);
505 | $offcanvas-inner-shadow-size: 20px;
506 | $offcanvas-inner-shadow-color: rgba($black, 0.25);
507 | $offcanvas-overlay-zindex: 11;
508 | $offcanvas-push-zindex: 12;
509 | $offcanvas-overlap-zindex: 13;
510 | $offcanvas-reveal-zindex: 12;
511 | $offcanvas-transition-length: 0.5s;
512 | $offcanvas-transition-timing: ease;
513 | $offcanvas-fixed-reveal: true;
514 | $offcanvas-exit-background: rgba($white, 0.25);
515 | $maincontent-class: 'off-canvas-content';
516 |
517 | // 26. Orbit
518 | // ---------
519 |
520 | $orbit-bullet-background: $medium-gray;
521 | $orbit-bullet-background-active: $dark-gray;
522 | $orbit-bullet-diameter: 1.2rem;
523 | $orbit-bullet-margin: 0.1rem;
524 | $orbit-bullet-margin-top: 0.8rem;
525 | $orbit-bullet-margin-bottom: 0.8rem;
526 | $orbit-caption-background: rgba($black, 0.5);
527 | $orbit-caption-padding: 1rem;
528 | $orbit-control-background-hover: rgba($black, 0.5);
529 | $orbit-control-padding: 1rem;
530 | $orbit-control-zindex: 10;
531 |
532 | // 27. Pagination
533 | // --------------
534 |
535 | $pagination-font-size: rem-calc(14);
536 | $pagination-margin-bottom: $global-margin;
537 | $pagination-item-color: $black;
538 | $pagination-item-padding: rem-calc(3 10);
539 | $pagination-item-spacing: rem-calc(1);
540 | $pagination-radius: $global-radius;
541 | $pagination-item-background-hover: $light-gray;
542 | $pagination-item-background-current: $primary-color;
543 | $pagination-item-color-current: $white;
544 | $pagination-item-color-disabled: $medium-gray;
545 | $pagination-ellipsis-color: $black;
546 | $pagination-mobile-items: false;
547 | $pagination-mobile-current-item: false;
548 | $pagination-arrows: true;
549 |
550 | // 28. Progress Bar
551 | // ----------------
552 |
553 | $progress-height: 1rem;
554 | $progress-background: $medium-gray;
555 | $progress-margin-bottom: $global-margin;
556 | $progress-meter-background: $primary-color;
557 | $progress-radius: $global-radius;
558 |
559 | // 29. Prototype Arrow
560 | // -------------------
561 |
562 | $prototype-arrow-directions: (
563 | down,
564 | up,
565 | right,
566 | left
567 | );
568 | $prototype-arrow-size: 0.4375rem;
569 | $prototype-arrow-color: $black;
570 |
571 | // 30. Prototype Border-Box
572 | // ------------------------
573 |
574 | $prototype-border-box-breakpoints: $global-prototype-breakpoints;
575 |
576 | // 31. Prototype Border-None
577 | // -------------------------
578 |
579 | $prototype-border-none-breakpoints: $global-prototype-breakpoints;
580 |
581 | // 32. Prototype Bordered
582 | // ----------------------
583 |
584 | $prototype-bordered-breakpoints: $global-prototype-breakpoints;
585 | $prototype-border-width: rem-calc(1);
586 | $prototype-border-type: solid;
587 | $prototype-border-color: $medium-gray;
588 |
589 | // 33. Prototype Display
590 | // ---------------------
591 |
592 | $prototype-display-breakpoints: $global-prototype-breakpoints;
593 | $prototype-display: (
594 | inline,
595 | inline-block,
596 | block,
597 | table,
598 | table-cell
599 | );
600 |
601 | // 34. Prototype Font-Styling
602 | // --------------------------
603 |
604 | $prototype-font-breakpoints: $global-prototype-breakpoints;
605 | $prototype-wide-letter-spacing: rem-calc(4);
606 | $prototype-font-normal: $global-weight-normal;
607 | $prototype-font-bold: $global-weight-bold;
608 |
609 | // 35. Prototype List-Style-Type
610 | // -----------------------------
611 |
612 | $prototype-list-breakpoints: $global-prototype-breakpoints;
613 | $prototype-style-type-unordered: (
614 | disc,
615 | circle,
616 | square
617 | );
618 | $prototype-style-type-ordered: (
619 | decimal,
620 | lower-alpha,
621 | lower-latin,
622 | lower-roman,
623 | upper-alpha,
624 | upper-latin,
625 | upper-roman
626 | );
627 |
628 | // 36. Prototype Overflow
629 | // ----------------------
630 |
631 | $prototype-overflow-breakpoints: $global-prototype-breakpoints;
632 | $prototype-overflow: (
633 | visible,
634 | hidden,
635 | scroll
636 | );
637 |
638 | // 37. Prototype Position
639 | // ----------------------
640 |
641 | $prototype-position-breakpoints: $global-prototype-breakpoints;
642 | $prototype-position: (
643 | static,
644 | relative,
645 | absolute,
646 | fixed
647 | );
648 | $prototype-position-z-index: 975;
649 |
650 | // 38. Prototype Rounded
651 | // ---------------------
652 |
653 | $prototype-rounded-breakpoints: $global-prototype-breakpoints;
654 | $prototype-border-radius: rem-calc(3);
655 |
656 | // 39. Prototype Separator
657 | // -----------------------
658 |
659 | $prototype-separator-breakpoints: $global-prototype-breakpoints;
660 | $prototype-separator-align: center;
661 | $prototype-separator-height: rem-calc(2);
662 | $prototype-separator-width: 3rem;
663 | $prototype-separator-background: $primary-color;
664 | $prototype-separator-margin-top: $global-margin;
665 |
666 | // 40. Prototype Shadow
667 | // --------------------
668 |
669 | $prototype-shadow-breakpoints: $global-prototype-breakpoints;
670 | $prototype-box-shadow: 0 2px 5px 0 rgba(0,0,0,.16),
671 | 0 2px 10px 0 rgba(0,0,0,.12);
672 |
673 | // 41. Prototype Sizing
674 | // --------------------
675 |
676 | $prototype-sizing-breakpoints: $global-prototype-breakpoints;
677 | $prototype-sizing: (
678 | width,
679 | height
680 | );
681 | $prototype-sizes: (
682 | 25: 25%,
683 | 50: 50%,
684 | 75: 75%,
685 | 100: 100%
686 | );
687 |
688 | // 42. Prototype Spacing
689 | // ---------------------
690 |
691 | $prototype-spacing-breakpoints: $global-prototype-breakpoints;
692 | $prototype-spacers-count: 3;
693 |
694 | // 43. Prototype Text-Decoration
695 | // -----------------------------
696 |
697 | $prototype-decoration-breakpoints: $global-prototype-breakpoints;
698 | $prototype-text-decoration: (
699 | overline,
700 | underline,
701 | line-through,
702 | );
703 |
704 | // 44. Prototype Text-Transformation
705 | // ---------------------------------
706 |
707 | $prototype-transformation-breakpoints: $global-prototype-breakpoints;
708 | $prototype-text-transformation: (
709 | lowercase,
710 | uppercase,
711 | capitalize
712 | );
713 |
714 | // 45. Prototype Text-Utilities
715 | // ----------------------------
716 |
717 | $prototype-utilities-breakpoints: $global-prototype-breakpoints;
718 | $prototype-text-overflow: ellipsis;
719 |
720 | // 46. Responsive Embed
721 | // --------------------
722 |
723 | $responsive-embed-margin-bottom: rem-calc(16);
724 | $responsive-embed-ratios: (
725 | default: 4 by 3,
726 | widescreen: 16 by 9,
727 | );
728 |
729 | // 47. Reveal
730 | // ----------
731 |
732 | $reveal-background: $white;
733 | $reveal-width: 600px;
734 | $reveal-max-width: $global-width;
735 | $reveal-padding: $global-padding;
736 | $reveal-border: 1px solid $medium-gray;
737 | $reveal-radius: $global-radius;
738 | $reveal-zindex: 1005;
739 | $reveal-overlay-background: rgba($black, 0.45);
740 |
741 | // 48. Slider
742 | // ----------
743 |
744 | $slider-width-vertical: 0.5rem;
745 | $slider-transition: all 0.2s ease-in-out;
746 | $slider-height: 0.5rem;
747 | $slider-background: $light-gray;
748 | $slider-fill-background: $medium-gray;
749 | $slider-handle-height: 1.4rem;
750 | $slider-handle-width: 1.4rem;
751 | $slider-handle-background: $primary-color;
752 | $slider-opacity-disabled: 0.25;
753 | $slider-radius: $global-radius;
754 |
755 | // 49. Switch
756 | // ----------
757 |
758 | $switch-background: $medium-gray;
759 | $switch-background-active: $primary-color;
760 | $switch-height: 2rem;
761 | $switch-height-tiny: 1.5rem;
762 | $switch-height-small: 1.75rem;
763 | $switch-height-large: 2.5rem;
764 | $switch-radius: $global-radius;
765 | $switch-margin: $global-margin;
766 | $switch-paddle-background: $white;
767 | $switch-paddle-offset: 0.25rem;
768 | $switch-paddle-radius: $global-radius;
769 | $switch-paddle-transition: all 0.25s ease-out;
770 |
771 | // 50. Table
772 | // ---------
773 |
774 | $table-background: $white;
775 | $table-color-scale: 5%;
776 | $table-border: 1px solid smart-scale($table-background, $table-color-scale);
777 | $table-padding: rem-calc(8 10 10);
778 | $table-hover-scale: 2%;
779 | $table-row-hover: darken($table-background, $table-hover-scale);
780 | $table-row-stripe-hover: darken($table-background, $table-color-scale + $table-hover-scale);
781 | $table-is-striped: true;
782 | $table-striped-background: smart-scale($table-background, $table-color-scale);
783 | $table-stripe: even;
784 | $table-head-background: smart-scale($table-background, $table-color-scale / 2);
785 | $table-head-row-hover: darken($table-head-background, $table-hover-scale);
786 | $table-foot-background: smart-scale($table-background, $table-color-scale);
787 | $table-foot-row-hover: darken($table-foot-background, $table-hover-scale);
788 | $table-head-font-color: $body-font-color;
789 | $table-foot-font-color: $body-font-color;
790 | $show-header-for-stacked: false;
791 | $table-stack-breakpoint: medium;
792 |
793 | // 51. Tabs
794 | // --------
795 |
796 | $tab-margin: 0;
797 | $tab-background: $white;
798 | $tab-color: $primary-color;
799 | $tab-background-active: $light-gray;
800 | $tab-active-color: $primary-color;
801 | $tab-item-font-size: rem-calc(12);
802 | $tab-item-background-hover: $white;
803 | $tab-item-padding: 1.25rem 1.5rem;
804 | $tab-expand-max: 6;
805 | $tab-content-background: $white;
806 | $tab-content-border: $light-gray;
807 | $tab-content-color: $body-font-color;
808 | $tab-content-padding: 1rem;
809 |
810 | // 52. Thumbnail
811 | // -------------
812 |
813 | $thumbnail-border: solid 4px $white;
814 | $thumbnail-margin-bottom: $global-margin;
815 | $thumbnail-shadow: 0 0 0 1px rgba($black, 0.2);
816 | $thumbnail-shadow-hover: 0 0 6px 1px rgba($primary-color, 0.5);
817 | $thumbnail-transition: box-shadow 200ms ease-out;
818 | $thumbnail-radius: $global-radius;
819 |
820 | // 53. Title Bar
821 | // -------------
822 |
823 | $titlebar-background: $black;
824 | $titlebar-color: $white;
825 | $titlebar-padding: 0.5rem;
826 | $titlebar-text-font-weight: bold;
827 | $titlebar-icon-color: $white;
828 | $titlebar-icon-color-hover: $medium-gray;
829 | $titlebar-icon-spacing: 0.25rem;
830 |
831 | // 54. Tooltip
832 | // -----------
833 |
834 | $has-tip-cursor: help;
835 | $has-tip-font-weight: $global-weight-bold;
836 | $has-tip-border-bottom: dotted 1px $dark-gray;
837 | $tooltip-background-color: $black;
838 | $tooltip-color: $white;
839 | $tooltip-padding: 0.75rem;
840 | $tooltip-max-width: 10rem;
841 | $tooltip-font-size: $small-font-size;
842 | $tooltip-pip-width: 0.75rem;
843 | $tooltip-pip-height: $tooltip-pip-width * 0.866;
844 | $tooltip-radius: $global-radius;
845 |
846 | // 55. Top Bar
847 | // -----------
848 |
849 | $topbar-padding: 0.5rem;
850 | $topbar-background: $light-gray;
851 | $topbar-submenu-background: $topbar-background;
852 | $topbar-title-spacing: 0.5rem 1rem 0.5rem 0;
853 | $topbar-input-width: 200px;
854 | $topbar-unstack-breakpoint: medium;
855 |
856 | // 56. Xy Grid
857 | // -----------
858 |
859 | $xy-grid: true;
860 | $grid-container: $global-width;
861 | $grid-columns: 12;
862 | $grid-margin-gutters: (
863 | small: 20px,
864 | medium: 30px
865 | );
866 | $grid-padding-gutters: $grid-margin-gutters;
867 | $grid-container-padding: $grid-padding-gutters;
868 | $grid-container-max: $global-width;
869 | $xy-block-grid-max: 8;
870 |
871 |
--------------------------------------------------------------------------------