Skip to content

Commit a1309c1

Browse files
committed
Pre-release: Laravel 7
0 parents  commit a1309c1

Some content is hidden

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

80 files changed

+3075
-0
lines changed

.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+
[*.{yml,yaml}]
15+
indent_size = 2

.env.example

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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=laravel
13+
DB_USERNAME=root
14+
DB_PASSWORD=
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_MAILER=smtp
27+
MAIL_HOST=smtp.mailtrap.io
28+
MAIL_PORT=2525
29+
MAIL_USERNAME=null
30+
MAIL_PASSWORD=null
31+
MAIL_ENCRYPTION=null
32+
MAIL_FROM_ADDRESS=null
33+
MAIL_FROM_NAME="${APP_NAME}"
34+
35+
AWS_ACCESS_KEY_ID=
36+
AWS_SECRET_ACCESS_KEY=
37+
AWS_DEFAULT_REGION=us-east-1
38+
AWS_BUCKET=
39+
40+
PUSHER_APP_ID=
41+
PUSHER_APP_KEY=
42+
PUSHER_APP_SECRET=
43+
PUSHER_APP_CLUSTER=mt1
44+
45+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
46+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/node_modules
2+
/public/hot
3+
/public/storage
4+
/storage/*.key
5+
/vendor
6+
.env
7+
.env.backup
8+
.phpunit.result.cache
9+
Homestead.json
10+
Homestead.yaml
11+
npm-debug.log
12+
yarn-error.log

.styleci.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
php:
2+
preset: laravel
3+
disabled:
4+
- unused_use
5+
finder:
6+
not-name:
7+
- index.php
8+
- server.php
9+
js:
10+
finder:
11+
not-name:
12+
- webpack.mix.js
13+
css: true

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Laravel 7.x for Laravel Shift
2+
3+
This repository contains the latest version of Laravel 7. It is used as a reference by [Laravel Shift - the automated way to upgrade Laravel applications](https://laravelshift.com).
4+
5+
## Laravel Shift
6+
*Laravel Shift* focuses on providing automated and [human services](https://laravelshift.com/human-services) for upgrading and improving your Laravel applications.
7+
8+
Shifts for *Laravel* include:
9+
10+
- [Laravel 5.0 Shift - upgrade from Laravel 4.2 to 5.0](https://laravelshift.com/upgrade-laravel-4.2-to-laravel-5.0)
11+
- [Laravel 5.1 Shift - upgrade from Laravel 5.0 to 5.1](https://laravelshift.com/upgrade-laravel-5.0-to-laravel-5.1)
12+
- [Laravel 5.2 Shift - upgrade from Laravel 5.1 to 5.2](https://laravelshift.com/upgrade-laravel-5.1-to-laravel-5.2)
13+
- [Laravel 5.3 Shift - upgrade from Laravel 5.2 to 5.3](https://laravelshift.com/upgrade-laravel-5.2-to-laravel-5.3)
14+
- [Laravel 5.4 Shift - upgrade from Laravel 5.3 to 5.4](https://laravelshift.com/upgrade-laravel-5.3-to-laravel-5.4)
15+
- [Laravel 5.5 Shift - upgrade from Laravel 5.4 to 5.5](https://laravelshift.com/upgrade-laravel-5.4-to-laravel-5.5)
16+
- [Laravel 5.6 Shift - upgrade from Laravel 5.5 to 5.6](https://laravelshift.com/upgrade-laravel-5.5-to-laravel-5.6)
17+
- [Laravel 5.7 Shift - upgrade from Laravel 5.6 to 5.7](https://laravelshift.com/upgrade-laravel-5.6-to-laravel-5.7)
18+
- [Laravel 5.8 Shift - upgrade from Laravel 5.7 to 5.8](https://laravelshift.com/upgrade-laravel-5.7-to-laravel-5.8)
19+
- [Laravel 6.x Shift - upgrade from Laravel 5.8 to 6.x](https://laravelshift.com/upgrade-laravel-5.8-to-laravel-6.0)
20+
- [Laravel 7.x Shift - upgrade from Laravel 6.x to 7.x](https://laravelshift.com/upgrade-laravel-6.x-to-laravel-7.x)
21+
- [Laravel Tests Shift - upgrade tests from BrowserKit](https://laravelshift.com/upgrade-laravel-5.3-tests-to-laravel-5.4-tests)
22+
- [Laravel Linter - detect lint in your Laravel project](https://laravelshift.com/laravel-linter)
23+
- [Laravel Analyzer - are you following the "Laravel Way"](https://laravelshift.com/opinionated-laravel-way-shift)
24+
- [Laravel Fixer - automate changes to the "Laravel Way"](https://laravelshift.com/laravel-code-fixer)
25+
- [Consolidate Namespace Shift - condense custom namespaces with Laravel](https://laravelshift.com/laravel-consolidate-custom-namespaces)
26+
27+
28+
Shifts for *Lumen* include:
29+
30+
- [Lumen to Laravel - convert a Lumen project to Laravel](https://laravelshift.com/convert-lumen-to-laravel)
31+
32+
33+
Shifts for *PHP* include:
34+
35+
- [PHP 5.5 Shift - upgrade from PHP 5.x to 5.5](https://laravelshift.com/upgrade-php5-to-php5.5)
36+
- [PHP 5.6 Shift - upgrade from PHP 5.5 to 5.6](https://laravelshift.com/upgrade-php-5.5-to-php-5.6)
37+
- [PHP 7.0 Shift - upgrade from PHP 5.6 to 7.0](https://laravelshift.com/upgrade-php-5.6-to-php-7.0)
38+
- [PSR-2 - adopt the PSR-2 code style](https://laravelshift.com/upgrade-psr2-code-style-standard)
39+
- [PSR-4 - upgrade from PSR-0 to PSR-4](https://laravelshift.com/upgrade-namespace-psr0-psr4)
40+
- [Mysqli Shift - covert mysql to mysqli](https://laravelshift.com/upgrade-mysql-mysqli)

app/Console/Kernel.php

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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')->hourly();
28+
}
29+
30+
/**
31+
* Register the commands for the application.
32+
*
33+
* @return void
34+
*/
35+
protected function commands()
36+
{
37+
$this->load(__DIR__.'/Commands');
38+
39+
require base_path('routes/console.php');
40+
}
41+
}

