You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: authorization.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -194,8 +194,8 @@ For certain users, you may wish to authorize all actions within a given policy.
194
194
return true;
195
195
}
196
196
}
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.
@@ -377,6 +377,6 @@ The following example creates a `@datetime($var)` directive which formats a give
377
377
378
378
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:
379
379
380
-
<?php echo $var->format('m/d/Y H:i'); ?>
380
+
<?php echo ($var)->format('m/d/Y H:i'); ?>
381
381
382
382
> {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.
Copy file name to clipboardExpand all lines: broadcasting.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ Next, you should configure your Pusher credentials in the `config/broadcasting.p
65
65
'encrypted' => true
66
66
],
67
67
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:
Copy file name to clipboardExpand all lines: eloquent-mutators.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ To define an accessor, create a `getFooAttribute` method on your model where `Fo
43
43
}
44
44
}
45
45
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:
@@ -23,7 +24,7 @@ Laravel strives to make the entire PHP development experience delightful, includ
23
24
24
25
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!
25
26
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.
27
28
28
29
> {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.
29
30
@@ -50,10 +51,12 @@ Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web
50
51
<aname="first-steps"></a>
51
52
### First Steps
52
53
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.
54
55
55
56
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.
56
57
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
+
57
60
#### Installing The Homestead Vagrant Box
58
61
59
62
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
72
75
73
76
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:
74
77
78
+
// Mac / Linux...
75
79
bash init.sh
76
80
81
+
// Windows...
82
+
init.bat
83
+
77
84
<aname="configuring-homestead"></a>
78
85
### Configuring Homestead
79
86
80
87
#### Setting Your Provider
81
88
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:
83
90
84
91
provider: virtualbox
85
92
@@ -195,7 +202,7 @@ But, since you will probably need to SSH into your Homestead machine frequently,
195
202
196
203
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.
197
204
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`.
199
206
200
207
> {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.
201
208
@@ -261,3 +268,16 @@ To enable [DHCP](https://www.vagrantup.com/docs/networking/public_network.html),
261
268
networks:
262
269
- type: "public_network"
263
270
bridge: "en1: Wi-Fi (AirPort)"
271
+
272
+
<aname="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:
Copy file name to clipboardExpand all lines: queues.md
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,19 @@ In order to use the `database` queue driver, you will need a database table to h
56
56
57
57
php artisan migrate
58
58
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
+
59
72
#### Other Driver Prerequisites
60
73
61
74
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
290
303
291
304
php artisan queue:work redis --queue=emails
292
305
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
+
293
310
<aname="queue-priorities"></a>
294
311
### Queue Priorities
295
312
@@ -547,3 +564,11 @@ Using the `before` and `after` methods on the `Queue` [facade](/docs/{{version}}
547
564
//
548
565
}
549
566
}
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:
Copy file name to clipboardExpand all lines: valet.md
+22-10Lines changed: 22 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,15 @@
9
9
-[The "Link" Command](#the-link-command)
10
10
-[Securing Sites With TLS](#securing-sites)
11
11
-[Sharing Sites](#sharing-sites)
12
-
-[Viewing Logs](#viewing-logs)
13
12
-[Custom Valet Drivers](#custom-valet-drivers)
14
13
-[Other Valet Commands](#other-valet-commands)
15
14
16
15
<aname="introduction"></a>
17
16
## Introduction
18
17
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._
20
19
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.
22
21
23
22
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.
24
23
@@ -56,7 +55,7 @@ Both Valet and Homestead are great choices for configuring your Laravel developm
56
55
57
56
<divclass="content-list"markdown="1">
58
57
- 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`.
60
59
- Install Valet with Composer via `composer global require laravel/valet`. Make sure the `~/.composer/vendor/bin` directory is in your system's "PATH".
61
60
- Run the `valet install` command. This will configure and install Valet and DnsMasq, and register Valet's daemon to launch when your system starts.
62
61
</div>
@@ -80,6 +79,24 @@ If you need a database, try MariaDB by running `brew install mariadb` on your co
80
79
81
80
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.
82
81
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
+
83
100
<aname="serving-sites"></a>
84
101
## Serving Sites
85
102
@@ -130,11 +147,6 @@ To share a site, navigate to the site's directory in your terminal and run the `
130
147
131
148
To stop sharing your site, hit `Control + C` to cancel the process.
132
149
133
-
<aname="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
-
138
150
<aname="custom-valet-drivers"></a>
139
151
## Custom Valet Drivers
140
152
@@ -158,7 +170,7 @@ For example, let's pretend we are writing a `WordPressValetDriver`. Our serve me
158
170
* @param string $sitePath
159
171
* @param string $siteName
160
172
* @param string $uri
161
-
* @return void
173
+
* @return bool
162
174
*/
163
175
public function serves($sitePath, $siteName, $uri)
Copy file name to clipboardExpand all lines: validation.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -603,7 +603,7 @@ The field under validation must be a valid date according to the `strtotime` PHP
603
603
<aname="rule-date-format"></a>
604
604
#### date_format:_format_
605
605
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.
0 commit comments