Skip to content
This repository was archived by the owner on Apr 1, 2021. It is now read-only.

Commit c236f89

Browse files
committed
Merge branch 'release/1.0.0'
2 parents 18a7ac5 + 25d3bd8 commit c236f89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+14535
-8655
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ PUSHER_APP_CLUSTER=mt1
3838
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
3939
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
4040

41+
LARAVEL_PAGE_SPEED_ENABLE=true
42+
4143
# API_URL=
4244
# API_USERNAME=
4345
# API_PASSWORD=

.env.travis

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ PUSHER_APP_CLUSTER=mt1
3838
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
3939
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
4040

41+
LARAVEL_PAGE_SPEED_ENABLE=true
42+
4143
# API_URL=
4244
# API_USERNAME=
4345
# API_PASSWORD=

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"browser": true
77
},
88
"parserOptions": {
9-
"ecmaVersion": 8
9+
"parser": "babel-eslint"
1010
},
1111
"globals": {
1212
"$": true,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ npm-debug.log
1818
yarn-error.log
1919
.env
2020
.DS_Store
21+
.php_cs.cache

.php_cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude('vendor')
5+
->in(__DIR__)
6+
;
7+
8+
return PhpCsFixer\Config::create()
9+
->setRules([
10+
'@PSR2' => true,
11+
'binary_operator_spaces' => [
12+
'default' => 'align_single_space',
13+
],
14+
])
15+
->setFinder($finder)
16+
;

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ COPY package-lock.json /var/www
88
RUN npm ci
99

1010
COPY . /var/www
11+
RUN npm run lint-js
12+
RUN npm run lint-css
1113
RUN npm run prod
1214
RUN rm -rf /var/www/node_modules/
1315

@@ -57,12 +59,11 @@ RUN if [ ${FORCE_HTTPS} = true ]; then \
5759
;fi
5860

5961
COPY --from=compiler /var/www /var/www
62+
RUN php php-cs-fixer fix --dry-run
6063
RUN composer dump-autoload --no-dev --optimize
6164
RUN grep -q "APP_KEY=" .env || echo "APP_KEY=" >> .env
6265
RUN php artisan key:generate \
63-
&& php artisan config:cache \
64-
&& php artisan route:cache \
65-
&& php artisan view:cache
66+
&& php artisan optimize
6667
RUN chown -R www-data:www-data /var/www
6768
RUN rm -rf /var/www/html/ /var/www/deploy/
6869

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Notification using [Vue-SweatAlert2][vue-sweatalert2] and [Vue-Notification][vue-notification]
1515
* Loading spinner with [Vue Loading Spinner][vue-loading-spinner]
1616
* Quick deployment with [Docker Compose][docker-compose]
17+
* [Laravel Page Speed][laravel-page-speed], Simple package to minify HTML output on demand which results in a 35%+ optimization
1718

1819
## Requirement
1920
* **PHP** >= 7.1.3
@@ -85,15 +86,15 @@ npm run watch
8586
## or using Hot Module Replacement
8687
npm run hot
8788
```
88-
* Open browser, goto `http://localhost:8888`
89+
* Open browser, goto [http://localhost:8888](link)
8990

9091
### For Production
9192
* Create and start Container
9293
```
9394
docker-compose up -d prod
9495
```
9596

96-
* Open browser, goto [http://localhost:88](http://localhost:88)
97+
* Open browser, goto [http://localhost:88](link)
9798

9899
## License
99100
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
@@ -112,3 +113,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
112113
[docker-compose]: https://docs.docker.com/compose/
113114
[offline-plugin]: https://github.com/NekR/offline-plugin
114115
[workbox]: https://developers.google.com/web/tools/workbox/
116+
[laravel-page-speed]: https://github.com/renatomarinho/laravel-page-speed

app/Http/Controllers/AppController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
class AppController extends Controller
88
{
9-
public function index (Request $request) {
9+
public function index(Request $request)
10+
{
1011
return view('app');
1112
}
1213
}

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function __construct()
4949
protected function validator(array $data)
5050
{
5151
return Validator::make($data, [
52-
'name' => 'required|string|max:255',
53-
'email' => 'required|string|email|max:255|unique:users',
52+
'name' => 'required|string|max:255',
53+
'email' => 'required|string|email|max:255|unique:users',
5454
'password' => 'required|string|min:6|confirmed',
5555
]);
5656
}
@@ -64,8 +64,8 @@ protected function validator(array $data)
6464
protected function create(array $data)
6565
{
6666
return User::create([
67-
'name' => $data['name'],
68-
'email' => $data['email'],
67+
'name' => $data['name'],
68+
'email' => $data['email'],
6969
'password' => Hash::make($data['password']),
7070
]);
7171
}

app/Http/Kernel.php

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Kernel extends HttpKernel
2727
* @var array
2828
*/
2929
protected $middlewareGroups = [
30-
'web' => [
30+
'web' => [
3131
\App\Http\Middleware\EncryptCookies::class,
3232
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
3333
\Illuminate\Session\Middleware\StartSession::class,
@@ -37,10 +37,21 @@ class Kernel extends HttpKernel
3737
\Illuminate\Routing\Middleware\SubstituteBindings::class,
3838
],
3939

40-
'api' => [
40+
'api' => [
4141
'throttle:60,1',
4242
'bindings',
4343
],
44+
45+
'speed' => [
46+
// Laravel Page Speed
47+
\RenatoMarinho\LaravelPageSpeed\Middleware\InlineCss::class,
48+
\RenatoMarinho\LaravelPageSpeed\Middleware\ElideAttributes::class,
49+
\RenatoMarinho\LaravelPageSpeed\Middleware\InsertDNSPrefetch::class,
50+
\RenatoMarinho\LaravelPageSpeed\Middleware\RemoveComments::class,
51+
\RenatoMarinho\LaravelPageSpeed\Middleware\TrimUrls::class,
52+
\RenatoMarinho\LaravelPageSpeed\Middleware\RemoveQuotes::class,
53+
\RenatoMarinho\LaravelPageSpeed\Middleware\CollapseWhitespace::class,
54+
],
4455
];
4556

4657
/**
@@ -52,13 +63,13 @@ class Kernel extends HttpKernel
5263
*/
5364
protected $routeMiddleware = [
5465
// 'auth' => \App\Http\Middleware\Authenticate::class,
55-
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
56-
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
57-
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
66+
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
67+
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
68+
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
5869
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
59-
'can' => \Illuminate\Auth\Middleware\Authorize::class,
60-
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
61-
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
62-
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
70+
'can' => \Illuminate\Auth\Middleware\Authorize::class,
71+
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
72+
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
73+
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
6374
];
6475
}

0 commit comments

Comments
 (0)