Skip to content

Commit b498d89

Browse files
committed
laravel vue server driven spa
added tailwind
0 parents  commit b498d89

File tree

176 files changed

+25372
-0
lines changed

Some content is hidden

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

176 files changed

+25372
-0
lines changed

.babelrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env"
4+
],
5+
"plugins": [
6+
"@babel/plugin-syntax-dynamic-import"
7+
]
8+
}

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
[*.{vue,js,json,html,scss,blade.php,yml}]
15+
indent_size = 2

.env.example

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
APP_NAME="Laravel Vue Server Driven Spa"
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_LOG_LEVEL=debug
6+
APP_URL=http://localhost
7+
8+
LOG_CHANNEL=stack
9+
10+
DB_CONNECTION=mysql
11+
DB_HOST=127.0.0.1
12+
DB_PORT=3306
13+
DB_DATABASE=homestead
14+
DB_USERNAME=homestead
15+
DB_PASSWORD=secret
16+
17+
BROADCAST_DRIVER=log
18+
CACHE_DRIVER=file
19+
QUEUE_CONNECTION=sync
20+
SESSION_DRIVER=file
21+
SESSION_LIFETIME=120
22+
23+
REDIS_HOST=127.0.0.1
24+
REDIS_PASSWORD=null
25+
REDIS_PORT=6379
26+
27+
MAIL_MAILER=smtp
28+
MAIL_HOST=smtp.mailtrap.io
29+
MAIL_PORT=2525
30+
MAIL_USERNAME=null
31+
MAIL_PASSWORD=null
32+
MAIL_ENCRYPTION=null
33+
34+
AWS_ACCESS_KEY_ID=
35+
AWS_SECRET_ACCESS_KEY=
36+
AWS_DEFAULT_REGION=us-east-1
37+
AWS_BUCKET=
38+
39+
PUSHER_APP_ID=
40+
PUSHER_APP_KEY=
41+
PUSHER_APP_SECRET=
42+
PUSHER_APP_CLUSTER=mt1
43+
44+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
45+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
46+
47+
JWT_TTL=1440
48+
JWT_SECRET=

.eslintrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"root": true,
3+
"parserOptions": {
4+
"parser": "babel-eslint",
5+
"ecmaVersion": 2017,
6+
"sourceType": "module"
7+
},
8+
"extends": [
9+
"plugin:vue/recommended",
10+
"standard"
11+
],
12+
"rules": {
13+
"vue/max-attributes-per-line": "off"
14+
}
15+
}