app/Exceptions/Handler.php

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
6+
use Throwable;
7+
8+
class Handler extends ExceptionHandler
9+
{
10+
/**
11+
* A list of the exception types that are not reported.
12+
*
13+
* @var array
14+
*/
15+
protected $dontReport = [
16+
//
17+
];
18+
19+
/**
20+
* A list of the inputs that are never flashed for validation exceptions.
21+
*
22+
* @var array
23+
*/
24+
protected $dontFlash = [
25+
'password',
26+
'password_confirmation',
27+
];
28+
29+
/**
30+
* Report or log an exception.
31+
*
32+
* @param \Throwable $exception
33+
* @return void
34+
*
35+
* @throws \Exception
36+
*/
37+
public function report(Throwable $exception)
38+
{
39+
parent::report($exception);
40+
}
41+
42+
/**
43+
* Render an exception into an HTTP response.
44+
*
45+
* @param \Illuminate\Http\Request $request
46+
* @param \Throwable $exception
47+
* @return \Symfony\Component\HttpFoundation\Response
48+
*
49+
* @throws \Throwable
50+
*/
51+
public function render($request, Throwable $exception)
52+
{
53+
return parent::render($request, $exception);
54+
}
55+
}

app/Http/Controllers/Controller.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
6+
use Illuminate\Foundation\Bus\DispatchesJobs;
7+
use Illuminate\Foundation\Validation\ValidatesRequests;
8+
use Illuminate\Routing\Controller as BaseController;
9+
10+
class Controller extends BaseController
11+
{
12+
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
13+
}

app/Http/Kernel.php

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
namespace App\Http;
4+
5+
use Illuminate\Foundation\Http\Kernel as HttpKernel;
6+
7+
class Kernel extends HttpKernel
8+
{
9+
/**
10+
* The application's global HTTP middleware stack.
11+
*
12+
* These middleware are run during every request to your application.
13+
*
14+
* @var array
15+
*/
16+
protected $middleware = [
17+
\App\Http\Middleware\TrustProxies::class,
18+
\Fruitcake\Cors\HandleCors::class,
19+
\App\Http\Middleware\CheckForMaintenanceMode::class,
20+
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
21+
\App\Http\Middleware\TrimStrings::class,
22+
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
23+
];
24+
25+
/**
26+
* The application's route middleware groups.
27+
*
28+
* @var array
29+
*/
30+
protected $middlewareGroups = [
31+
'web' => [
32+
\App\Http\Middleware\EncryptCookies::class,
33+
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
34+
\Illuminate\Session\Middleware\StartSession::class,
35+
// \Illuminate\Session\Middleware\AuthenticateSession::class,
36+
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
37+
\App\Http\Middleware\VerifyCsrfToken::class,
38+
\Illuminate\Routing\Middleware\SubstituteBindings::class,
39+
],
40+
41+
'api' => [
42+
'throttle:60,1',
43+
\Illuminate\Routing\Middleware\SubstituteBindings::class,
44+
],
45+
];
46+
47+
/**
48+
* The application's route middleware.
49+
*
50+
* These middleware may be assigned to groups or used individually.
51+
*
52+
* @var array
53+
*/
54+
protected $routeMiddleware = [
55+
'auth' => \App\Http\Middleware\Authenticate::class,
56+
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
57+
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
58+
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
59+
'can' => \Illuminate\Auth\Middleware\Authorize::class,
60+
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
61+
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
62+
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
63+
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
64+
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
65+
];
66+
}

app/Http/Middleware/Authenticate.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Auth\Middleware\Authenticate as Middleware;
6+
7+
class Authenticate extends Middleware
8+
{
9+
/**
10+
* Get the path the user should be redirected to when they are not authenticated.
11+
*
12+
* @param \Illuminate\Http\Request $request
13+
* @return string|null
14+
*/
15+
protected function redirectTo($request)
16+
{
17+
if (! $request->expectsJson()) {
18+
return route('login');
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
6+
7+
class CheckForMaintenanceMode extends Middleware
8+
{
9+
/**
10+
* The URIs that should be reachable while maintenance mode is enabled.
11+
*
12+
* @var array
13+
*/
14+
protected $except = [
15+
//
16+
];
17+
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
6+
7+
class EncryptCookies extends Middleware
8+
{
9+
/**
10+
* The names of the cookies that should not be encrypted.
11+
*
12+
* @var array
13+
*/
14+
protected $except = [
15+
//
16+
];
17+
}

0 commit comments

Comments
 (0)