Skip to content

Commit eb5af56

Browse files
committed
Merge remote-tracking branch 'laravel/5.3' into 5.3
2 parents 9757db9 + c2a5bf8 commit eb5af56

File tree

10 files changed

+80
-23
lines changed

10 files changed

+80
-23
lines changed

authorization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ For certain users, you may wish to authorize all actions within a given policy.
194194
return true;
195195
}
196196
}
197-
198-
> {tip} Note that, returning `false` is different from returning `null`. By returning `false` authorization fails, by returning `null` policy method is executed.
197+
198+
If you would like to deny all authorizations for a user you should return `false` from the `before` method. If `null` is returned, the authorization will fall through to the policy method.
199199

200200
<a name="authorizing-actions-using-policies"></a>
201201
## Authorizing Actions Using Policies

blade.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ The following example creates a `@datetime($var)` directive which formats a give
360360
public function boot()
361361
{
362362
Blade::directive('datetime', function ($expression) {
363-
return "<?php echo $expression->format('m/d/Y H:i'); ?>";
363+
return "<?php echo ($expression)->format('m/d/Y H:i'); ?>";
364364
});
365365
}
366366

@@ -377,6 +377,6 @@ The following example creates a `@datetime($var)` directive which formats a give
377377

378378
As you can see, we will chain the `format` method onto whatever expression is passed into the directive. So, in this example, the final PHP generated by this directive will be:
379379

380-
<?php echo $var->format('m/d/Y H:i'); ?>
380+
<?php echo ($var)->format('m/d/Y H:i'); ?>
381381

382382
> {note} After updating the logic of a Blade directive, you will need to delete all of the cached Blade views. The cached Blade views may be removed using the `view:clear` Artisan command.

broadcasting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Next, you should configure your Pusher credentials in the `config/broadcasting.p
6565
'encrypted' => true
6666
],
6767

68-
When using Pusher and [Laravel Echo](#installing-laravel-echo), you should specify `pusher` as your desired broadcaster when instantiating an Echo instance:
68+
When using Pusher and [Laravel Echo](#installing-laravel-echo), you should specify `pusher` as your desired broadcaster when instantiating the Echo instance in your `resources/assets/js/bootstrap.js` file:
6969

7070
import Echo from "laravel-echo"
7171

eloquent-mutators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ To define an accessor, create a `getFooAttribute` method on your model where `Fo
4343
}
4444
}
4545

46-
As you can see, the original value of the column is passed to the accessor, allowing you to manipulate and return the value. To access the value of the mutator, you may simply access the `first_name` attribute on a model instance:
46+
As you can see, the original value of the column is passed to the accessor, allowing you to manipulate and return the value. To access the value of the accessor, you may simply access the `first_name` attribute on a model instance:
4747

4848
$user = App\User::find(1);
4949