.gitattributes

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore
6+
README.md export-ignore
7+
.travis.yml export-ignore
8+
.env.dusk.local export-ignore
9+
.env.dusk.testing export-ignore

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/node_modules
2+
/.idea
3+
/public/hot
4+
/public/storage
5+
/storage/*.key
6+
/vendor
7+
/public/dist
8+
/public/build
9+
/public/mix-manifest.json
10+
.env
11+
.phpunit.result.cache
12+
Homestead.json
13+
Homestead.yaml
14+
npm-debug.log
15+
yarn-error.log
16+
phpunit.dusk.xml
17+
*.code-workspace

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Cretu Eusebiu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# LARAVEL VUE SERVER DRIVEN SPA
2+
3+
## Features
4+
5+
- Laravel 7
6+
- Vue + VueRouter + Vuex + VueI18n + ESlint
7+
- Pages with dynamic import and custom layouts
8+
- Login, register, email verification and password reset
9+
- Authentication with JWT
10+
- Socialite integration
11+
- Bootstrap 4 + Font Awesome 5
12+
13+
## Installation
14+
15+
- `composer create-project --prefer-dist norbybaru/laravel-vue-server-driven-spa`
16+
- Edit `.env` and set your database connection details
17+
- (When installed via git clone or download, run `php artisan key:generate` and `php artisan jwt:secret`)
18+
- `php artisan migrate`
19+
- `npm install`
20+
21+
## Usage
22+
23+
#### Development
24+
25+
```bash
26+
# build and watch
27+
npm run watch
28+
29+
# serve with hot reloading
30+
npm run hot
31+
```
32+
33+
#### Production
34+
35+
```bash
36+
npm run production
37+
```

app/Console/Kernel.php

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* The Artisan commands provided by your application.
12+
*
13+
* @var array
14+
*/
15+
protected $commands = [
16+
//
17+
];
18+
19+
/**
20+
* Define the application's command schedule.
21+
*
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
* @return void
24+
*/
25+
protected function schedule(Schedule $schedule)
26+
{
27+
// $schedule->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+
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Exception;
6+
7+
class EmailTakenException extends Exception
8+
{
9+
/**
10+
* Render the exception as an HTTP response.
11+
*
12+
* @param \Illuminate\Http\Request $request
13+
* @return \Illuminate\Http\Response
14+
*/
15+
public function render($request)
16+
{
17+
return response()->view('oauth.emailTaken', [], 400);
18+
}
19+
}

app/Exceptions/Handler.php

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Illuminate\Auth\AuthenticationException;
6+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
7+
use Throwable;
8+
9+
class Handler extends ExceptionHandler
10+
{
11+
/**
12+
* A list of the exception types that are not reported.
13+
*
14+
* @var array
15+
*/
16+
protected $dontReport = [
17+
//
18+
];
19+
20+
/**
21+
* A list of the inputs that are never flashed for validation exceptions.
22+
*
23+
* @var array
24+
*/
25+
protected $dontFlash = [
26+
'password',
27+
'password_confirmation',
28+
];
29+
30+
/**
31+
* Report or log an exception.
32+
*
33+
* @param \Throwable $exception
34+
* @return void
35+
*
36+
* @throws \Exception
37+
*/
38+
public function report(Throwable $exception)
39+
{
40+
parent::report($exception);
41+
}
42+
43+
/**
44+
* Render an exception into an HTTP response.
45+
*
46+
* @param \Illuminate\Http\Request $request
47+
* @param \Throwable $exception
48+
* @return \Symfony\Component\HttpFoundation\Response
49+
*
50+
* @throws \Throwable
51+
*/
52+
public function render($request, Throwable $exception)
53+
{
54+
return parent::render($request, $exception);
55+
}
56+
57+
/**
58+
* Convert an authentication exception into a response.
59+
*
60+
* @param \Illuminate\Http\Request $request
61+
* @param \Illuminate\Auth\AuthenticationException $exception
62+
* @return \Illuminate\Http\Response
63+
*/
64+
protected function unauthenticated($request, AuthenticationException $exception)
65+
{
66+
return $request->expectsJson()
67+
? response()->json(['message' => $exception->getMessage()], 401)
68+
: redirect()->guest(url('/login'));
69+
}
70+
}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Illuminate\Validation\ValidationException;
6+
7+
class VerifyEmailException extends ValidationException
8+
{
9+
/**
10+
* @param \App\User $user
11+
* @return static
12+
*/
13+
public static function forUser($user)
14+
{
15+
return static::withMessages([
16+
'email' => [__('You must :linkOpen verify :linkClose your email first.', [
17+
'linkOpen' => '<a href="/email/resend?email='.urlencode($user->email).'">',
18+
'linkClose' => '</a>',
19+
])],
20+
]);
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7+
use Illuminate\Http\Request;
8+
9+
class ForgotPasswordController extends Controller
10+
{
11+
use SendsPasswordResetEmails;
12+
13+
/**
14+
* Create a new controller instance.
15+
*
16+
* @return void
17+
*/
18+
public function __construct()
19+
{
20+
$this->middleware('guest');
21+
}
22+
23+
/**
24+
* Get the response for a successful password reset link.
25+
*
26+
* @param \Illuminate\Http\Request $request
27+
* @param string $response
28+
* @return \Illuminate\Http\RedirectResponse
29+
*/
30+
protected function sendResetLinkResponse(Request $request, $response)
31+
{
32+
return ['status' => trans($response)];
33+
}
34+
35+
/**
36+
* Get the response for a failed password reset link.
37+
*
38+
* @param \Illuminate\Http\Request $request
39+
* @param string $response
40+
* @return \Illuminate\Http\RedirectResponse
41+
*/
42+
protected function sendResetLinkFailedResponse(Request $request, $response)
43+
{
44+
return response()->json(['email' => trans($response)], 400);
45+
}
46+
}

0 commit comments

Comments
 (0)