Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.7] make model factory after method signatures more consistent #23670

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
44e6f35
Bumped versions to 5.7 (#22636)
GrahamCampbell Jan 4, 2018
4ecbe23
Merge branch '5.6'
taylorotwell Jan 4, 2018
5282077
Merge branch '5.6'
taylorotwell Jan 5, 2018
a3491ba
Merge branch '5.6'
GrahamCampbell Jan 6, 2018
67939ca
Merge branch '5.6'
GrahamCampbell Jan 6, 2018
de5b51f
Merge branch '5.6'
taylorotwell Jan 6, 2018
b2b7f50
Merge branch 'master' of github.com:laravel/framework
taylorotwell Jan 6, 2018
6d51399
update dep
taylorotwell Jan 6, 2018
092147e
Merge branch '5.6'
taylorotwell Jan 9, 2018
e3ab1c0
Merge branch '5.6'
taylorotwell Jan 9, 2018
b2092ea
Merge branch '5.6'
taylorotwell Jan 10, 2018
8b1c954
Merge branch '5.6'
taylorotwell Jan 11, 2018
1fe36ee
Merge branch '5.6'
taylorotwell Jan 12, 2018
4abba18
Merge branch '5.6'
taylorotwell Jan 12, 2018
8965081
Merge branch '5.6'
taylorotwell Jan 15, 2018
251dfb6
fix conflicts
taylorotwell Jan 16, 2018
01f2f68
Merge branch '5.6'
taylorotwell Jan 19, 2018
297ef96
Merge branch '5.6'
taylorotwell Jan 21, 2018
b770112
Merge branch '5.6'
GrahamCampbell Jan 27, 2018
6eab572
Merge branch '5.6'
GrahamCampbell Jan 28, 2018
19b3e78
Merge branch '5.6'
GrahamCampbell Feb 2, 2018
d60f524
Merge branch '5.6'
GrahamCampbell Feb 4, 2018
49cc5d6
Merge branch '5.6'
taylorotwell Feb 5, 2018
4c72d25
Merge branch 'master' of github.com:laravel/framework
taylorotwell Feb 5, 2018
ccf906c
Merge branch '5.6'
taylorotwell Feb 6, 2018
70021c6
fix conflicts
taylorotwell Feb 9, 2018
127a83d
Apply fixes from StyleCI (#23102)
taylorotwell Feb 9, 2018
72a1071
Merge branch '5.6'
GrahamCampbell Feb 10, 2018
b345650
Add absolute controller namespacing on route groups (#23113)
Jack97 Feb 14, 2018
a60770e
Update Factory.php (#23200)
laurencei Feb 17, 2018
6d41a3f
Allow specifying a default when asking for a route parameter from the…
adamwathan Feb 17, 2018
f3f4b0a
Pass basic authentication field parameter to the auth.basic middlewar…
Omranic Feb 19, 2018
8129d19
don’t call Redis client directly (#23225)
tillkruss Feb 20, 2018
4215fd3
set Redis connection names
tillkruss Feb 21, 2018
ccec743
Merge branch '5.6'
taylorotwell Feb 21, 2018
3a4632f
Merge branch 'redis-name' of https://github.com/tillkruss/framework
taylorotwell Feb 21, 2018
b000f28
formatting
taylorotwell Feb 21, 2018
16a2801
fix conflicts
taylorotwell Feb 22, 2018
e7fa0b0
Apply fixes from StyleCI (#23265)
GrahamCampbell Feb 22, 2018
3316f8e
Merge branch '5.6'
GrahamCampbell Feb 24, 2018
c13d60b
Merge branch '5.6'
GrahamCampbell Feb 26, 2018
a346cc7
fix conflicts
taylorotwell Feb 28, 2018
e5763e1
Add getNextRunDate timezone argument (#23350)
tjallingt Mar 1, 2018
6d66a31
Merge branch '5.6'
GrahamCampbell Mar 4, 2018
2ab70e6
Fix conflicts
taylorotwell Mar 6, 2018
527cb7b
Merge branch '5.6'
GrahamCampbell Mar 6, 2018
11bc7ff
Merge branch '5.6'
GrahamCampbell Mar 8, 2018
fe1cbdf
Add optimize and optimize:clear commands
vinkla Mar 9, 2018
c2a6f17
formatting
taylorotwell Mar 9, 2018
de70d66
Merge branch '5.6'
GrahamCampbell Mar 10, 2018
1b8d838
Merge branch '5.6'
GrahamCampbell Mar 10, 2018
94bba2d
Fixed recommended version
GrahamCampbell Mar 10, 2018
c7ecf14
Merge branch '5.6'
GrahamCampbell Mar 10, 2018
1d08883
Bumped versions (#23481)
GrahamCampbell Mar 10, 2018
f26ee35
[5.7] Add config:clear to optimize command (#23473)
vinkla Mar 10, 2018
fbe7d49
Merge branch '5.6'
GrahamCampbell Mar 10, 2018
c624144
Update suggestion constraints
vinkla Mar 10, 2018
f4b8568
Merge pull request #23483 from vinkla/fix-constraints
GrahamCampbell Mar 10, 2018
cae41f6
[5.7] Make MessageBag constructor behaviour consistent with `add` (#2…
michaeldyrynda Mar 12, 2018
2115cf6
Add cursor to ConnectionInterface (#23525)
m3esma Mar 13, 2018
7c6ae9a
easier customization of redirect
taylorotwell Mar 13, 2018
e8848ee
Merge branch 'master' of github.com:laravel/framework
taylorotwell Mar 13, 2018
fff2475
fix wording
taylorotwell Mar 13, 2018
1fa9459
Add ArrayAccess "dot notation" support in Request object
TitasGailius Mar 14, 2018
4e0754d
Add ArrayAccess test for Request object
TitasGailius Mar 14, 2018
4653427
Merge branch 'master' of https://github.com/TitasGailius/framework in…
taylorotwell Mar 14, 2018
59927d6
formatting
taylorotwell Mar 14, 2018
ec5764c
remove Blade defaults (#23532)
browner12 Mar 14, 2018
4ac043b
Add connection parameter to job scheduling (#23576)
CmdrSharp Mar 16, 2018
17f93cb
Fixed phpdoc of the schedule class
GrahamCampbell Mar 17, 2018
a7c82e0
Merge pull request #23581 from laravel/phpdoc
GrahamCampbell Mar 17, 2018
75b3ec6
Using full Yes / No in migrate:status command (#23616)
Mar 19, 2018
dc642c8
fix phpdoc (#23609)
AaronJan Mar 19, 2018
eda7add
Update various blade array_ calls to use fully qualified Arr helper (…
garygreen Mar 20, 2018
b38b67a
[5.7] Make Filesystem contract in line with Flysystem (#23629)
afraca Mar 20, 2018
ab83fb9
[5.7] Allow to disable `CREATED_AT`.
TBlindaruk Mar 20, 2018
0ab2566
[5.7] add unit tests for CREATED_AT and UPDATED_AT disabling.
TBlindaruk Mar 21, 2018
8c375cf
fix conflicts
taylorotwell Mar 21, 2018
bc279b3
Merge branch 'disable_created_at' of https://github.com/TBlindaruk/la…
taylorotwell Mar 21, 2018
603ae0f
formatting
taylorotwell Mar 21, 2018
74cf203
Apply fixes from StyleCI (#23649)
taylorotwell Mar 21, 2018
06f5b25
make model factory after method signatures more consistent
Mar 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@
"php": "^7.1.3",
"ext-mbstring": "*",
"ext-openssl": "*",
"doctrine/inflector": "~1.1",
"dragonmantank/cron-expression": "~2.0",
"erusev/parsedown": "~1.7",
"league/flysystem": "^1.0.8",
"monolog/monolog": "~1.12",
"doctrine/inflector": "^1.1",
"dragonmantank/cron-expression": "^2.0",
"erusev/parsedown": "^1.7",
"league/flysystem": "^1.0",
"monolog/monolog": "^1.12",
"nesbot/carbon": "^1.24.1",
"psr/container": "~1.0",
"psr/container": "^1.0",
"psr/simple-cache": "^1.0",
"ramsey/uuid": "^3.7",
"swiftmailer/swiftmailer": "~6.0",
"symfony/console": "~4.0",
"symfony/debug": "~4.0",
"symfony/finder": "~4.0",
"symfony/http-foundation": "~4.0",
"symfony/http-kernel": "~4.0",
"symfony/process": "~4.0",
"symfony/routing": "~4.0",
"symfony/var-dumper": "~4.0",
"swiftmailer/swiftmailer": "^6.0",
"symfony/console": "^4.1",
"symfony/debug": "^4.1",
"symfony/finder": "^4.1",
"symfony/http-foundation": "^4.1",
"symfony/http-kernel": "^4.1",
"symfony/process": "^4.1",
"symfony/routing": "^4.1",
"symfony/var-dumper": "^4.1",
"tijsverkoyen/css-to-inline-styles": "^2.2.1",
"vlucas/phpdotenv": "~2.2"
"vlucas/phpdotenv": "^2.2"
},
"replace": {
"illuminate/auth": "self.version",
Expand Down Expand Up @@ -73,17 +73,17 @@
"tightenco/collect": "<5.5.33"
},
"require-dev": {
"aws/aws-sdk-php": "~3.0",
"doctrine/dbal": "~2.6",
"aws/aws-sdk-php": "^3.0",
"doctrine/dbal": "^2.6",
"filp/whoops": "^2.1.4",
"mockery/mockery": "~1.0",
"mockery/mockery": "^1.0",
"moontoast/math": "^1.1",
"orchestra/testbench-core": "3.6.*",
"pda/pheanstalk": "~3.0",
"phpunit/phpunit": "~7.0",
"orchestra/testbench-core": "3.7.*",
"pda/pheanstalk": "^3.0",
"phpunit/phpunit": "^7.0",
"predis/predis": "^1.1.1",
"symfony/css-selector": "~4.0",
"symfony/dom-crawler": "~4.0"
"symfony/css-selector": "^4.1",
"symfony/dom-crawler": "^4.1"
},
"autoload": {
"files": [
Expand All @@ -104,28 +104,28 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.6-dev"
"dev-master": "5.7-dev"
}
},
"suggest": {
"ext-pcntl": "Required to use all features of the queue worker.",
"ext-posix": "Required to use all features of the queue worker.",
"aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).",
"doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.6).",
"fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).",
"guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).",
"laravel/tinker": "Required to use the tinker console command (~1.0).",
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).",
"league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).",
"league/flysystem-cached-adapter": "Required to use Flysystem caching (~1.0).",
"league/flysystem-sftp": "Required to use the Flysystem SFTP driver (~1.0).",
"nexmo/client": "Required to use the Nexmo transport (~1.0).",
"pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).",
"predis/predis": "Required to use the redis cache and queue drivers (~1.0).",
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~3.0).",
"symfony/css-selector": "Required to use some of the crawler integration testing tools (~4.0).",
"symfony/dom-crawler": "Required to use most of the crawler integration testing tools (~4.0).",
"symfony/psr-http-message-bridge": "Required to psr7 bridging features (~1.0)."
"aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (^3.0).",
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).",
"fzaninotto/faker": "Required to use the eloquent factory builder (^1.4).",
"guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (^6.0).",
"laravel/tinker": "Required to use the tinker console command (^1.0).",
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).",
"league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (^1.0).",
"league/flysystem-cached-adapter": "Required to use Flysystem caching (^1.0).",
"league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).",
"nexmo/client": "Required to use the Nexmo transport (^1.0).",
"pda/pheanstalk": "Required to use the beanstalk queue driver (^3.0).",
"predis/predis": "Required to use the redis cache and queue drivers (^1.0).",
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^3.0).",
"symfony/css-selector": "Required to use some of the crawler integration testing tools (^4.1).",
"symfony/dom-crawler": "Required to use most of the crawler integration testing tools (^4.1).",
"symfony/psr-http-message-bridge": "Required to psr7 bridging features (^1.0)."
},
"config": {
"sort-packages": true
Expand Down
21 changes: 20 additions & 1 deletion src/Illuminate/Auth/AuthenticationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,27 @@ class AuthenticationException extends Exception
*/
protected $guards;

/**
* The path the user should be redirected to.
*
* @var string
*/
protected $redirectTo;

/**
* Create a new authentication exception.
*
* @param string $message
* @param array $guards
* @param string|null $redirectTo
* @return void
*/
public function __construct($message = 'Unauthenticated.', array $guards = [])
public function __construct($message = 'Unauthenticated.', array $guards = [], $redirectTo = null)
{
parent::__construct($message);

$this->guards = $guards;
$this->redirectTo = $redirectTo;
}

/**
Expand All @@ -36,4 +45,14 @@ public function guards()
{
return $this->guards;
}

/**
* Get the path the user should be redirected to.
*
* @return string
*/
public function redirectTo()
{
return $this->redirectTo;
}
}
22 changes: 18 additions & 4 deletions src/Illuminate/Auth/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,24 @@ public function __construct(Auth $auth)
*/
public function handle($request, Closure $next, ...$guards)
{
$this->authenticate($guards);
$this->authenticate($request, $guards);

return $next($request);
}

/**
* Determine if the user is logged in to any of the given guards.
*
* @param \Illuminate\Http\Request $request
* @param array $guards
* @return void
*
* @throws \Illuminate\Auth\AuthenticationException
*/
protected function authenticate(array $guards)
protected function authenticate($request, array $guards)
{
if (empty($guards)) {
return $this->auth->authenticate();
$guards = [null];
}

foreach ($guards as $guard) {
Expand All @@ -63,6 +64,19 @@ protected function authenticate(array $guards)
}
}

throw new AuthenticationException('Unauthenticated.', $guards);
throw new AuthenticationException(
'Unauthenticated.', $guards, $this->redirectTo($request)
);
}

/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string
*/
protected function redirectTo($request)
{
//
}
}
5 changes: 3 additions & 2 deletions src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ public function __construct(AuthFactory $auth)
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @param string|null $field
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
public function handle($request, Closure $next, $guard = null, $field = null)
{
return $this->auth->guard($guard)->basic() ?: $next($request);
return $this->auth->guard($guard)->basic($field) ?: $next($request);
}
}
16 changes: 8 additions & 8 deletions src/Illuminate/Auth/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
],
"require": {
"php": "^7.1.3",
"illuminate/contracts": "5.6.*",
"illuminate/http": "5.6.*",
"illuminate/queue": "5.6.*",
"illuminate/support": "5.6.*"
"illuminate/contracts": "5.7.*",
"illuminate/http": "5.7.*",
"illuminate/queue": "5.7.*",
"illuminate/support": "5.7.*"
},
"autoload": {
"psr-4": {
Expand All @@ -27,13 +27,13 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.6-dev"
"dev-master": "5.7-dev"
}
},
"suggest": {
"illuminate/console": "Required to use the auth:clear-resets command (5.6.*).",
"illuminate/queue": "Required to fire login / logout events (5.6.*).",
"illuminate/session": "Required to use the session based guard (5.6.*)."
"illuminate/console": "Required to use the auth:clear-resets command (5.7.*).",
"illuminate/queue": "Required to fire login / logout events (5.7.*).",
"illuminate/session": "Required to use the session based guard (5.7.*)."
},
"config": {
"sort-packages": true
Expand Down
14 changes: 7 additions & 7 deletions src/Illuminate/Broadcasting/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
],
"require": {
"php": "^7.1.3",
"psr/log": "~1.0",
"illuminate/bus": "5.6.*",
"illuminate/contracts": "5.6.*",
"illuminate/queue": "5.6.*",
"illuminate/support": "5.6.*"
"psr/log": "^1.0",
"illuminate/bus": "5.7.*",
"illuminate/contracts": "5.7.*",
"illuminate/queue": "5.7.*",
"illuminate/support": "5.7.*"
},
"autoload": {
"psr-4": {
Expand All @@ -28,11 +28,11 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.6-dev"
"dev-master": "5.7-dev"
}
},
"suggest": {
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~3.0)."
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^3.0)."
},
"config": {
"sort-packages": true
Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Bus/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
],
"require": {
"php": "^7.1.3",
"illuminate/contracts": "5.6.*",
"illuminate/pipeline": "5.6.*",
"illuminate/support": "5.6.*"
"illuminate/contracts": "5.7.*",
"illuminate/pipeline": "5.7.*",
"illuminate/support": "5.7.*"
},
"autoload": {
"psr-4": {
Expand All @@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.6-dev"
"dev-master": "5.7-dev"
}
},
"config": {
Expand Down
12 changes: 6 additions & 6 deletions src/Illuminate/Cache/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.1.3",
"illuminate/contracts": "5.6.*",
"illuminate/support": "5.6.*"
"illuminate/contracts": "5.7.*",
"illuminate/support": "5.7.*"
},
"autoload": {
"psr-4": {
Expand All @@ -25,13 +25,13 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.6-dev"
"dev-master": "5.7-dev"
}
},
"suggest": {
"illuminate/database": "Required to use the database cache driver (5.6.*).",
"illuminate/filesystem": "Required to use the file cache driver (5.6.*).",
"illuminate/redis": "Required to use the redis cache driver (5.6.*)."
"illuminate/database": "Required to use the database cache driver (5.7.*).",
"illuminate/filesystem": "Required to use the file cache driver (5.7.*).",
"illuminate/redis": "Required to use the redis cache driver (5.7.*)."
},
"config": {
"sort-packages": true
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Config/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.1.3",
"illuminate/contracts": "5.6.*",
"illuminate/support": "5.6.*"
"illuminate/contracts": "5.7.*",
"illuminate/support": "5.7.*"
},
"autoload": {
"psr-4": {
Expand All @@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.6-dev"
"dev-master": "5.7-dev"
}
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Console/Scheduling/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ public function nextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate =
{
return Carbon::instance(CronExpression::factory(
$this->getExpression()
)->getNextRunDate($currentTime, $nth, $allowCurrentDate));
)->getNextRunDate($currentTime, $nth, $allowCurrentDate, $this->timezone));
}

/**
Expand Down
9 changes: 5 additions & 4 deletions src/Illuminate/Console/Scheduling/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct()
* Add a new callback event to the schedule.
*
* @param string|callable $callback
* @param array $parameters
* @param array $parameters
* @return \Illuminate\Console\Scheduling\CallbackEvent
*/
public function call($callback, array $parameters = [])
Expand Down Expand Up @@ -88,15 +88,16 @@ public function command($command, array $parameters = [])
*
* @param object|string $job
* @param string|null $queue
* @param string|null $connection
* @return \Illuminate\Console\Scheduling\CallbackEvent
*/
public function job($job, $queue = null)
public function job($job, $queue = null, $connection = null)
{
return $this->call(function () use ($job, $queue) {
return $this->call(function () use ($job, $queue, $connection) {
$job = is_string($job) ? resolve($job) : $job;

if ($job instanceof ShouldQueue) {
dispatch($job)->onQueue($queue);
dispatch($job)->onConnection($connection)->onQueue($queue);
} else {
dispatch_now($job);
}
Expand Down
Loading