homestead.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- [Configuring Cron Schedules](#configuring-cron-schedules)
1616
- [Ports](#ports)
1717
- [Network Interfaces](#network-interfaces)
18+
- [Updating Homestead](#updating-homestead)
1819

1920
<a name="introduction"></a>
2021
## Introduction
@@ -23,7 +24,7 @@ Laravel strives to make the entire PHP development experience delightful, includ
2324

2425
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!
2526

26-
Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 7.0, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.
27+
Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 7.1, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.
2728

2829
> {note} If you are using Windows, you may need to enable hardware virtualization (VT-x). It can usually be enabled via your BIOS. If you are using Hyper-V on a UEFI system you may additionally need to disable Hyper-V in order to access VT-x.
2930
@@ -50,10 +51,12 @@ Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web
5051
<a name="first-steps"></a>
5152
### First Steps
5253

53-
Before launching your Homestead environment, you must install [VirtualBox 5.1](https://www.virtualbox.org/wiki/Downloads) or [VMWare](https://www.vmware.com) as well as [Vagrant](https://www.vagrantup.com/downloads.html). All of these software packages provide easy-to-use visual installers for all popular operating systems.
54+
Before launching your Homestead environment, you must install [VirtualBox 5.1](https://www.virtualbox.org/wiki/Downloads), [VMWare](https://www.vmware.com), or [Parallels](http://www.parallels.com/products/desktop/) as well as [Vagrant](https://www.vagrantup.com/downloads.html). All of these software packages provide easy-to-use visual installers for all popular operating systems.
5455

5556
To use the VMware provider, you will need to purchase both VMware Fusion / Workstation and the [VMware Vagrant plug-in](https://www.vagrantup.com/vmware). Though it is not free, VMware can provide faster shared folder performance out of the box.
5657

58+
To use the Parallels provider, you will need to install [Parallels Vagrant plug-in](https://github.com/Parallels/vagrant-parallels). It is free of charge.
59+
5760
#### Installing The Homestead Vagrant Box
5861

5962
Once VirtualBox / VMware and Vagrant have been installed, you should add the `laravel/homestead` box to your Vagrant installation using the following command in your terminal. It will take a few minutes to download the box, depending on your Internet connection speed:
@@ -72,14 +75,18 @@ You may install Homestead by simply cloning the repository. Consider cloning the
7275

7376
Once you have cloned the Homestead repository, run the `bash init.sh` command from the Homestead directory to create the `Homestead.yaml` configuration file. The `Homestead.yaml` file will be placed in the `~/.homestead` hidden directory:
7477

78+
// Mac / Linux...
7579
bash init.sh
7680

81+
// Windows...
82+
init.bat
83+
7784
<a name="configuring-homestead"></a>
7885
### Configuring Homestead
7986

8087
#### Setting Your Provider
8188

82-
The `provider` key in your `~/.homestead/Homestead.yaml` file indicates which Vagrant provider should be used: `virtualbox`, `vmware_fusion`, or `vmware_workstation`. You may set this to the provider you prefer:
89+
The `provider` key in your `~/.homestead/Homestead.yaml` file indicates which Vagrant provider should be used: `virtualbox`, `vmware_fusion`, `vmware_workstation`, or `parallels`. You may set this to the provider you prefer:
8390

8491
provider: virtualbox
8592

@@ -195,7 +202,7 @@ But, since you will probably need to SSH into your Homestead machine frequently,
195202

196203
A `homestead` database is configured for both MySQL and Postgres out of the box. For even more convenience, Laravel's `.env` file configures the framework to use this database out of the box.
197204

198-
To connect to your MySQL or Postgres database from your host machine via Navicat or Sequel Pro, you should connect to `127.0.0.1` and port `33060` (MySQL) or `54320` (Postgres). The username and password for both databases is `homestead` / `secret`.
205+
To connect to your MySQL or Postgres database from your host machine's database client, you should connect to `127.0.0.1` and port `33060` (MySQL) or `54320` (Postgres). The username and password for both databases is `homestead` / `secret`.
199206

200207
> {note} You should only use these non-standard ports when connecting to the databases from your host machine. You will use the default 3306 and 5432 ports in your Laravel database configuration file since Laravel is running _within_ the virtual machine.
201208
@@ -261,3 +268,16 @@ To enable [DHCP](https://www.vagrantup.com/docs/networking/public_network.html),
261268
networks:
262269
- type: "public_network"
263270
bridge: "en1: Wi-Fi (AirPort)"
271+
272+
<a name="updating-homestead"></a>
273+
## Updating Homestead
274+
275+
You can update Homestead in two simple steps. First, you should update the Vagrant box using the `vagrant box update` command:
276+
277+
vagrant box update
278+
279+
Next, you need to update the Homestead source code. If you cloned the repository you can simply `git pull origin master` at the location you originally cloned the repository.
280+
281+
If you have installed Homestead via your project's `composer.json` file, you should ensure your `composer.json` file contains `"laravel/homestead": "^4"` and update your dependencies:
282+
283+
composer update

middleware.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This command will place a new `CheckAge` class within your `app/Http/Middleware`
3636
class CheckAge
3737
{
3838
/**
39-
* Run the request filter.
39+
* Handle an incoming request.
4040
*
4141
* @param \Illuminate\Http\Request $request
4242
* @param \Closure $next

packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ To define routes for your package, pass the routes file path to the `loadRoutesF
4646
*/
4747
public function boot()
4848
{
49-
$this->loadRoutesFrom(__DIR__.'/../../routes.php');
49+
$this->loadRoutesFrom(__DIR__.'/path/to/routes.php');
5050
}
5151

5252
<a name="resources"></a>

queues.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ In order to use the `database` queue driver, you will need a database table to h
5656

5757
php artisan migrate
5858

59+
#### Redis
60+
61+
In order to use the `redis` queue driver, you should configure a Redis database connection in your `config/database.php` configuration file.
62+
63+
If your Redis queue connection uses a Redis Cluster, your queue names must contain a [key hash tag](https://redis.io/topics/cluster-spec#keys-hash-tags). This is required in order to ensure all of the Redis keys for a given queue are placed into the same hash slot:
64+
65+
'redis' => [
66+
'driver' => 'redis',
67+
'connection' => 'default',
68+
'queue' => '{default}',
69+
'retry_after' => 90,
70+
],
71+
5972
#### Other Driver Prerequisites
6073

6174
The following dependencies are needed for the listed queue drivers:
@@ -290,6 +303,10 @@ You may customize your queue worker even further by only processing particular q
290303

291304
php artisan queue:work redis --queue=emails
292305

306+
#### Resource Considerations
307+
308+
Daemon queue workers do not "reboot" the framework before processing each job. Therefore, you should free any heavy resources after each job completes. For example, if you are doing image manipulation with the GD library, you should free the memory with `imagedestroy` when you are done.
309+
293310
<a name="queue-priorities"></a>
294311
### Queue Priorities
295312

@@ -547,3 +564,11 @@ Using the `before` and `after` methods on the `Queue` [facade](/docs/{{version}}
547564
//
548565
}
549566
}
567+
568+
Using the `looping` method on the `Queue` [facade](/docs/{{version}}/facades), you may specify callbacks that execute before the worker attempts to fetch a job from a queue. For example, you might register a Closure to rollback any transactions that were left open by a previously failed job:
569+
570+
Queue::looping(function () {
571+
while (DB::transactionLevel() > 0) {
572+
DB::rollBack();
573+
}
574+
});

valet.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@
99
- [The "Link" Command](#the-link-command)
1010
- [Securing Sites With TLS](#securing-sites)
1111
- [Sharing Sites](#sharing-sites)
12-
- [Viewing Logs](#viewing-logs)
1312
- [Custom Valet Drivers](#custom-valet-drivers)
1413
- [Other Valet Commands](#other-valet-commands)
1514

1615
<a name="introduction"></a>
1716
## Introduction
1817

19-
Valet is a Laravel development environment for Mac minimalists. No Vagrant, No Apache, No Nginx, No `/etc/hosts` file. You can even share your sites publicly using local tunnels. _Yeah, we like it too._
18+
Valet is a Laravel development environment for Mac minimalists. No Vagrant, no `/etc/hosts` file. You can even share your sites publicly using local tunnels. _Yeah, we like it too._
2019

21-
Laravel Valet configures your Mac to always run [Caddy](https://caddyserver.com) in the background when your machine starts. Then, using [DnsMasq](https://en.wikipedia.org/wiki/Dnsmasq), Valet proxies all requests on the `*.dev` domain to point to sites installed on your local machine.
20+
Laravel Valet configures your Mac to always run [Nginx](https://www.nginx.com/) in the background when your machine starts. Then, using [DnsMasq](https://en.wikipedia.org/wiki/Dnsmasq), Valet proxies all requests on the `*.dev` domain to point to sites installed on your local machine.
2221

2322
In other words, a blazing fast Laravel development environment that uses roughly 7 MB of RAM. Valet isn't a complete replacement for Vagrant or Homestead, but provides a great alternative if you want flexible basics, prefer extreme speed, or are working on a machine with a limited amount of RAM.
2423

@@ -56,7 +55,7 @@ Both Valet and Homestead are great choices for configuring your Laravel developm
5655

5756
<div class="content-list" markdown="1">
5857
- Install or update [Homebrew](http://brew.sh/) to the latest version using `brew update`.
59-
- Install PHP 7.0 using Homebrew via `brew install homebrew/php/php70`.
58+
- Install PHP 7.1 using Homebrew via `brew install homebrew/php/php71`.
6059
- Install Valet with Composer via `composer global require laravel/valet`. Make sure the `~/.composer/vendor/bin` directory is in your system's "PATH".
6160
- Run the `valet install` command. This will configure and install Valet and DnsMasq, and register Valet's daemon to launch when your system starts.
6261
</div>
@@ -80,6 +79,24 @@ If you need a database, try MariaDB by running `brew install mariadb` on your co
8079

8180
You may update your Valet installation using the `composer global update` command in your terminal. After upgrading, it is good practice to run the `valet install` command so Valet can make additional upgrades to your configuration files if necessary.
8281

82+
#### Upgrading To Valet 2.0
83+
84+
Valet 2.0 transitions Valet's underlying web server from Caddy to Nginx. Before upgrading to this version you should run the following commands to stop and uninstall the existing Caddy daemon:
85+
86+
valet stop
87+
valet uninstall
88+
89+
Next, you should upgrade to the latest version of Valet. Depending on how you installed Valet, this is typically done through Git or Composer. If you installed Valet via Composer, you should use the following command to update to the latest major version:
90+
91+
composer global require laravel/valet
92+
93+
Once the fresh Valet source code has been downloaded, you should run the `install` command:
94+
95+
valet install
96+
valet restart
97+
98+
After upgrading, it may be necessary to re-park or re-link your sites.
99+
83100
<a name="serving-sites"></a>
84101
## Serving Sites
85102

@@ -130,11 +147,6 @@ To share a site, navigate to the site's directory in your terminal and run the `
130147

131148
To stop sharing your site, hit `Control + C` to cancel the process.
132149

133-
<a name="viewing-logs"></a>
134-
## Viewing Logs
135-
136-
If you would like to stream all of the logs for all of your sites to your terminal, run the `valet logs` command. New log entries will display in your terminal as they occur. This is a great way to stay on top of all of your log files without ever having to leave your terminal.
137-
138150
<a name="custom-valet-drivers"></a>
139151
## Custom Valet Drivers
140152

@@ -158,7 +170,7 @@ For example, let's pretend we are writing a `WordPressValetDriver`. Our serve me
158170
* @param string $sitePath
159171
* @param string $siteName
160172
* @param string $uri
161-
* @return void
173+
* @return bool
162174
*/
163175
public function serves($sitePath, $siteName, $uri)
164176
{

validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ The field under validation must be a valid date according to the `strtotime` PHP
603603
<a name="rule-date-format"></a>
604604
#### date_format:_format_
605605

606-
The field under validation must match the given _format_. The format will be evaluated using the PHP `date_parse_from_format` function. You should use **either** `date` or `date_format` when validating a field, not both.
606+
The field under validation must match the given _format_. You should use **either** `date` or `date_format` when validating a field, not both.
607607

608608
<a name="rule-different"></a>
609609
#### different:_field_

0 commit comments

Comments
 (0)