From c15605d81d2b1b7ffe10784afbb0565fcd8064ba Mon Sep 17 00:00:00 2001 From: Caleb Fidecaro Date: Tue, 3 Feb 2015 10:48:03 +1300 Subject: [PATCH 001/276] Update middleware.md Add some clarification around middleware running before/after a request has been processed --- middleware.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/middleware.md b/middleware.md index 240f7049a75..8558fcdb7f1 100644 --- a/middleware.md +++ b/middleware.md @@ -49,6 +49,40 @@ As you can see, if the given `age` is less than `200`, the middleware will retur It's best to envision middleware as a series of "layers" HTTP requests must pass through before they hit your application. Each layer can examine the request and even reject it entirely. +### *Before* vs *after* middleware + +Whether a middleware runs *before* or *after* a request has been processed depends on how performs its action: + + ## Registering Middleware From 0110ff6bf656d36ca9ec91b84c0c32df73111548 Mon Sep 17 00:00:00 2001 From: Caleb Fidecaro Date: Tue, 3 Feb 2015 17:04:42 +1300 Subject: [PATCH 002/276] Typo --- middleware.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware.md b/middleware.md index 8558fcdb7f1..f720f0df62e 100644 --- a/middleware.md +++ b/middleware.md @@ -51,7 +51,7 @@ It's best to envision middleware as a series of "layers" HTTP requests must pass ### *Before* vs *after* middleware -Whether a middleware runs *before* or *after* a request has been processed depends on how performs its action: +Whether a middleware runs *before* or *after* a request has been processed depends on how it performs its action: Date: Wed, 4 Feb 2015 11:21:04 +0100 Subject: [PATCH 003/276] Add section about public assets --- packages.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages.md b/packages.md index 60eafb41f3a..02dff60702b 100644 --- a/packages.md +++ b/packages.md @@ -4,6 +4,7 @@ - [Views](#views) - [Translations](#translations) - [Configuration](#configuration) +- [Public assets](#public-assets) - [Publishing File Groups](#publishing-file-groups) - [Routing](#routing) @@ -104,6 +105,23 @@ You may also choose to merge your own package configuration file with the applic __DIR__.'/path/to/config/courier.php', 'courier' ); + +## Public assets + +Some packages may have assets such as JavaScript, CSS, and images. However, we are unable to link to assets in the vendor or workbench directories, so we need a way to move these assets into the public directory of our application. + +To publish assets, use the `publishes` method from the `boot` method of your service provider, with the `public` tag: + + $this->publishes([ + __DIR__.'/path/to/assets' => public_path('vendor/courier'), + ], 'public'); + +Now, when users of your package execute Laravel's `vendor:publish` command, your file will be copied to the specified location. You usually want to overwrite the public assets every time the package is updated, so you can use the `--force` flag for the `public` tag: + + php artisan vendor:publish --tag=public --force + +To make sure your public assets are always up-to-date, you might want to add that command to the `post-update-cmd` commands in your `composer.json`. + ## Publishing File Groups From 5dd8fbd9bd6233996e5c0dfab52b074dc170e4c2 Mon Sep 17 00:00:00 2001 From: Nathan Macnamara Date: Mon, 9 Feb 2015 09:16:10 +0000 Subject: [PATCH 004/276] Update homestead docs to outline the adding of additional port forwarding settings. --- homestead.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/homestead.md b/homestead.md index c8ec62509f3..044dfe7bc40 100644 --- a/homestead.md +++ b/homestead.md @@ -165,3 +165,18 @@ The following ports are forwarded to your Homestead environment: - **HTTP:** 8000 → Forwards To 80 - **MySQL:** 33060 → Forwards To 3306 - **Postgres:** 54320 → Forwards To 5432 + +### Adding Additional Port Forwarding Settings + +Should you add additional services to the vagrant box, You may wish to overwrite the default port settings or add additional port forwarding settings to the server in order to allow for additional remote access from the host machine. + + ports: + - guest: 80 + host: 8080 + - guest: 1028 + host: 1028 + - guest: 443 + host: 44500 + protocol: udp + +> **Note:** The default port configurations settings detailed above remain however should you required they can be overridden using the custom setup. \ No newline at end of file From d097b11f5543f423734d9c7920c84a64d186a2d2 Mon Sep 17 00:00:00 2001 From: Nathan Macnamara Date: Mon, 9 Feb 2015 10:29:20 +0100 Subject: [PATCH 005/276] Update homestead docs, explain ports property. --- homestead.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 044dfe7bc40..3fa15c8650f 100644 --- a/homestead.md +++ b/homestead.md @@ -168,7 +168,9 @@ The following ports are forwarded to your Homestead environment: ### Adding Additional Port Forwarding Settings -Should you add additional services to the vagrant box, You may wish to overwrite the default port settings or add additional port forwarding settings to the server in order to allow for additional remote access from the host machine. +Should you add additional services to the vagrant box. You may wish to overwrite the default port settings or add additional port forwarding settings to the vagrant box, to allow for additional remote access from the host machine. + +The `ports` property can be used to define additional port settings, by specifying the guest and host port numbers. You also have the option to specify the protocol setting either `tcp` or `udp` as demonstrated below: ports: - guest: 80 From 75ce463ad4e1fb3c6dcdb474c2661acc916bf896 Mon Sep 17 00:00:00 2001 From: Brenley Dueck Date: Sun, 8 Feb 2015 20:39:05 -0600 Subject: [PATCH 006/276] Document ability to add custom filesystems --- filesystem.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/filesystem.md b/filesystem.md index 44134e33001..7c12cad69a4 100644 --- a/filesystem.md +++ b/filesystem.md @@ -3,6 +3,7 @@ - [Introduction](#introduction) - [Configuration](#configuration) - [Basic Usage](#basic-usage) +- [Custom Filesystems](#custom-filesystems) ## Introduction @@ -106,3 +107,41 @@ The `Storage` facade may be used to interact with any of your configured disks. #### Delete A Directory Storage::deleteDirectory($directory); + + +## Custom Filesystems +Laravel's Flysystem integration provides drivers for local filesystems, Amazon S3, and Rackspace Cloud Storage. Flysystem is not limited to these and has adapters for many additional storage systems. If you want to use one of these additional adapters in your Laravel application, you'll want to create a custom driver. + +In order to set up your custom filesystem you'll need to create a Service Provider (for example, `DropboxFilesystemServiceProvider`). In its `boot` method, you'll want to inject an instance of the `Illuminate\Contracts\Filesystem\Factory` contract, and then call the `extend` method of the injected instance. + +The first argument of the `extend` method is the name of the driver you will use, while the second argument is a closure that gets passed both the `$app` and `$config` variables. + +From this closure you must return an instance of `League\Flysystem\Filesystem`. Use the details provided with each filesystem to set this up. + +> **Note:** The $config variable will already contain the proper values defined in `config/filesystems.php` for the provided disk. + +Visit [Flysystem](https://github.com/thephpleague/flysystem#adapters) to view a list of available filesystems. + +#### Dropbox Example + + extend('dropbox', function($app, $config) + { + $client = new Client($config['accessToken'], $config['clientIdentifier']); + $adapter = new DropboxAdapter($client); + + return new Filesystem($adapter); + }); + } + + } From 31be81ee79d682b7878837cba5fade0f8d95406a Mon Sep 17 00:00:00 2001 From: Patrick Romowicz Date: Wed, 11 Feb 2015 08:42:01 +0100 Subject: [PATCH 007/276] Update homestead.md Add additional NFS info an example. --- homestead.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/homestead.md b/homestead.md index c8ec62509f3..77c1f09ca54 100644 --- a/homestead.md +++ b/homestead.md @@ -94,6 +94,15 @@ Once you have created a SSH key, specify the key's path in the `authorize` prope The `folders` property of the `Homestead.yaml` file lists all of the folders you wish to share with your Homestead environment. As files within these folders are changed, they will be kept in sync between your local machine and the Homestead environment. You may configure as many shared folders as necessary! +#### Enabling NFS synced folders + +To enable [NFS](http://docs.vagrantup.com/v2/synced-folders/nfs.html), just add the `type: "nfs"` flag onto your synced folder: + + folders: + - map: ~/Code + to: /home/vagrant/Code + type: "nfs" + ### Configure Your Nginx Sites Not familiar with Nginx? No problem. The `sites` property allows you to easily map a "domain" to a folder on your Homestead environment. A sample site configuration is included in the `Homestead.yaml` file. Again, you may add as many sites to your Homestead environment as necessary. Homestead can serve as a convenient, virtualized environment for every Laravel project you are working on! From 41e2b0bb6cc30c6e19bc5858bddd9d5fbfd3f9af Mon Sep 17 00:00:00 2001 From: Sonny Gauran Date: Fri, 13 Feb 2015 21:37:54 +0800 Subject: [PATCH 008/276] Fixed command to be used after editing homestead.yml Use `homestead` instead of `vagrant`, with the `provision` command. --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index c8ec62509f3..bfb699fdba1 100644 --- a/homestead.md +++ b/homestead.md @@ -148,7 +148,7 @@ To connect to your MySQL or Postgres database from your main machine via Navicat ### Adding Additional Sites -Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. There are two ways to do this: First, you may simply add the sites to your `Homestead.yaml` file and then run `vagrant provision`. +Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. There are two ways to do this: First, you may simply add the sites to your `Homestead.yaml` file and then run `homestead provision`. Alternatively, you may use the `serve` script that is available on your Homestead environment. To use the `serve` script, SSH into your Homestead environment and run the following command: From f04a7766094ee4304df7a3dc61be00c119e0d541 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 16 Feb 2015 22:25:00 -0600 Subject: [PATCH 009/276] Remove link helper docs. --- helpers.md | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/helpers.md b/helpers.md index ff0f78e34ad..4d634f7669f 100644 --- a/helpers.md +++ b/helpers.md @@ -304,7 +304,7 @@ Generate a random string of the given length. Convert a string to its singular form (English only). $singular = str_singular('cars'); - + ### str_slug Generate a URL friendly "slug" from a given string. @@ -312,9 +312,9 @@ Generate a URL friendly "slug" from a given string. str_slug($title, $separator); Example: - + $title = str_slug("Laravel 5 Framework", "-"); - + // laravel-5-framework ### studly_case @@ -358,30 +358,6 @@ Generate a URL for an asset. $url = asset('img/photo.jpg'); -### link_to - -Generate a HTML link to the given URL. - - echo link_to('foo/bar', $title, $attributes = [], $secure = null); - -### link_to_asset - -Generate a HTML link to the given asset. - - echo link_to_asset('foo/bar.zip', $title, $attributes = [], $secure = null); - -### link_to_route - -Generate a HTML link to the given route. - - echo link_to_route('route.name', $title, $parameters = [], $attributes = []); - -### link_to_action - -Generate a HTML link to the given controller action. - - echo link_to_action('HomeController@getIndex', $title, $parameters = [], $attributes = []); - ### secure_asset Generate a HTML link to the given asset using HTTPS. From 43f5a4934fd79bdd7e3c2598ce3c84902493bf92 Mon Sep 17 00:00:00 2001 From: Michael Dyrynda Date: Tue, 17 Feb 2015 15:01:10 +1030 Subject: [PATCH 010/276] Update wording Make the wording for the secure_asset helper consistent with the asset helper. --- helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers.md b/helpers.md index 4d634f7669f..528fd399526 100644 --- a/helpers.md +++ b/helpers.md @@ -360,7 +360,7 @@ Generate a URL for an asset. ### secure_asset -Generate a HTML link to the given asset using HTTPS. +Generate a URL for an asset using HTTPS. echo secure_asset('foo/bar.zip', $title, $attributes = []); From 1781e800683a3cf78e4756a8874ffcf9c50e503f Mon Sep 17 00:00:00 2001 From: Javier Hidalgo Date: Tue, 17 Feb 2015 16:44:25 -0500 Subject: [PATCH 011/276] Update Autoloading Standard in Coding Style Isn't Laravel 5 following the PSR-4 as autoloding standard? --- contributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributions.md b/contributions.md index 46af96ea801..176d8f9498a 100644 --- a/contributions.md +++ b/contributions.md @@ -53,7 +53,7 @@ If you discover a security vulnerability within Laravel, please send an e-mail t ## Coding Style -Laravel follows the [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) and [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) coding standards. In addition to these standards, the following coding standards should be followed: +Laravel follows the [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) and [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) coding standards. In addition to these standards, the following coding standards should be followed: - The class namespace declaration must be on the same line as ` Date: Wed, 18 Feb 2015 01:36:44 -0500 Subject: [PATCH 012/276] update where file sessions are stored --- session.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.md b/session.md index 6700e22d6e1..340653dcc17 100644 --- a/session.md +++ b/session.md @@ -109,7 +109,7 @@ Of course, you may use the `session:table` Artisan command to generate this migr The session "driver" defines where session data will be stored for each request. Laravel ships with several great drivers out of the box: -- `file` - sessions will be stored in `app/storage/sessions`. +- `file` - sessions will be stored in `storage/framework/sessions`. - `cookie` - sessions will be stored in secure, encrypted cookies. - `database` - sessions will be stored in a database used by your application. - `memcached` / `redis` - sessions will be stored in one of these fast, cached based stores. From ff20bebe889aaa0c374cec1bce0a819fb7c70fc0 Mon Sep 17 00:00:00 2001 From: Pedro Borges Date: Wed, 18 Feb 2015 21:35:31 -0200 Subject: [PATCH 013/276] Update Laravel version in the Queue docs. --- queues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queues.md b/queues.md index 32e05a17d3e..a1d823cabfd 100644 --- a/queues.md +++ b/queues.md @@ -210,7 +210,7 @@ Similarly, your database connection may disconnect when being used by long-runni ## Push Queues -Push queues allow you to utilize the powerful Laravel 4 queue facilities without running any daemons or background listeners. Currently, push queues are only supported by the [Iron.io](http://iron.io) driver. Before getting started, create an Iron.io account, and add your Iron credentials to the `config/queue.php` configuration file. +Push queues allow you to utilize the powerful Laravel 5 queue facilities without running any daemons or background listeners. Currently, push queues are only supported by the [Iron.io](http://iron.io) driver. Before getting started, create an Iron.io account, and add your Iron credentials to the `config/queue.php` configuration file. #### Registering A Push Queue Subscriber From 681960f21c1ad3ecf692f42b97cc2fbf3db3ac16 Mon Sep 17 00:00:00 2001 From: Martin Bean Date: Thu, 19 Feb 2015 14:29:48 +0000 Subject: [PATCH 014/276] Fix hasher contract name --- facades.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facades.md b/facades.md index bd75033afa5..3f8198c3d7c 100644 --- a/facades.md +++ b/facades.md @@ -152,7 +152,7 @@ DB (Instance) | [Illuminate\Database\Connection](http://laravel.com/api/5.0/Il Event | [Illuminate\Events\Dispatcher](http://laravel.com/api/5.0/Illuminate/Events/Dispatcher.html) | `events` File | [Illuminate\Filesystem\Filesystem](http://laravel.com/api/5.0/Illuminate/Filesystem/Filesystem.html) | `files` Form | [Illuminate\Html\FormBuilder](http://laravel.com/api/5.0/Illuminate/Html/FormBuilder.html) | `form` -Hash | [Illuminate\Hashing\HasherInterface](http://laravel.com/api/5.0/Illuminate/Hashing/HasherInterface.html) | `hash` +Hash | [Illuminate\Contracts\Hashing\Hasher](http://laravel.com/api/5.0/Illuminate/Contracts/Hashing/Hasher.html) | `hash` HTML | [Illuminate\Html\HtmlBuilder](http://laravel.com/api/5.0/Illuminate/Html/HtmlBuilder.html) | `html` Input | [Illuminate\Http\Request](http://laravel.com/api/5.0/Illuminate/Http/Request.html) | `request` Lang | [Illuminate\Translation\Translator](http://laravel.com/api/5.0/Illuminate/Translation/Translator.html) | `translator` From 231b0deb7ed2e9a0b71c2f68d48e25b4a0700a21 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Fri, 20 Feb 2015 18:27:07 +0100 Subject: [PATCH 015/276] Add note about X-XSRF-TOKEN and X-CSRF-TOKEN difference For https://github.com/laravel/framework/pull/7528 --- routing.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/routing.md b/routing.md index c54ebc4ca96..10be27706b8 100644 --- a/routing.md +++ b/routing.md @@ -73,7 +73,20 @@ Of course, using the Blade [templating engine](/docs/5.0/templates): You do not need to manually verify the CSRF token on POST, PUT, or DELETE requests. The `VerifyCsrfToken` [HTTP middleware](/docs/5.0/middleware) will verify token in the request input matches the token stored in the session. -In addition to looking for the CSRF token as a "POST" parameter, the middleware will also check for the `X-XSRF-TOKEN` request header, which is commonly used by JavaScript frameworks. +In addition to looking for the CSRF token as a "POST" parameter, the middleware will also check for the `X-CSRF-TOKEN` request header. You could, for example, store the token in a meta-tag and use jQuery to add it to your headers before sending: + + + + $.ajax({ + url: "/foo/bar", + beforeSend: function( xhr ) { + xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')) + } + }) + +Laravel also stores the CSRF token in a `XSRF-TOKEN` cookie. You can use the cookie value to set the `X-XSRF-TOKEN` request header. Some Javascript frameworks, like Angular, do this automatically for you. + +> Note: The difference between the `X-CSRF-TOKEN` and `X-XSRF-TOKEN` is that the first uses a plain text value and the latter uses an encrypted value, because cookies in Laravel are always encrypted. If you use the `csrf_token()` function to supply the token value, your probably want to use the `X-CSRF-TOKEN` header. ## Method Spoofing From dfce193f3c70368b71ac9c2f3cfefd585687aa1f Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Fri, 20 Feb 2015 18:30:34 +0100 Subject: [PATCH 016/276] Update routing.md --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index 10be27706b8..23716c0f35f 100644 --- a/routing.md +++ b/routing.md @@ -86,7 +86,7 @@ In addition to looking for the CSRF token as a "POST" parameter, the middleware Laravel also stores the CSRF token in a `XSRF-TOKEN` cookie. You can use the cookie value to set the `X-XSRF-TOKEN` request header. Some Javascript frameworks, like Angular, do this automatically for you. -> Note: The difference between the `X-CSRF-TOKEN` and `X-XSRF-TOKEN` is that the first uses a plain text value and the latter uses an encrypted value, because cookies in Laravel are always encrypted. If you use the `csrf_token()` function to supply the token value, your probably want to use the `X-CSRF-TOKEN` header. +> Note: The difference between the `X-CSRF-TOKEN` and `X-XSRF-TOKEN` is that the first uses a plain text value and the latter uses an encrypted value, because cookies in Laravel are always encrypted. If you use the `csrf_token()` function to supply the token value, you probably want to use the `X-CSRF-TOKEN` header. ## Method Spoofing From 5b0bfc8728c331051bc51634a1139a7fd6561735 Mon Sep 17 00:00:00 2001 From: kickofitall Date: Sat, 21 Feb 2015 01:10:47 +0100 Subject: [PATCH 017/276] example not working pattern from createMatcher() leads to: echo ($var)->format('m/d/Y H:i') what's not working pattern from createOpenMatcher() with the additional brace leads to: echo ($var->format('m/d/Y H:i')) --- templates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.md b/templates.md index 5821185df5e..ae89cc6d63e 100644 --- a/templates.md +++ b/templates.md @@ -151,7 +151,7 @@ The following example creates a `@datetime($var)` directive which simply calls ` Blade::extend(function($view, $compiler) { - $pattern = $compiler->createMatcher('datetime'); + $pattern = $compiler->createOpenMatcher('datetime'); - return preg_replace($pattern, '$1format(\'m/d/Y H:i\'); ?>', $view); + return preg_replace($pattern, '$1format(\'m/d/Y H:i\')); ?>', $view); }); From bd83ff90c6acad0436f7e8788757d4abb7eb9a58 Mon Sep 17 00:00:00 2001 From: Hari K T Date: Sat, 21 Feb 2015 10:24:16 +0530 Subject: [PATCH 018/276] Fix route name to photo --- controllers.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/controllers.md b/controllers.md index c97f8da2ec7..f44590f50dd 100644 --- a/controllers.md +++ b/controllers.md @@ -150,15 +150,15 @@ This single route declaration creates multiple routes to handle a variety of RES #### Actions Handled By Resource Controller -Verb | Path | Action | Route Name -----------|-----------------------------|--------------|--------------------- -GET | /resource | index | resource.index -GET | /resource/create | create | resource.create -POST | /resource | store | resource.store -GET | /resource/{resource} | show | resource.show -GET | /resource/{resource}/edit | edit | resource.edit -PUT/PATCH | /resource/{resource} | update | resource.update -DELETE | /resource/{resource} | destroy | resource.destroy +Verb | Path | Action | Route Name +----------|-----------------------|--------------|--------------------- +GET | /photo | index | photo.index +GET | /photo/create | create | photo.create +POST | /photo | store | photo.store +GET | /photo/{photo} | show | photo.show +GET | /photo/{photo}/edit | edit | photo.edit +PUT/PATCH | /photo/{photo} | update | photo.update +DELETE | /photo/{photo} | destroy | photo.destroy #### Customizing Resource Routes From 43558de5e5d96bf2e42a73eda70d0d4d41e40e41 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Sun, 22 Feb 2015 01:27:55 +1100 Subject: [PATCH 019/276] Update routing.md --- routing.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/routing.md b/routing.md index 23716c0f35f..182ba1db7ee 100644 --- a/routing.md +++ b/routing.md @@ -77,11 +77,16 @@ In addition to looking for the CSRF token as a "POST" parameter, the middleware + $.ajaxSetup({ + headers: { + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') + } + }); + +Now anytime you use an ajax query the CSRF token will automatically be included in your ajax header - no need for any code changes to your individual functions: + $.ajax({ - url: "/foo/bar", - beforeSend: function( xhr ) { - xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')) - } + url: "/foo/bar", }) Laravel also stores the CSRF token in a `XSRF-TOKEN` cookie. You can use the cookie value to set the `X-XSRF-TOKEN` request header. Some Javascript frameworks, like Angular, do this automatically for you. From bf3bdb2d38a2d24793bc41159a5aca2cb4775401 Mon Sep 17 00:00:00 2001 From: Matthew Machuga Date: Sat, 21 Feb 2015 23:35:07 -0500 Subject: [PATCH 020/276] Adding Bus Dispatcher to the Contracts reference Noticed this was missing while I was reviewing things, so just adding it in. --- contracts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts.md b/contracts.md index 93df76458e2..4a7417950f3 100644 --- a/contracts.md +++ b/contracts.md @@ -103,6 +103,7 @@ Contract | Laravel 4.x Facade ------------- | ------------- [Illuminate\Contracts\Auth\Guard](https://github.com/illuminate/contracts/blob/master/Auth/Guard.php) | Auth [Illuminate\Contracts\Auth\PasswordBroker](https://github.com/illuminate/contracts/blob/master/Auth/PasswordBroker.php) | Password +[Illuminate\Contracts\Bus\Dispatcher](https://github.com/illuminate/contracts/blob/master/Bus/Dispatcher.php) | Bus [Illuminate\Contracts\Cache\Repository](https://github.com/illuminate/contracts/blob/master/Cache/Repository.php) | Cache [Illuminate\Contracts\Cache\Factory](https://github.com/illuminate/contracts/blob/master/Cache/Factory.php) | Cache::driver() [Illuminate\Contracts\Config\Repository](https://github.com/illuminate/contracts/blob/master/Config/Repository.php) | Config From acf6281fca1703a5a879d87c52bd58f16f4fd4fa Mon Sep 17 00:00:00 2001 From: hfingler Date: Sun, 22 Feb 2015 23:07:31 -0400 Subject: [PATCH 021/276] Exclude @handle from the registering event example The current example of registering event handlers has a @handle after the name of the handler class ('App\Handlers\Events\EmailPurchaseConfirmation@handle'). If you put this in the EventServiceProvider file and run the 'event:generate' artisan command you actually get a file named 'EmailPurchaseConfirmation@handle.php' in the Handlers/Events directory with a class with the same name (which cannot happen). Everything is fixed if you remove the @handle. Tried it on a clean laravel project, fired the event in artisan's tinker and the event was correctly handled by the @handle method that was created automatically. --- events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events.md b/events.md index 5db87ee2b33..c260e378b3c 100644 --- a/events.md +++ b/events.md @@ -24,7 +24,7 @@ The `EventServiceProvider` included with your Laravel application provides a con */ protected $listen = [ 'App\Events\PodcastWasPurchased' => [ - 'App\Handlers\Events\EmailPurchaseConfirmation@handle', + 'App\Handlers\Events\EmailPurchaseConfirmation', ], ]; From da133141eb744e692631eb7b4c26521eba3b9ceb Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 23 Feb 2015 09:48:12 -0600 Subject: [PATCH 022/276] Work on some docs. --- routing.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/routing.md b/routing.md index 182ba1db7ee..01dcb2ae538 100644 --- a/routing.md +++ b/routing.md @@ -73,22 +73,26 @@ Of course, using the Blade [templating engine](/docs/5.0/templates): You do not need to manually verify the CSRF token on POST, PUT, or DELETE requests. The `VerifyCsrfToken` [HTTP middleware](/docs/5.0/middleware) will verify token in the request input matches the token stored in the session. -In addition to looking for the CSRF token as a "POST" parameter, the middleware will also check for the `X-CSRF-TOKEN` request header. You could, for example, store the token in a meta-tag and use jQuery to add it to your headers before sending: +#### X-CSRF-TOKEN + +In addition to looking for the CSRF token as a "POST" parameter, the middleware will also check for the `X-CSRF-TOKEN` request header. You could, for example, store the token in a "meta" tag and instruct jQuery to add it to all request headers: - + $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); - -Now anytime you use an ajax query the CSRF token will automatically be included in your ajax header - no need for any code changes to your individual functions: + +Now all AJAX requests will automatically include the CSRF token: $.ajax({ url: "/foo/bar", }) +#### X-XSRF-TOKEN + Laravel also stores the CSRF token in a `XSRF-TOKEN` cookie. You can use the cookie value to set the `X-XSRF-TOKEN` request header. Some Javascript frameworks, like Angular, do this automatically for you. > Note: The difference between the `X-CSRF-TOKEN` and `X-XSRF-TOKEN` is that the first uses a plain text value and the latter uses an encrypted value, because cookies in Laravel are always encrypted. If you use the `csrf_token()` function to supply the token value, you probably want to use the `X-CSRF-TOKEN` header. From cde2993e1c415c1ff83650599b188fadce6c0cf8 Mon Sep 17 00:00:00 2001 From: Fernando Montoya Date: Mon, 23 Feb 2015 19:14:16 -0500 Subject: [PATCH 023/276] Added Elixir documentation to scripts and styles tasks --- elixir.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/elixir.md b/elixir.md index 43abd3ac194..94611540f9b 100644 --- a/elixir.md +++ b/elixir.md @@ -247,6 +247,14 @@ Now that you've told Elixir which tasks to execute, you only need to trigger Gul gulp watch +#### Only compile scripts + + gulp scripts + +#### Only compile styles + + gulp styles + #### Watch Tests And PHP Classes for Changes gulp tdd From e6ec2a5c0877a4a02d45b9d3e357d3431e2a6d28 Mon Sep 17 00:00:00 2001 From: tomhorvat Date: Tue, 24 Feb 2015 16:21:03 +0100 Subject: [PATCH 024/276] Update controllers.md --- controllers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers.md b/controllers.md index f44590f50dd..64a45742b69 100644 --- a/controllers.md +++ b/controllers.md @@ -203,7 +203,7 @@ This route will register a "nested" resource that may be accessed with URLs like If it becomes necessary to add additional routes to a resource controller beyond the default resource routes, you should define those routes before your call to `Route::resource`: - Route::get('photos/popular'); + Route::get('photos/popular', 'PhotoController@method'); Route::resource('photos', 'PhotoController'); From 37425de5c2c07b00289947f5fb9e790826205523 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 12:13:50 -0600 Subject: [PATCH 025/276] Caps. --- elixir.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elixir.md b/elixir.md index 94611540f9b..32ef46acaae 100644 --- a/elixir.md +++ b/elixir.md @@ -247,11 +247,11 @@ Now that you've told Elixir which tasks to execute, you only need to trigger Gul gulp watch -#### Only compile scripts +#### Only Compile Scripts gulp scripts -#### Only compile styles +#### Only Compile Styles gulp styles From 80a81ec0658f156ee15ef39b811e3d46dd0ae48e Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 12:18:35 -0600 Subject: [PATCH 026/276] Wording. --- middleware.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/middleware.md b/middleware.md index 7d84cf56870..b9e9b345e9f 100644 --- a/middleware.md +++ b/middleware.md @@ -50,40 +50,38 @@ As you can see, if the given `age` is less than `200`, the middleware will retur It's best to envision middleware as a series of "layers" HTTP requests must pass through before they hit your application. Each layer can examine the request and even reject it entirely. -### *Before* vs *after* middleware +### *Before* / *After* Middleware -Whether a middleware runs *before* or *after* a request has been processed depends on how it performs its action: +Whether a middleware runs before or after a request depends on the middleware itself. This middleware would perform some task **before** the request is handled by the application: ## Registering Middleware From 06b752744681558a852457a0d83de439be55573f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 12:21:48 -0600 Subject: [PATCH 027/276] Document session helper. --- session.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/session.md b/session.md index 340653dcc17..6635409c3a5 100644 --- a/session.md +++ b/session.md @@ -24,10 +24,16 @@ The Laravel framework uses the `flash` session key internally, so you should not ## Session Usage +The session may be accessed in several ways, via the HTTP request's `session` method, the `Session` facade, or the `session` helper function. When the `session` helper is called without arguments, it will return the entire session object. For example: + + session()->regenerate(); + #### Storing An Item In The Session Session::put('key', 'value'); + session(['key' => 'value']); + #### Push A Value Onto An Array Session Value Session::push('user.teams', 'developers'); @@ -36,6 +42,8 @@ The Laravel framework uses the `flash` session key internally, so you should not $value = Session::get('key'); + $value = session('key'); + #### Retrieving An Item Or Returning A Default Value $value = Session::get('key', 'default'); From a60d82799272993cb0adb506ff1219b4b8bdc115 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 12:22:47 -0600 Subject: [PATCH 028/276] Wording. --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 4cfb0ba98b2..bb0cad92682 100644 --- a/homestead.md +++ b/homestead.md @@ -152,7 +152,7 @@ To connect to your MySQL or Postgres database from your main machine via Navicat ### Adding Additional Sites -Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. There are two ways to do this: First, you may simply add the sites to your `Homestead.yaml` file and then run `homestead provision`. +Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. There are two ways to do this: First, you may simply add the sites to your `Homestead.yaml` file and then run `homestead provision` or `vagrant provision`. Alternatively, you may use the `serve` script that is available on your Homestead environment. To use the `serve` script, SSH into your Homestead environment and run the following command: From a2d790a3bfe4e62750f89dff06b7180874850dff Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 12:23:37 -0600 Subject: [PATCH 029/276] Wording. --- homestead.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/homestead.md b/homestead.md index 5963e9ef3ea..04986d04f24 100644 --- a/homestead.md +++ b/homestead.md @@ -98,9 +98,7 @@ Once you have created a SSH key, specify the key's path in the `authorize` prope The `folders` property of the `Homestead.yaml` file lists all of the folders you wish to share with your Homestead environment. As files within these folders are changed, they will be kept in sync between your local machine and the Homestead environment. You may configure as many shared folders as necessary! -#### Enabling NFS synced folders - -To enable [NFS](http://docs.vagrantup.com/v2/synced-folders/nfs.html), just add the `type: "nfs"` flag onto your synced folder: +To enable [NFS](http://docs.vagrantup.com/v2/synced-folders/nfs.html), just add a simple flag to your synced folder: folders: - map: ~/Code From 8fc9b8eff431523f765a319f070f71bfc2c48189 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 12:40:08 -0600 Subject: [PATCH 030/276] Ports docs. --- homestead.md | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/homestead.md b/homestead.md index ad1da991df5..a52f97c4cc2 100644 --- a/homestead.md +++ b/homestead.md @@ -177,19 +177,13 @@ The following ports are forwarded to your Homestead environment: - **MySQL:** 33060 → Forwards To 3306 - **Postgres:** 54320 → Forwards To 5432 -### Adding Additional Port Forwarding Settings +### Adding Additional Ports -Should you add additional services to the vagrant box. You may wish to overwrite the default port settings or add additional port forwarding settings to the vagrant box, to allow for additional remote access from the host machine. - -The `ports` property can be used to define additional port settings, by specifying the guest and host port numbers. You also have the option to specify the protocol setting either `tcp` or `udp` as demonstrated below: +If you wish, you may forward additional ports to the Vagrant box, as well as specify their protocol: ports: - - guest: 80 - host: 8080 - - guest: 1028 - host: 1028 - - guest: 443 - host: 44500 + - send: 93000 + to: 9300 + - send: 7777 + to: 777 protocol: udp - -> **Note:** The default port configurations settings detailed above remain however should you required they can be overridden using the custom setup. \ No newline at end of file From 335492a1c92d00bd9094ac30cfaca09ae5f33074 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 13:10:50 -0600 Subject: [PATCH 031/276] cleaning up docs. --- filesystem.md | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/filesystem.md b/filesystem.md index 7c12cad69a4..008536c72ca 100644 --- a/filesystem.md +++ b/filesystem.md @@ -110,37 +110,33 @@ The `Storage` facade may be used to interact with any of your configured disks. ## Custom Filesystems -Laravel's Flysystem integration provides drivers for local filesystems, Amazon S3, and Rackspace Cloud Storage. Flysystem is not limited to these and has adapters for many additional storage systems. If you want to use one of these additional adapters in your Laravel application, you'll want to create a custom driver. -In order to set up your custom filesystem you'll need to create a Service Provider (for example, `DropboxFilesystemServiceProvider`). In its `boot` method, you'll want to inject an instance of the `Illuminate\Contracts\Filesystem\Factory` contract, and then call the `extend` method of the injected instance. +Laravel's Flysystem integration provides drivers for several "drivers" out of the box; however, Flysystem is not limited to these and has adapters for many other storage systems. You can create a custom driver if you want to use one of these additional adapters in your Laravel application. Don't worry, it's not too hard! -The first argument of the `extend` method is the name of the driver you will use, while the second argument is a closure that gets passed both the `$app` and `$config` variables. +In order to set up the custom filesystem you will need to create a service provider such as `DropboxFilesystemServiceProvider`. In the provider's `boot` method, you can inject an instance of the `Illuminate\Contracts\Filesystem\Factory` contract and call the `extend` method of the injected instance. Alternatively, You may use the `Disk` facade's `extend` method. -From this closure you must return an instance of `League\Flysystem\Filesystem`. Use the details provided with each filesystem to set this up. +The first argument of the `extend` method is the name of the driver and the second is a Closure that receives the `$app` and `$config` variables. The resolver Closure must return an instance of `League\Flysystem\Filesystem`. -> **Note:** The $config variable will already contain the proper values defined in `config/filesystems.php` for the provided disk. - -Visit [Flysystem](https://github.com/thephpleague/flysystem#adapters) to view a list of available filesystems. +> **Note:** The $config variable will already contain the values defined in `config/filesystems.php` for the specified disk. #### Dropbox Example extend('dropbox', function($app, $config) + Disk::extend('dropbox', function($app, $config) { - $client = new Client($config['accessToken'], $config['clientIdentifier']); - $adapter = new DropboxAdapter($client); - - return new Filesystem($adapter); + $client = new DropboxClient($config['accessToken'], $config['clientIdentifier']); + + return new Filesystem(new DropboxAdapter($client)); }); } From c451efa159da8e374dea466042d06f450d0ab3d8 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 13:30:05 -0600 Subject: [PATCH 032/276] Add docs. --- eloquent.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eloquent.md b/eloquent.md index b98c8aa2f0f..6b5fcb1a75f 100644 --- a/eloquent.md +++ b/eloquent.md @@ -900,6 +900,13 @@ It is also possible to eagerly load related models directly from an already exis $books->load('author', 'publisher'); +You may also pass a Closure to set constraints on the query: + + $books->load(['author' => function($query) + { + $query->orderBy('published_date', 'asc'); + }]); + ## Inserting Related Models From 77b555a10b132a40fe1f78ae658674cc26b8c95a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 13:31:47 -0600 Subject: [PATCH 033/276] Discuss route::controller naming. --- controllers.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controllers.md b/controllers.md index 64a45742b69..80dac3aa798 100644 --- a/controllers.md +++ b/controllers.md @@ -135,6 +135,14 @@ If your controller action contains multiple words, you may access the action usi public function getAdminProfile() {} +#### Assigning Route Names + +If you would like to "name" some of the routes on the controller, you may pass a third argument to the `controller` method: + + Route::controller('users', 'UserController', [ + 'anyLogin' => 'user.login', + ]); + ## RESTful Resource Controllers From 9a8889aa91210bd2c0ec4e15aa3c159d2e43feca Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 13:50:26 -0600 Subject: [PATCH 034/276] Snake case. --- eloquent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eloquent.md b/eloquent.md index 6b5fcb1a75f..db23bd3492a 100644 --- a/eloquent.md +++ b/eloquent.md @@ -42,7 +42,7 @@ You may also generate Eloquent models using the `make:model` command: php artisan make:model User -Note that we did not tell Eloquent which table to use for our `User` model. The lower-case, plural name of the class will be used as the table name unless another name is explicitly specified. So, in this case, Eloquent will assume the `User` model stores records in the `users` table. You may specify a custom table by defining a `table` property on your model: +Note that we did not tell Eloquent which table to use for our `User` model. The "snake case" name of the class will be used as the table name unless another name is explicitly specified. So, in this case, Eloquent will assume the `User` model stores records in the `users` table. You may specify a custom table by defining a `table` property on your model: class User extends Model { From a8ab80b8ba7a353e16508b1d1f5a567e2634e2ce Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 13:56:27 -0600 Subject: [PATCH 035/276] URL generation. --- eloquent.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/eloquent.md b/eloquent.md index db23bd3492a..7c64093627a 100644 --- a/eloquent.md +++ b/eloquent.md @@ -20,6 +20,7 @@ - [Attribute Casting](#attribute-casting) - [Model Events](#model-events) - [Model Observers](#model-observers) +- [Model URL Generation](#model-url-generation) - [Converting To Arrays / JSON](#converting-to-arrays-or-json) @@ -1292,6 +1293,22 @@ You may register an observer instance using the `observe` method: User::observe(new UserObserver); + +## Model URL Generation + +When you pass a model to the `route` or `action` methods, it's primary key is inserted into the generated URI. For example: + + Route::get('user/{user}', 'UserController@show'); + + action('UserController@show', [$user]); + +In this example the `$user->id` property will be inserted into the `{user}` place-holder of the generated URL. However, if you would like to use another property instead of the ID, you may override the `getRouteKey` method on your model: + + public function getRouteKey() + { + return $this->slug; + } + ## Converting To Arrays / JSON From 443a59d98c36e2e46cfdfda2e028c1dd1106a865 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Feb 2015 14:14:25 -0600 Subject: [PATCH 036/276] cleaning up. --- packages.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages.md b/packages.md index 337d55b71b8..cc1e70a1e74 100644 --- a/packages.md +++ b/packages.md @@ -4,7 +4,7 @@ - [Views](#views) - [Translations](#translations) - [Configuration](#configuration) -- [Public assets](#public-assets) +- [Public Assets](#public-assets) - [Publishing File Groups](#publishing-file-groups) - [Routing](#routing) @@ -106,21 +106,19 @@ You may also choose to merge your own package configuration file with the applic ); -## Public assets +## Public Assets -Some packages may have assets such as JavaScript, CSS, and images. However, we are unable to link to assets in the vendor or workbench directories, so we need a way to move these assets into the public directory of our application. - -To publish assets, use the `publishes` method from the `boot` method of your service provider, with the `public` tag: +Your packages may have assets such as JavaScript, CSS, and images. To publish assets, use the `publishes` method from your service provider's `boot` method. In this example, we will also add a "public" asset group tag. $this->publishes([ __DIR__.'/path/to/assets' => public_path('vendor/courier'), ], 'public'); -Now, when users of your package execute Laravel's `vendor:publish` command, your file will be copied to the specified location. You usually want to overwrite the public assets every time the package is updated, so you can use the `--force` flag for the `public` tag: +Now, when your package's users execute the `vendor:publish` command, your files will be copied to the specified location. Since you typically will need to overwrite the assets every time the package is updated, you may use the `--force` flag: php artisan vendor:publish --tag=public --force -To make sure your public assets are always up-to-date, you might want to add that command to the `post-update-cmd` commands in your `composer.json`. +If you would like to make sure your public assets are always up-to-date, you can add this command to the `post-update-cmd` list in your `composer.json` file. ## Publishing File Groups From f74aac1c7049c6704245a526ecce2f9f74674824 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 00:13:55 -0600 Subject: [PATCH 037/276] Update commands.md --- commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands.md b/commands.md index e37f189eb0d..8aac98c4925 100644 --- a/commands.md +++ b/commands.md @@ -122,4 +122,4 @@ Sometimes you may wish to call other commands from your command. You may do so u #### Registering An Artisan Command -Once your command is finished, you need to register it with Artisan so it will be available for use. This is typically done in the `app/Console/Kernel.php` file. Within this file, you will find a list of commands in the `commands` property. To register your command, simply add it to this list. When Artisan boots, all the commands listed in this property will be resolved by the [IoC container](/docs/5.0/container) and registered with Artisan. +Once your command is finished, you need to register it with Artisan so it will be available for use. This is typically done in the `app/Console/Kernel.php` file. Within this file, you will find a list of commands in the `commands` property. To register your command, simply add it to this list. When Artisan boots, all the commands listed in this property will be resolved by the [service container](/docs/5.0/container) and registered with Artisan. From ef1111eb65856275fc93adcca1d79a2555c18d84 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 25 Feb 2015 08:45:55 +0200 Subject: [PATCH 038/276] Typo --- billing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/billing.md b/billing.md index 460119f2136..6e999ebc434 100644 --- a/billing.md +++ b/billing.md @@ -123,7 +123,7 @@ Sometimes subscriptions are affected by "quantity". For example, your applicatio // Add five to the subscription's current quantity... $user->subscription()->increment(5); - $user->subscription->decrement(); + $user->subscription()->decrement(); // Subtract five to the subscription's current quantity... $user->subscription()->decrement(5); From a6bff3332dea667c2a3e43d6dff867d98339d1b4 Mon Sep 17 00:00:00 2001 From: Jean Rumeau Date: Wed, 25 Feb 2015 11:55:41 -0400 Subject: [PATCH 039/276] correct variable name, and update reject callback Wrong variable name inside the callback, and replaced is_null with empty function because strtoupper function applied before returned an empty string when applied to null values, therefore is_null wont reject after strtoupper. --- collections.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collections.md b/collections.md index 1d09c70ac26..a006a157897 100644 --- a/collections.md +++ b/collections.md @@ -14,7 +14,7 @@ The `Illuminate\Support\Collection` class provides a fluent, convenient wrapper }) ->reject(function($name) { - return is_null($value); + return empty($name); }); From bf3642d31310a82538789a922b01c6c194ec344b Mon Sep 17 00:00:00 2001 From: lifesign Date: Thu, 26 Feb 2015 00:54:53 +0800 Subject: [PATCH 040/276] fix ViewComposer directory name --- views.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views.md b/views.md index 1613a7f5b64..904d5b1babe 100644 --- a/views.md +++ b/views.md @@ -111,11 +111,11 @@ Let's organize our view composers within a [service provider](/docs/5.0/provider } -> **Note:** Laravel does not include a default directory for view composers. You are free to organize them however you wish. For example, you could create an `App\Http\Composers` directory. +> **Note:** Laravel does not include a default directory for view composers. You are free to organize them however you wish. For example, you could create an `App\Http\ViewComposers` directory. Now that we have registered the composer, the `ProfileComposer@compose` method will be executed each time the `profile` view is being rendered. So, let's define the composer class: - Date: Wed, 25 Feb 2015 10:56:09 -0600 Subject: [PATCH 041/276] Blackfire documentation. --- homestead.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/homestead.md b/homestead.md index a52f97c4cc2..b3c4cd21cd1 100644 --- a/homestead.md +++ b/homestead.md @@ -5,6 +5,7 @@ - [Installation & Setup](#installation-and-setup) - [Daily Usage](#daily-usage) - [Ports](#ports) +- [Blackfire Profiler](#blackfire-profiler) ## Introduction @@ -187,3 +188,14 @@ If you wish, you may forward additional ports to the Vagrant box, as well as spe - send: 7777 to: 777 protocol: udp + + +## Blackfire Profiler + +[Blackfire Profiler](https://blackfire.io) by SensioLabs automatically gathers data about your code's execution, such as RAM, CPU time, and disk I/O. Homestead makes it a breeze to use this profiler for your own applications. All of the proper packages have already been installed on your Homestead box, you simply need to set a Blackfire ID and token in your `Homestead.yaml` file: + + blackfire: + - id: your-id + token: your-token + +Once you have configured your Blackfire credentials, simply re-provision the box using `homestead provision` or `vagrant provision`. Of course, be sure to review the [Blackfire documentation](https://blackfire.io/getting-started) to learn how to install the Blackfire companion extension for your web browser. From ce5b4d5459a41a9bffa102e87f34d78c4ec0436a Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 12:23:28 -0600 Subject: [PATCH 042/276] Service container --- facades.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facades.md b/facades.md index 3f8198c3d7c..3ce8b283c03 100644 --- a/facades.md +++ b/facades.md @@ -10,7 +10,7 @@ ## Introduction -Facades provide a "static" interface to classes that are available in the application's [IoC container](/docs/5.0/container). Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the IoC container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods. +Facades provide a "static" interface to classes that are available in the application's [IoC container](/docs/5.0/container). Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods. Occasionally, you may wish to create your own facades for your application's and packages, so let's explore the concept, development and usage of these classes. From a6a3874348a83305c298a57ac0e78e88412e9073 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 12:28:46 -0600 Subject: [PATCH 043/276] Service container --- extending.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extending.md b/extending.md index 03b554c90e7..971f57015ac 100644 --- a/extending.md +++ b/extending.md @@ -25,7 +25,7 @@ To extend the Laravel cache facility, we will use the `extend` method on the `Ca return Cache::repository(new MongoStore); }); -The first argument passed to the `extend` method is the name of the driver. This will correspond to your `driver` option in the `config/cache.php` configuration file. The second argument is a Closure that should return an `Illuminate\Cache\Repository` instance. The Closure will be passed an `$app` instance, which is an instance of `Illuminate\Foundation\Application` and an IoC container. +The first argument passed to the `extend` method is the name of the driver. This will correspond to your `driver` option in the `config/cache.php` configuration file. The second argument is a Closure that should return an `Illuminate\Cache\Repository` instance. The Closure will be passed an `$app` instance, which is an instance of `Illuminate\Foundation\Application` and a service container. The call to `Cache::extend` could be done in the `boot` method of the default `App\Providers\AppServiceProvider` that ships with fresh Laravel applications, or you may create your own service provider to house the extension - just don't forget to register the provider in the `config/app.php` provider array. From 4dd8b0d0145a5770091892eaeeac2c7455600e32 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 12:30:32 -0600 Subject: [PATCH 044/276] Service container --- extending.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extending.md b/extending.md index 971f57015ac..ebdfed5c23c 100644 --- a/extending.md +++ b/extending.md @@ -4,7 +4,7 @@ - [Cache](#cache) - [Session](#session) - [Authentication](#authentication) -- [IoC Based Extension](#ioc-based-extension) +- [Service Container Based Extension](#container-based-extension) ## Managers & Factories @@ -158,8 +158,8 @@ Finally, once we have implemented the `UserProvider`, we are ready to register o After you have registered the driver with the `extend` method, you switch to the new driver in your `config/auth.php` configuration file. - -## IoC Based Extension + +## Service Container Based Extension Almost every service provider included with the Laravel framework binds objects into the IoC container. You can find a list of your application's service providers in the `config/app.php` configuration file. As you have time, you should skim through each of these provider's source code. By doing so, you will gain a much better understanding of what each provider adds to the framework, as well as what keys are used to bind various services into the IoC container. From 7565343098a14a71d5c87b1f6bc79a1a8024de14 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 12:32:34 -0600 Subject: [PATCH 045/276] Service container --- extending.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extending.md b/extending.md index ebdfed5c23c..a216e836cd8 100644 --- a/extending.md +++ b/extending.md @@ -161,9 +161,9 @@ After you have registered the driver with the `extend` method, you switch to the ## Service Container Based Extension -Almost every service provider included with the Laravel framework binds objects into the IoC container. You can find a list of your application's service providers in the `config/app.php` configuration file. As you have time, you should skim through each of these provider's source code. By doing so, you will gain a much better understanding of what each provider adds to the framework, as well as what keys are used to bind various services into the IoC container. +Almost every service provider included with the Laravel framework binds objects into the service container. You can find a list of your application's service providers in the `config/app.php` configuration file. As you have time, you should skim through each of these provider's source code. By doing so, you will gain a much better understanding of what each provider adds to the framework, as well as what keys are used to bind various services into the service container. -For example, the `HashServiceProvider` binds a `hash` key into the IoC container, which resolves into a `Illuminate\Hashing\BcryptHasher` instance. You can easily extend and override this class within your own application by overriding this IoC binding. For example: +For example, the `HashServiceProvider` binds a `hash` key into the service container, which resolves into a `Illuminate\Hashing\BcryptHasher` instance. You can easily extend and override this class within your own application by overriding this binding. For example: Date: Wed, 25 Feb 2015 12:33:52 -0600 Subject: [PATCH 046/276] Service container --- bus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bus.md b/bus.md index c001454f2bf..9e988e09c8c 100644 --- a/bus.md +++ b/bus.md @@ -55,7 +55,7 @@ The newly generated class will be placed in the `app/Commands` directory. By def } -The `handle` method may also type-hint dependencies, and they will be automatically injected by the [IoC container](/docs/5.0/container). For example: +The `handle` method may also type-hint dependencies, and they will be automatically injected by the [service container](/docs/5.0/container). For example: /** * Execute the command. From 0858f4cc3fe74a794e772548fab25dff3467886a Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 12:59:05 -0600 Subject: [PATCH 047/276] Service container --- testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing.md b/testing.md index dfcef1dbdce..62748c65e8b 100644 --- a/testing.md +++ b/testing.md @@ -205,4 +205,4 @@ More information on creating seeds may be found in the [migrations and seeding]( ## Refreshing The Application -As you may already know, you can access your Laravel `Application` / IoC Container via `$this->app` from any test method. This Application instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. +As you may already know, you can access your Laravel `Application` / service container via `$this->app` from any test method. This Application instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. From ebf52db287eab539884e4d4940e22f81e4313bf4 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 12:59:43 -0600 Subject: [PATCH 048/276] Update testing.md --- testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing.md b/testing.md index 62748c65e8b..1e24acc05b2 100644 --- a/testing.md +++ b/testing.md @@ -205,4 +205,4 @@ More information on creating seeds may be found in the [migrations and seeding]( ## Refreshing The Application -As you may already know, you can access your Laravel `Application` / service container via `$this->app` from any test method. This Application instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. +As you may already know, you can access your Laravel `Application` / [service container](/docs/5.0/container) via `$this->app` from any test method. This Application instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. From 9b6e4fdfdea25076b6aa4643a502867b4857910a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Feb 2015 12:59:44 -0600 Subject: [PATCH 049/276] Docs. --- homestead.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index b3c4cd21cd1..91fb9eba254 100644 --- a/homestead.md +++ b/homestead.md @@ -192,7 +192,9 @@ If you wish, you may forward additional ports to the Vagrant box, as well as spe ## Blackfire Profiler -[Blackfire Profiler](https://blackfire.io) by SensioLabs automatically gathers data about your code's execution, such as RAM, CPU time, and disk I/O. Homestead makes it a breeze to use this profiler for your own applications. All of the proper packages have already been installed on your Homestead box, you simply need to set a Blackfire ID and token in your `Homestead.yaml` file: +[Blackfire Profiler](https://blackfire.io) by SensioLabs automatically gathers data about your code's execution, such as RAM, CPU time, and disk I/O. Homestead makes it a breeze to use this profiler for your own applications. + +All of the proper packages have already been installed on your Homestead box, you simply need to set a Blackfire ID and token in your `Homestead.yaml` file: blackfire: - id: your-id From e6dd4233dddfd4bd929a504c6ae7c203506dd130 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 13:00:44 -0600 Subject: [PATCH 050/276] Update testing.md --- testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing.md b/testing.md index 1e24acc05b2..dde94f6b858 100644 --- a/testing.md +++ b/testing.md @@ -205,4 +205,4 @@ More information on creating seeds may be found in the [migrations and seeding]( ## Refreshing The Application -As you may already know, you can access your Laravel `Application` / [service container](/docs/5.0/container) via `$this->app` from any test method. This Application instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. +As you may already know, you can access your Application ([service container](/docs/5.0/container)) via `$this->app` from any test method. This Application (service container) instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. From 13f58e341310761ef97a7123fc186e5c45342f48 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 13:01:09 -0600 Subject: [PATCH 051/276] Update testing.md --- testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing.md b/testing.md index dde94f6b858..ffb5648aa45 100644 --- a/testing.md +++ b/testing.md @@ -205,4 +205,4 @@ More information on creating seeds may be found in the [migrations and seeding]( ## Refreshing The Application -As you may already know, you can access your Application ([service container](/docs/5.0/container)) via `$this->app` from any test method. This Application (service container) instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. +As you may already know, you can access your Application ([service container](/docs/5.0/container)) via `$this->app` from any test method. This service container instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. From 9b60fd40432d53da9d9c643f782962072e010388 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 13:01:58 -0600 Subject: [PATCH 052/276] Update filesystem.md --- filesystem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem.md b/filesystem.md index 008536c72ca..25116c681b8 100644 --- a/filesystem.md +++ b/filesystem.md @@ -29,7 +29,7 @@ When using the `local` driver, note that all file operations are relative to the ## Basic Usage -The `Storage` facade may be used to interact with any of your configured disks. Alternatively, you may type-hint the `Illuminate\Contracts\Filesystem\Factory` contract on any class that is resolved via the [IoC container](/docs/5.0/container). +The `Storage` facade may be used to interact with any of your configured disks. Alternatively, you may type-hint the `Illuminate\Contracts\Filesystem\Factory` contract on any class that is resolved via the [service container](/docs/5.0/container). #### Retrieving A Particular Disk From 99f0e2e7b7e9a11a805d2deb37751b2876d87e5a Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 13:02:59 -0600 Subject: [PATCH 053/276] Service container --- filesystem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem.md b/filesystem.md index 25116c681b8..0df8b29b0c1 100644 --- a/filesystem.md +++ b/filesystem.md @@ -29,7 +29,7 @@ When using the `local` driver, note that all file operations are relative to the ## Basic Usage -The `Storage` facade may be used to interact with any of your configured disks. Alternatively, you may type-hint the `Illuminate\Contracts\Filesystem\Factory` contract on any class that is resolved via the [service container](/docs/5.0/container). +The `Storage` facade may be used to interact with any of your configured disks. Alternatively, you may type-hint the `Illuminate\Contracts\Filesystem\Factory` contract on any class that is resolved via the Laravel [service container](/docs/5.0/container). #### Retrieving A Particular Disk From 80308c374ef88e9afe102f7bd1d19743a3fbe54b Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 13:03:31 -0600 Subject: [PATCH 054/276] Service container --- events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events.md b/events.md index c260e378b3c..ea09626a4af 100644 --- a/events.md +++ b/events.md @@ -137,7 +137,7 @@ Once the subscriber has been defined, it may be registered with the `Event` clas Event::subscribe($subscriber); -You may also use the [Laravel IoC container](/docs/5.0/container) to resolve your subscriber. To do so, simply pass the name of your subscriber to the `subscribe` method: +You may also use the [service container](/docs/5.0/container) to resolve your subscriber. To do so, simply pass the name of your subscriber to the `subscribe` method: Event::subscribe('UserEventHandler'); From 7e49d2b820c3ea08455239df2de022a3926f2336 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 13:04:09 -0600 Subject: [PATCH 055/276] Update queues.md --- queues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queues.md b/queues.md index a1d823cabfd..ffccc62153f 100644 --- a/queues.md +++ b/queues.md @@ -45,7 +45,7 @@ To push a new job onto the queue, use the `Queue::push` method: > **Note:** In this example, we are using the `Queue` facade directly; however, typically you would dispatch queued command via the [Command Bus](/docs/5.0/bus). We will continue to use the `Queue` facade throughout this page; however, familiarize with the command bus as well, since it is used to dispatch both queued and synchronous commands for your application. -By default, the `make:command` Artisan command generates a "self-handling" command, meaning a `handle` method is added to the command itself. This method will be called when the job is executed by the queue. You may type-hint any dependencies you need on the `handle` method and the [IoC container](/docs/5.0/container) will automatically inject them: +By default, the `make:command` Artisan command generates a "self-handling" command, meaning a `handle` method is added to the command itself. This method will be called when the job is executed by the queue. You may type-hint any dependencies you need on the `handle` method and the [service container](/docs/5.0/container) will automatically inject them: public function handle(UserRepository $users) { From 42f7ce0796f2f4d9003711f1ccf3689457729462 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 13:04:55 -0600 Subject: [PATCH 056/276] Service container --- packages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.md b/packages.md index cc1e70a1e74..96ae2cc64c1 100644 --- a/packages.md +++ b/packages.md @@ -22,7 +22,7 @@ All Laravel packages are distributed via [Packagist](http://packagist.org) and [ ## Views -Your package's internal structure is entirely up to you; however, typically each package will contain one or more [service providers](/docs/5.0/providers). The service provider contains any [IoC](/docs/5.0/container) bindings, as well as instructions as to where package configuration, views, and translation files are located. +Your package's internal structure is entirely up to you; however, typically each package will contain one or more [service providers](/docs/5.0/providers). The service provider contains any [service container](/docs/5.0/container) bindings, as well as instructions as to where package configuration, views, and translation files are located. ### Views From 015017cc1957c677f20ce1d5c8d9cd1e71135d41 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Wed, 25 Feb 2015 13:06:14 -0600 Subject: [PATCH 057/276] Service container --- releases.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/releases.md b/releases.md index b400cc69da8..7e1dcd10971 100644 --- a/releases.md +++ b/releases.md @@ -37,7 +37,7 @@ For more information on middleware, check out [the documentation](/docs/5.0/midd ### Controller Method Injection -In addition to the existing constructor injection, you may now type-hint dependencies on controller methods. The [IoC container](/docs/5.0/container) will automatically inject the dependencies, even if the route contains other parameters: +In addition to the existing constructor injection, you may now type-hint dependencies on controller methods. The [service container](/docs/5.0/container) will automatically inject the dependencies, even if the route contains other parameters: public function createPost(Request $request, PostRepository $posts) { @@ -205,7 +205,7 @@ Once the class has been defined, we can type-hint it on our controller action: var_dump($request->input()); } -When the Laravel IoC container identifies that the class it is injecting is a `FormRequest` instance, the request will **automatically be validated**. This means that if your controller action is called, you can safely assume the HTTP request input has been validated according to the rules you specified in your form request class. Even more, if the request is invalid, an HTTP redirect, which you may customize, will automatically be issued, and the error messages will be either flashed to the session or converted to JSON. **Form validation has never been more simple.** For more information on `FormRequest` validation, check out the [documentation](/docs/5.0/validation#form-request-validation). +When the Laravel service container identifies that the class it is injecting is a `FormRequest` instance, the request will **automatically be validated**. This means that if your controller action is called, you can safely assume the HTTP request input has been validated according to the rules you specified in your form request class. Even more, if the request is invalid, an HTTP redirect, which you may customize, will automatically be issued, and the error messages will be either flashed to the session or converted to JSON. **Form validation has never been more simple.** For more information on `FormRequest` validation, check out the [documentation](/docs/5.0/validation#form-request-validation). ### Simple Controller Request Validation From 8ec358b64a31d9967a4447975d5227eb5f974e2f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Feb 2015 14:37:39 -0600 Subject: [PATCH 058/276] Remove old docs pages. --- html.md | 204 ------------------------------------------- ssh.md | 263 -------------------------------------------------------- 2 files changed, 467 deletions(-) delete mode 100644 html.md delete mode 100644 ssh.md diff --git a/html.md b/html.md deleted file mode 100644 index be9f2daf166..00000000000 --- a/html.md +++ /dev/null @@ -1,204 +0,0 @@ -# Forms & HTML - -- [Opening A Form](#opening-a-form) -- [CSRF Protection](#csrf-protection) -- [Form Model Binding](#form-model-binding) -- [Labels](#labels) -- [Text, Text Area, Password & Hidden Fields](#text) -- [Checkboxes and Radio Buttons](#checkboxes-and-radio-buttons) -- [File Input](#file-input) -- [Number Input](#number) -- [Drop-Down Lists](#drop-down-lists) -- [Buttons](#buttons) -- [Custom Macros](#custom-macros) -- [Generating URLs](#generating-urls) - - -## Opening A Form - -#### Opening A Form - - {{ Form::open(['url' => 'foo/bar']) }} - // - {{ Form::close() }} - -By default, a `POST` method will be assumed; however, you are free to specify another method: - - echo Form::open(['url' => 'foo/bar', 'method' => 'put']) - -> **Note:** Since HTML forms only support `POST` and `GET`, `PUT` and `DELETE` methods will be spoofed by automatically adding a `_method` hidden field to your form. - -You may also open forms that point to named routes or controller actions: - - echo Form::open(['route' => 'route.name']) - - echo Form::open(['action' => 'Controller@method']) - -You may pass in route parameters as well: - - echo Form::open(['route' => ['route.name', $user->id]]) - - echo Form::open(['action' => ['Controller@method', $user->id]]) - -If your form is going to accept file uploads, add a `files` option to your array: - - echo Form::open(['url' => 'foo/bar', 'files' => true]) - - -## CSRF Protection - -#### Adding The CSRF Token To A Form - -Laravel provides an easy method of protecting your application from cross-site request forgeries. First, a random token is placed in your user's session. If you use the `Form::open` method with `POST`, `PUT` or `DELETE` the CSRF token will be added to your forms as a hidden field automatically. Alternatively, if you wish to generate the HTML for the hidden CSRF field, you may use the `token` method: - - echo Form::token(); - -#### Attaching The CSRF Filter To A Route - - Route::post('profile', ['before' => 'csrf', function() - { - // - }]); - - -## Form Model Binding - -#### Opening A Model Form - -Often, you will want to populate a form based on the contents of a model. To do so, use the `Form::model` method: - - echo Form::model($user, ['route' => ['user.update', $user->id]]) - -Now, when you generate a form element, like a text input, the model's value matching the field's name will automatically be set as the field value. So, for example, for a text input named `email`, the user model's `email` attribute would be set as the value. However, there's more! If there is an item in the Session flash data matching the input name, that will take precedence over the model's value. So, the priority looks like this: - -1. Session Flash Data (Old Input) -2. Explicitly Passed Value -3. Model Attribute Data - -This allows you to quickly build forms that not only bind to model values, but easily re-populate if there is a validation error on the server! - -> **Note:** When using `Form::model`, be sure to close your form with `Form::close`! - - -## Labels - -#### Generating A Label Element - - echo Form::label('email', 'E-Mail Address'); - -#### Specifying Extra HTML Attributes - - echo Form::label('email', 'E-Mail Address', ['class' => 'awesome']); - -> **Note:** After creating a label, any form element you create with a name matching the label name will automatically receive an ID matching the label name as well. - - -## Text, Text Area, Password & Hidden Fields - -#### Generating A Text Input - - echo Form::text('username'); - -#### Specifying A Default Value - - echo Form::text('email', 'example@gmail.com'); - -> **Note:** The *hidden* and *textarea* methods have the same signature as the *text* method. - -#### Generating A Password Input - - echo Form::password('password'); - -#### Generating Other Inputs - - echo Form::email($name, $value = null, $attributes = []); - echo Form::file($name, $attributes = []); - - -## Checkboxes and Radio Buttons - -#### Generating A Checkbox Or Radio Input - - echo Form::checkbox('name', 'value'); - - echo Form::radio('name', 'value'); - -#### Generating A Checkbox Or Radio Input That Is Checked - - echo Form::checkbox('name', 'value', true); - - echo Form::radio('name', 'value', true); - - -## Number - -#### Generating A Number Input - - echo Form::number('name', 'value'); - - -## File Input - -#### Generating A File Input - - echo Form::file('image'); - -> **Note:** The form must have been opened with the `files` option set to `true`. - - -## Drop-Down Lists - -#### Generating A Drop-Down List - - echo Form::select('size', ['L' => 'Large', 'S' => 'Small']); - -#### Generating A Drop-Down List With Selected Default - - echo Form::select('size', ['L' => 'Large', 'S' => 'Small'], 'S'); - -#### Generating A Grouped List - - echo Form::select('animal', [ - 'Cats' => ['leopard' => 'Leopard'], - 'Dogs' => ['spaniel' => 'Spaniel'] - ]); - -#### Generating A Drop-Down List With A Range - - echo Form::selectRange('number', 10, 20); - -#### Generating A List With Month Names - - echo Form::selectMonth('month'); - - -## Buttons - -#### Generating A Submit Button - - echo Form::submit('Click Me!'); - -> **Note:** Need to create a button element? Try the *button* method. It has the same signature as *submit*. - - -## Custom Macros - -#### Registering A Form Macro - -It's easy to define your own custom Form class helpers called "macros". Here's how it works. First, simply register the macro with a given name and a Closure: - - Form::macro('myField', function() - { - return ''; - }); - -Now you can call your macro using its name: - -#### Calling A Custom Form Macro - - echo Form::myField(); - - -## Generating URLs - -For more information on generating URL's, check out the documentation on [helpers](/docs/helpers#urls). diff --git a/ssh.md b/ssh.md deleted file mode 100644 index b1b53f7e907..00000000000 --- a/ssh.md +++ /dev/null @@ -1,263 +0,0 @@ -# SSH - -- [Configuration](#configuration) -- [Basic Usage](#basic-usage) -- [Tasks](#tasks) -- [SFTP Downloads](#sftp-downloads) -- [SFTP Uploads](#sftp-uploads) -- [Tailing Remote Logs](#tailing-remote-logs) -- [Envoy Task Runner](#envoy-task-runner) - - -## Configuration - -Laravel includes a simple way to SSH into remote servers and run commands, allowing you to easily build Artisan tasks that work on remote servers. The `SSH` facade provides the access point to connecting to your remote servers and running commands. - -The configuration file is located at `config/remote.php`, and contains all of the options you need to configure your remote connections. The `connections` array contains a list of your servers keyed by name. Simply populate the credentials in the `connections` array and you will be ready to start running remote tasks. Note that the `SSH` can authenticate using either a password or an SSH key. - -> **Note:** Need to easily run a variety of tasks on your remote server? Check out the [Envoy task runner](#envoy-task-runner)! - - -## Basic Usage - -#### Running Commands On The Default Server - -To run commands on your `default` remote connection, use the `SSH::run` method: - - SSH::run([ - 'cd /var/www', - 'git pull origin master', - ]); - -#### Running Commands On A Specific Connection - -Alternatively, you may run commands on a specific connection using the `into` method: - - SSH::into('staging')->run([ - 'cd /var/www', - 'git pull origin master', - ]); - -#### Catching Output From Commands - -You may catch the "live" output of your remote commands by passing a Closure into the `run` method: - - SSH::run($commands, function($line) - { - echo $line.PHP_EOL; - }); - -## Tasks - - -If you need to define a group of commands that should always be run together, you may use the `define` method to define a `task`: - - SSH::into('staging')->define('deploy', [ - 'cd /var/www', - 'git pull origin master', - 'php artisan migrate', - ]); - -Once the task has been defined, you may use the `task` method to run it: - - SSH::into('staging')->task('deploy', function($line) - { - echo $line.PHP_EOL; - }); - - -## SFTP Downloads - -The `SSH` class includes a simple way to download files using the `get` and `getString` methods: - - SSH::into('staging')->get($remotePath, $localPath); - - $contents = SSH::into('staging')->getString($remotePath); - - -## SFTP Uploads - -The `SSH` class also includes a simple way to upload files, or even strings, to the server using the `put` and `putString` methods: - - SSH::into('staging')->put($localFile, $remotePath); - - SSH::into('staging')->putString($remotePath, 'Foo'); - - -## Tailing Remote Logs - -Laravel includes a helpful command for tailing the `laravel.log` files on any of your remote connections. Simply use the `tail` Artisan command and specify the name of the remote connection you would like to tail: - - php artisan tail staging - - php artisan tail staging --path=/path/to/log.file - - -## Envoy Task Runner - -- [Installation](#envoy-installation) -- [Running Tasks](#envoy-running-tasks) -- [Multiple Servers](#envoy-multiple-servers) -- [Parallel Execution](#envoy-parallel-execution) -- [Task Macros](#envoy-task-macros) -- [Notifications](#envoy-notifications) -- [Updating Envoy](#envoy-updating-envoy) - -Laravel Envoy provides a clean, minimal syntax for defining common tasks you run on your remote servers. Using a [Blade](/docs/templates#blade-templating) style syntax, you can easily setup tasks for deployment, Artisan commands, and more. - -> **Note:** Envoy requires PHP version 5.4 or greater, and only runs on Mac / Linux operating systems. - - -### Installation - -First, install Envoy using the Composer `global` command: - - composer global require "laravel/envoy=~1.0" - -Make sure to place the `~/.composer/vendor/bin` directory in your PATH so the `envoy` executable is found when you run the `envoy` command in your terminal. - -Next, create an `Envoy.blade.php` file in the root of your project. Here's an example to get you started: - - @servers(['web' => '192.168.1.1']) - - @task('foo', ['on' => 'web']) - ls -la - @endtask - -As you can see, an array of `@servers` is defined at the top of the file. You can reference these servers in the `on` option of your task declarations. Within your `@task` declarations you should place the Bash code that will be run on your server when the task is executed. - -The `init` command may be used to easily create a stub Envoy file: - - envoy init user@192.168.1.1 - - -### Running Tasks - -To run a task, use the `run` command of your Envoy installation: - - envoy run foo - -If needed, you may pass variables into the Envoy file using command line switches: - - envoy run deploy --branch=master - -You may use the options via the Blade syntax you are used to: - - @servers(['web' => '192.168.1.1']) - - @task('deploy', ['on' => 'web']) - cd site - git pull origin {{ $branch }} - php artisan migrate - @endtask - -#### Bootstrapping - -You may use the ```@setup``` directive to declare variables and do general PHP work inside the Envoy file: - - @setup - $now = new DateTime(); - - $environment = isset($env) ? $env : "testing"; - @endsetup - -You may also use ```@include``` to include any PHP files: - - @include('vendor/autoload.php'); - - -### Multiple Servers - -You may easily run a task across multiple servers. Simply list the servers in the task declaration: - - @servers(['web-1' => '192.168.1.1', 'web-2' => '192.168.1.2']) - - @task('deploy', ['on' => ['web-1', 'web-2']]) - cd site - git pull origin {{ $branch }} - php artisan migrate - @endtask - -By default, the task will be executed on each server serially. Meaning, the task will finish running on the first server before proceeding to execute on the next server. - - -### Parallel Execution - -If you would like to run a task across multiple servers in parallel, simply add the `parallel` option to your task declaration: - - @servers(['web-1' => '192.168.1.1', 'web-2' => '192.168.1.2']) - - @task('deploy', ['on' => ['web-1', 'web-2'], 'parallel' => true]) - cd site - git pull origin {{ $branch }} - php artisan migrate - @endtask - - -### Task Macros - -Macros allow you to define a set of tasks to be run in sequence using a single command. For instance: - - @servers(['web' => '192.168.1.1']) - - @macro('deploy') - foo - bar - @endmacro - - @task('foo') - echo "HELLO" - @endtask - - @task('bar') - echo "WORLD" - @endtask - -The `deploy` macro can now be run via a single, simple command: - - envoy run deploy - - - -### Notifications - -#### HipChat - -After running a task, you may send a notification to your team's HipChat room using the simple `@hipchat` directive: - - @servers(['web' => '192.168.1.1']) - - @task('foo', ['on' => 'web']) - ls -la - @endtask - - @after - @hipchat('token', 'room', 'Envoy') - @endafter - -You can also specify a custom message to the hipchat room. Any variables declared in ```@setup``` or included with ```@include``` will be available for use in the message: - - @after - @hipchat('token', 'room', 'Envoy', "$task ran on [$environment]") - @endafter - -This is an amazingly simple way to keep your team notified of the tasks being run on the server. - -#### Slack - -The following syntax may be used to send a notification to [Slack](https://slack.com): - - @after - @slack('team', 'token', 'channel') - @endafter - - -### Updating Envoy - -To update Envoy, simply run the `self-update` command: - - envoy self-update - -If your Envoy installation is in `/usr/local/bin`, you may need to use `sudo`: - - composer global update From d558ca618d2b63cdb51dc842354dc9f1aa0e0559 Mon Sep 17 00:00:00 2001 From: Adam Engebretson Date: Wed, 25 Feb 2015 14:55:36 -0600 Subject: [PATCH 059/276] Fixing Upgrade Guide for Illuminate/HTML Deprecation --- upgrade.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/upgrade.md b/upgrade.md index bc0df1bf546..00fe5be61ef 100644 --- a/upgrade.md +++ b/upgrade.md @@ -181,16 +181,18 @@ You may move your Sass, Less, or CoffeeScript to any location you wish. The `res ### Form & HTML Helpers -If you're using Form or HTML helpers, you will see an error stating `class 'Form' not found` or `class 'Html' not found`. To fix this, add `"illuminate/html": "~5.0"` to your `composer.json` file's `require` section. +The Form & HTML package has been moved to `"laravelcollective/html"`. Documentation on the package can be found at [LaravelCollective.com](http://laravelcollective.com/docs/5.0/html). + +If you're using Form or HTML helpers, you will see an error stating `class 'Form' not found` or `class 'Html' not found`. To fix this, add `"laravelcollective/html": "~5.0"` to your `composer.json` file's `require` section. You'll also need to add the Form and HTML facades and service provider. Edit `config/app.php`, and add this line to the 'providers' array: - 'Illuminate\Html\HtmlServiceProvider', + 'Collective\Html\HtmlServiceProvider', Next, add these lines to the 'aliases' array: - 'Form' => 'Illuminate\Html\FormFacade', - 'Html' => 'Illuminate\Html\HtmlFacade', + 'Form' => 'Collective\Html\FormFacade', + 'Html' => 'Collective\Html\HtmlFacade', ### CacheManager From fefa18d89afd4e1b8a9f9b0e1813fbb273c44742 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Wed, 25 Feb 2015 22:06:02 +0100 Subject: [PATCH 060/276] filesystem.md: Rename Disk to Storage --- filesystem.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filesystem.md b/filesystem.md index 0df8b29b0c1..eae560d0361 100644 --- a/filesystem.md +++ b/filesystem.md @@ -123,7 +123,7 @@ The first argument of the `extend` method is the name of the driver and the seco Date: Wed, 25 Feb 2015 15:10:02 -0600 Subject: [PATCH 061/276] some wording changes. --- upgrade.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/upgrade.md b/upgrade.md index 00fe5be61ef..4775fb6ee87 100644 --- a/upgrade.md +++ b/upgrade.md @@ -181,18 +181,18 @@ You may move your Sass, Less, or CoffeeScript to any location you wish. The `res ### Form & HTML Helpers -The Form & HTML package has been moved to `"laravelcollective/html"`. Documentation on the package can be found at [LaravelCollective.com](http://laravelcollective.com/docs/5.0/html). +If you're using Form or HTML helpers, you will see an error stating `class 'Form' not found` or `class 'Html' not found`. The Form and HTML helpers have been deprecated in Laravel 5.0; however, there are community-driven replacements such as those maintained by the [Laravel Collective]([LaravelCollective.com](http://laravelcollective.com/docs/5.0/html). -If you're using Form or HTML helpers, you will see an error stating `class 'Form' not found` or `class 'Html' not found`. To fix this, add `"laravelcollective/html": "~5.0"` to your `composer.json` file's `require` section. +For example, you may add `"laravelcollective/html": "~5.0"` to your `composer.json` file's `require` section. -You'll also need to add the Form and HTML facades and service provider. Edit `config/app.php`, and add this line to the 'providers' array: +You'll also need to add the Form and HTML facades and service provider. Edit `config/app.php` and add this line to the 'providers' array: 'Collective\Html\HtmlServiceProvider', Next, add these lines to the 'aliases' array: - 'Form' => 'Collective\Html\FormFacade', - 'Html' => 'Collective\Html\HtmlFacade', + 'Form' => 'Collective\Html\FormFacade', + 'Html' => 'Collective\Html\HtmlFacade', ### CacheManager From 2907f347e365bd63d8a86ffd9c23f16086aa90ad Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Feb 2015 15:42:39 -0600 Subject: [PATCH 062/276] Too many simply. --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 91fb9eba254..c9042745b22 100644 --- a/homestead.md +++ b/homestead.md @@ -200,4 +200,4 @@ All of the proper packages have already been installed on your Homestead box, yo - id: your-id token: your-token -Once you have configured your Blackfire credentials, simply re-provision the box using `homestead provision` or `vagrant provision`. Of course, be sure to review the [Blackfire documentation](https://blackfire.io/getting-started) to learn how to install the Blackfire companion extension for your web browser. +Once you have configured your Blackfire credentials, re-provision the box using `homestead provision` or `vagrant provision`. Of course, be sure to review the [Blackfire documentation](https://blackfire.io/getting-started) to learn how to install the Blackfire companion extension for your web browser. From 580c805e8a2c38b468aaea10834df3abfc3a105f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Feb 2015 15:51:00 -0600 Subject: [PATCH 063/276] Docs on single charges. --- billing.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/billing.md b/billing.md index 6e999ebc434..2f6c2538d2b 100644 --- a/billing.md +++ b/billing.md @@ -3,6 +3,7 @@ - [Introduction](#introduction) - [Configuration](#configuration) - [Subscribing To A Plan](#subscribing-to-a-plan) +- [Single Charges](#single-charges) - [No Card Up Front](#no-card-up-front) - [Swapping Subscriptions](#swapping-subscriptions) - [Subscription Quantity](#subscription-quantity) @@ -89,6 +90,29 @@ If you would like to specify additional customer details, you may do so by passi To learn more about the additional fields supported by Stripe, check out Stripe's [documentation on customer creation](https://stripe.com/docs/api#create_customer). + +## Single Charges + +If you would like to make a "one off" charge against a subscribed customer's credit card, you may use the `charge` method: + + $user->charge(100); + +The `charge` method accepts the amount you would like to charge in the lowest denominator of the currency. So, for example, the example above will charge 100 cents, or $1.00, against the user's credit card. + +The `charge` method also accepts an array for its second argument, allowing you to pass any options you wish to the underlying Stripe charge creation: + + $user->charge(100, [ + 'source' => $token, + 'receipt_email' => $user->email, + ]); + +The charge method will return `false` if the charge fails. This typically indicates the charge was denied: + + if ( ! $user->charge(100)) + { + // The charge was denied... + } + ## No Card Up Front From 6c7402a3a8eedab523e1a1240557b6554cd1b5eb Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Feb 2015 15:51:30 -0600 Subject: [PATCH 064/276] Bold. --- billing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/billing.md b/billing.md index 2f6c2538d2b..5e308a55b88 100644 --- a/billing.md +++ b/billing.md @@ -97,7 +97,7 @@ If you would like to make a "one off" charge against a subscribed customer's cre $user->charge(100); -The `charge` method accepts the amount you would like to charge in the lowest denominator of the currency. So, for example, the example above will charge 100 cents, or $1.00, against the user's credit card. +The `charge` method accepts the amount you would like to charge in the **lowest denominator of the currency**. So, for example, the example above will charge 100 cents, or $1.00, against the user's credit card. The `charge` method also accepts an array for its second argument, allowing you to pass any options you wish to the underlying Stripe charge creation: From 3fb7c681d1f6a0dab6739d2328378f7fde5734a5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Feb 2015 15:51:55 -0600 Subject: [PATCH 065/276] Few more fixes. --- billing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/billing.md b/billing.md index 5e308a55b88..ef4a6179e25 100644 --- a/billing.md +++ b/billing.md @@ -99,14 +99,14 @@ If you would like to make a "one off" charge against a subscribed customer's cre The `charge` method accepts the amount you would like to charge in the **lowest denominator of the currency**. So, for example, the example above will charge 100 cents, or $1.00, against the user's credit card. -The `charge` method also accepts an array for its second argument, allowing you to pass any options you wish to the underlying Stripe charge creation: +The `charge` method accepts an array as its second argument, allowing you to pass any options you wish to the underlying Stripe charge creation: $user->charge(100, [ 'source' => $token, 'receipt_email' => $user->email, ]); -The charge method will return `false` if the charge fails. This typically indicates the charge was denied: +The `charge` method will return `false` if the charge fails. This typically indicates the charge was denied: if ( ! $user->charge(100)) { From 1e124275144059b5a71f26c237196794dfb12855 Mon Sep 17 00:00:00 2001 From: lifesign Date: Thu, 26 Feb 2015 17:03:08 +0800 Subject: [PATCH 066/276] rename before method to boot --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index 01dcb2ae538..7c07d368786 100644 --- a/routing.md +++ b/routing.md @@ -159,7 +159,7 @@ Of course, you can capture segments of the request URI within your route: #### Defining Global Patterns -If you would like a route parameter to always be constrained by a given regular expression, you may use the `pattern` method. You should define these patterns in the `before` method of your `RouteServiceProvider`: +If you would like a route parameter to always be constrained by a given regular expression, you may use the `pattern` method. You should define these patterns in the `boot` method of your `RouteServiceProvider`: $router->pattern('id', '[0-9]+'); From b4aaae4b0f2d9ed929c1b316d50ccb9c3856f785 Mon Sep 17 00:00:00 2001 From: pevawi Date: Thu, 26 Feb 2015 14:24:23 +0100 Subject: [PATCH 067/276] Update views.md --- views.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/views.md b/views.md index 904d5b1babe..31eb44ac745 100644 --- a/views.md +++ b/views.md @@ -108,11 +108,23 @@ Let's organize our view composers within a [service provider](/docs/5.0/provider }); } + + /** + * Register + * + * @return void + */ + public function register() + { + // + } } > **Note:** Laravel does not include a default directory for view composers. You are free to organize them however you wish. For example, you could create an `App\Http\ViewComposers` directory. +Remember to add the service provider in the `config/app.php` configuration file. This file contains a providers array where you can list the names of your service providers. + Now that we have registered the composer, the `ProfileComposer@compose` method will be executed each time the `profile` view is being rendered. So, let's define the composer class: Date: Thu, 26 Feb 2015 07:38:25 -0600 Subject: [PATCH 068/276] Wording. --- views.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views.md b/views.md index 31eb44ac745..42413ef66af 100644 --- a/views.md +++ b/views.md @@ -108,7 +108,7 @@ Let's organize our view composers within a [service provider](/docs/5.0/provider }); } - + /** * Register * @@ -123,7 +123,7 @@ Let's organize our view composers within a [service provider](/docs/5.0/provider > **Note:** Laravel does not include a default directory for view composers. You are free to organize them however you wish. For example, you could create an `App\Http\ViewComposers` directory. -Remember to add the service provider in the `config/app.php` configuration file. This file contains a providers array where you can list the names of your service providers. +Remember, you will need to add the service provider to the `providers` array in the `config/app.php` configuration file. Now that we have registered the composer, the `ProfileComposer@compose` method will be executed each time the `profile` view is being rendered. So, let's define the composer class: From d15965da32e90024b569e2342cd7da4223b9b8df Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 26 Feb 2015 07:51:00 -0600 Subject: [PATCH 069/276] Docs note. --- billing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/billing.md b/billing.md index ef4a6179e25..6d964f1a92e 100644 --- a/billing.md +++ b/billing.md @@ -113,6 +113,8 @@ The `charge` method will return `false` if the charge fails. This typically indi // The charge was denied... } +If the charge is successful, the full Stripe response will be returned from the method. + ## No Card Up Front From 317bf75732ea06c72fc14d39be643de365df7e74 Mon Sep 17 00:00:00 2001 From: jedrzej Date: Thu, 26 Feb 2015 23:39:28 +0100 Subject: [PATCH 070/276] Fixed typos in Command Pipeline code samples --- bus.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bus.md b/bus.md index 9e988e09c8c..25d002c998a 100644 --- a/bus.md +++ b/bus.md @@ -136,7 +136,7 @@ A command pipe is defined with a `handle` method, just like a middleware: return DB::transaction(function() use ($command, $next) { return $next($command); - } + }); } } @@ -150,5 +150,5 @@ You may even define a `Closure` as a command pipe: return DB::transaction(function() use ($command, $next) { return $next($command); - } + }); }]); From 61faa3cebd15e25474dbf9129ebafc6c82c06e19 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 26 Feb 2015 17:05:09 -0600 Subject: [PATCH 071/276] Document fresh. --- installation.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/installation.md b/installation.md index 43e984fba21..c56dba49df7 100644 --- a/installation.md +++ b/installation.md @@ -30,6 +30,12 @@ You may also install Laravel by issuing the Composer `create-project` command in composer create-project laravel/laravel --prefer-dist +### Scaffolding + +Laravel ships with scaffolding for user registration and authentication. If you would like to remove this scaffolding, use the `fresh` Artisan command: + + php artisan fresh + ## Server Requirements From 29668c08c78dc6818462d022718d2c995a8690bf Mon Sep 17 00:00:00 2001 From: Lasse A L Date: Fri, 27 Feb 2015 11:28:46 +0100 Subject: [PATCH 072/276] Fix Laravel Collective link --- upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade.md b/upgrade.md index 4775fb6ee87..c932affffd3 100644 --- a/upgrade.md +++ b/upgrade.md @@ -181,7 +181,7 @@ You may move your Sass, Less, or CoffeeScript to any location you wish. The `res ### Form & HTML Helpers -If you're using Form or HTML helpers, you will see an error stating `class 'Form' not found` or `class 'Html' not found`. The Form and HTML helpers have been deprecated in Laravel 5.0; however, there are community-driven replacements such as those maintained by the [Laravel Collective]([LaravelCollective.com](http://laravelcollective.com/docs/5.0/html). +If you're using Form or HTML helpers, you will see an error stating `class 'Form' not found` or `class 'Html' not found`. The Form and HTML helpers have been deprecated in Laravel 5.0; however, there are community-driven replacements such as those maintained by the [Laravel Collective](http://laravelcollective.com/docs/5.0/html). For example, you may add `"laravelcollective/html": "~5.0"` to your `composer.json` file's `require` section. From 7422792e450155ecdb28de2f76515d9bc38d7c0d Mon Sep 17 00:00:00 2001 From: Sjors van Dongen Date: Fri, 27 Feb 2015 15:48:28 +0100 Subject: [PATCH 073/276] Update helpers.md Updated helpers.md for Laravel 5 --- helpers.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/helpers.md b/helpers.md index 528fd399526..edb6017d524 100644 --- a/helpers.md +++ b/helpers.md @@ -402,3 +402,27 @@ If the given value is a `Closure`, return the value returned by the `Closure`. O Return the given object. Useful for method chaining constructors in PHP 5.3.x. $value = with(new Foo)->doWork(); + +### view + +Get the evaluated view contents for the given view. + + return view('auth.login'); + +### env + +Gets the value of an environment variable. Second parameter is the default string to be returned. + + env('APP_ENV', 'production') + +### event + +Fire an event and call the listeners. + + event('my.event'); + +### elixir + +Get the path to a versioned Elixir file. + + elixir($file); From 8fed26bf68e91ab013821ab9963c752557d25308 Mon Sep 17 00:00:00 2001 From: Tom Castleman Date: Fri, 27 Feb 2015 16:09:42 +0100 Subject: [PATCH 074/276] Update extending.md Running parent::boot() afterwards overwrites custom binding. Custom bindings should come after parent::boot() --- extending.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extending.md b/extending.md index a216e836cd8..ced62bd29d3 100644 --- a/extending.md +++ b/extending.md @@ -171,12 +171,12 @@ For example, the `HashServiceProvider` binds a `hash` key into the service conta public function boot() { + parent::boot(); + $this->app->bindShared('hash', function() { return new \Snappy\Hashing\ScryptHasher; }); - - parent::boot(); } } From a007cb05084ee3c7196663a1326dccecfc3c3ed5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 27 Feb 2015 09:17:31 -0600 Subject: [PATCH 075/276] some tweaks. --- helpers.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/helpers.md b/helpers.md index edb6017d524..d515658e43e 100644 --- a/helpers.md +++ b/helpers.md @@ -391,38 +391,38 @@ Dump the given variable and end execution of the script. dd($value); -### value +### elixir -If the given value is a `Closure`, return the value returned by the `Closure`. Otherwise, return the value. +Get the path to a versioned Elixir file. - $value = value(function() { return 'bar'; }); + elixir($file); -### with +### env -Return the given object. Useful for method chaining constructors in PHP 5.3.x. +Gets the value of an environment variable or return a default value. - $value = with(new Foo)->doWork(); - -### view + env('APP_ENV', 'production') -Get the evaluated view contents for the given view. +### event - return view('auth.login'); +Fire an event. -### env + event('my.event'); -Gets the value of an environment variable. Second parameter is the default string to be returned. +### value - env('APP_ENV', 'production') +If the given value is a `Closure`, return the value returned by the `Closure`. Otherwise, return the value. -### event + $value = value(function() { return 'bar'; }); -Fire an event and call the listeners. +### view - event('my.event'); +Get a View instance for the given view path. -### elixir + return view('auth.login'); -Get the path to a versioned Elixir file. +### with - elixir($file); +Return the given object. Useful for method chaining constructors in PHP 5.3.x. + + $value = with(new Foo)->doWork(); From 047db485239ee52ab85b9352d331a9ae4b553cfa Mon Sep 17 00:00:00 2001 From: weblee Date: Fri, 27 Feb 2015 16:13:02 +0000 Subject: [PATCH 076/276] Very small change for backfire setting in Homestead file. Seems silly but I was putting in my Client ID & Token as I was thinking my App was the client and not the server credentials. --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index c9042745b22..131ef4ae525 100644 --- a/homestead.md +++ b/homestead.md @@ -194,7 +194,7 @@ If you wish, you may forward additional ports to the Vagrant box, as well as spe [Blackfire Profiler](https://blackfire.io) by SensioLabs automatically gathers data about your code's execution, such as RAM, CPU time, and disk I/O. Homestead makes it a breeze to use this profiler for your own applications. -All of the proper packages have already been installed on your Homestead box, you simply need to set a Blackfire ID and token in your `Homestead.yaml` file: +All of the proper packages have already been installed on your Homestead box, you simply need to set a Blackfire Server ID and token in your `Homestead.yaml` file: blackfire: - id: your-id From d1460950aef8259a3f0a16a554c7dd9244b56250 Mon Sep 17 00:00:00 2001 From: Afflicto Date: Fri, 27 Feb 2015 17:40:14 +0100 Subject: [PATCH 077/276] Pass an array for more than one file in elixir mix.less --- elixir.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/elixir.md b/elixir.md index 32ef46acaae..6dc4d3f12cb 100644 --- a/elixir.md +++ b/elixir.md @@ -54,6 +54,17 @@ elixir(function(mix) { In the example above, Elixir assumes that your Less files are stored in `resources/assets/less`. +#### Pass an array for more than one file + +```javascript +elixir(function(mix) { + mix.less([ + 'app.less', + 'something-else.less' + ]); +}); +``` + #### Compile Sass ```javascript From a6942f6c65e2f5ef833bee7cb9b7ddb441ff5286 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 27 Feb 2015 11:48:08 -0600 Subject: [PATCH 078/276] fix wording. --- elixir.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir.md b/elixir.md index 6dc4d3f12cb..c895229eb63 100644 --- a/elixir.md +++ b/elixir.md @@ -54,7 +54,7 @@ elixir(function(mix) { In the example above, Elixir assumes that your Less files are stored in `resources/assets/less`. -#### Pass an array for more than one file +#### Compiling Multiple Less Files ```javascript elixir(function(mix) { From da0e5b3ee6038e589c3633868fd93fe7919943ce Mon Sep 17 00:00:00 2001 From: Tom Castleman Date: Fri, 27 Feb 2015 19:56:42 +0100 Subject: [PATCH 079/276] Update cache.md Add section on accessing cache stores other than the default --- cache.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cache.md b/cache.md index 4ea3c0a5542..124e5b39896 100644 --- a/cache.md +++ b/cache.md @@ -2,6 +2,7 @@ - [Configuration](#configuration) - [Cache Usage](#cache-usage) +- [Accessing Stores](#accessing-stores) - [Increments & Decrements](#increments-and-decrements) - [Cache Tags](#cache-tags) - [Database Cache](#database-cache) @@ -81,6 +82,13 @@ If you need to retrieve an item from the cache and then delete it, you may use t Cache::forget('key'); + +## Accessing Stores + +When using multiple stores, you may access them via the `Cache::store` method: + + value = Cache::store('foo')->get(...); + ## Increments & Decrements @@ -130,7 +138,7 @@ You may flush all items tagged with a name or list of names. For example, this s In contrast, this statement would remove only caches tagged with `authors`, so "John" would be removed, but not "Anne". Cache::tags('authors')->flush(); - + ## Database Cache From 8a6787cb6f51a6764c3a890d4014ce35189aaffb Mon Sep 17 00:00:00 2001 From: Tom Castleman Date: Fri, 27 Feb 2015 20:00:44 +0100 Subject: [PATCH 080/276] Update cache.md Typo --- cache.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cache.md b/cache.md index 124e5b39896..8f263ceedb9 100644 --- a/cache.md +++ b/cache.md @@ -87,7 +87,7 @@ If you need to retrieve an item from the cache and then delete it, you may use t When using multiple stores, you may access them via the `Cache::store` method: - value = Cache::store('foo')->get(...); + $value = Cache::store('foo')->get(...); ## Increments & Decrements @@ -138,7 +138,7 @@ You may flush all items tagged with a name or list of names. For example, this s In contrast, this statement would remove only caches tagged with `authors`, so "John" would be removed, but not "Anne". Cache::tags('authors')->flush(); - + ## Database Cache From a440f6e2d4073f7b53ab1d557d6df0e1a53a30bb Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 27 Feb 2015 15:26:15 -0600 Subject: [PATCH 081/276] fix --- cache.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cache.md b/cache.md index 8f263ceedb9..43064db940b 100644 --- a/cache.md +++ b/cache.md @@ -82,12 +82,9 @@ If you need to retrieve an item from the cache and then delete it, you may use t Cache::forget('key'); - -## Accessing Stores +When using multiple cache stores, you may access them via the `store` method: -When using multiple stores, you may access them via the `Cache::store` method: - - $value = Cache::store('foo')->get(...); + $value = Cache::store('foo')->get('foo'); ## Increments & Decrements From 125083ee6303f9c77f1391e4c0e1fb6f630f5af0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 27 Feb 2015 15:26:21 -0600 Subject: [PATCH 082/276] remove heading. --- cache.md | 1 - 1 file changed, 1 deletion(-) diff --git a/cache.md b/cache.md index 43064db940b..35c51d11076 100644 --- a/cache.md +++ b/cache.md @@ -2,7 +2,6 @@ - [Configuration](#configuration) - [Cache Usage](#cache-usage) -- [Accessing Stores](#accessing-stores) - [Increments & Decrements](#increments-and-decrements) - [Cache Tags](#cache-tags) - [Database Cache](#database-cache) From 245edb450bacf4cc29c4d913324e892f8911f283 Mon Sep 17 00:00:00 2001 From: orrd Date: Fri, 27 Feb 2015 17:11:44 -0600 Subject: [PATCH 083/276] Specifying 'gulpfile.js' as the file to edit. It may seem obvious to some, but for people who are new to Gulp or unclear on what Elixir actually does, the Usage section should clearly state that "gulpfile.js" is the file that you edit when using the examples listed. The file "gulpfile.js" wasn't previously mentioned by name anywhere in the Elixer docs page. --- elixir.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir.md b/elixir.md index c895229eb63..936d1fa4857 100644 --- a/elixir.md +++ b/elixir.md @@ -42,7 +42,7 @@ The only remaining step is to install Elixir! With a new install of Laravel, you ## Usage -Now that you've installed Elixir, you'll be compiling and concatenating in no time! +Now that you've installed Elixir, you'll be compiling and concatenating in no time! To get started, edit `gulpfile.js` to tell Gulp what tasks you would like it to perform. This is the same file you would be editing if you were using Gulp without Elixir, the only difference is now you can use the `elixir()` function to more easily configure your Gulp tasks. #### Compile Less From 7fd75c7b7724e123ad6e0c74923a80e54460c429 Mon Sep 17 00:00:00 2001 From: Benedikt Bauer Date: Sat, 28 Feb 2015 02:32:53 +0100 Subject: [PATCH 084/276] Clarify the Launch of homestead Launching the homestead vagrant box via vagrant up will only work if you had homestead create a vagrant file for you first. However homestead init will not do so. So instead of using vagrant up you should use homestead up, which will first create the vagrantfile and only then run vagrant up. Once the vagrantfile is there you can of course run vagrant up instead, just not at this point in the install. --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 131ef4ae525..80a2b54b56a 100644 --- a/homestead.md +++ b/homestead.md @@ -123,7 +123,7 @@ To add Bash aliases to your Homestead box, simply add to the `aliases` file in t ### Launch The Vagrant Box -Once you have edited the `Homestead.yaml` to your liking, run the `vagrant up` command from your Homestead directory. +Once you have edited the `Homestead.yaml` to your liking, run the `homestead up` command from your Homestead directory. Vagrant will boot the virtual machine, and configure your shared folders and Nginx sites automatically! To destroy the machine, you may use the `vagrant destroy --force` command. From 4fb851e8257a6bc25bb10fa47dd47e8cbd93c09f Mon Sep 17 00:00:00 2001 From: Tom Castleman Date: Sat, 28 Feb 2015 02:37:54 +0100 Subject: [PATCH 085/276] heading and param --- cache.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cache.md b/cache.md index 35c51d11076..27f59a9a4be 100644 --- a/cache.md +++ b/cache.md @@ -81,9 +81,11 @@ If you need to retrieve an item from the cache and then delete it, you may use t Cache::forget('key'); +#### Access Specific Cache Stores + When using multiple cache stores, you may access them via the `store` method: - $value = Cache::store('foo')->get('foo'); + $value = Cache::store('foo')->get('key'); ## Increments & Decrements From d0f514fafb32f329fc6b45de2fceb17d39e72e93 Mon Sep 17 00:00:00 2001 From: Nikush Patel Date: Sat, 28 Feb 2015 15:17:16 +0000 Subject: [PATCH 086/276] Add section on routing to helpers document --- helpers.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/helpers.md b/helpers.md index d515658e43e..55c8afd6938 100644 --- a/helpers.md +++ b/helpers.md @@ -3,6 +3,7 @@ - [Arrays](#arrays) - [Paths](#paths) - [Strings](#strings) +- [Routing](#routing) - [URLs](#urls) - [Miscellaneous](#miscellaneous) @@ -337,6 +338,39 @@ Translate a given language line with inflection. Alias of `Lang::choice`. $value = trans_choice('foo.bar', $count); + +## Routing + +### get + +Register a new GET route with the router. + + get('/', function() { return 'Hello World'; }); + +### post + +Register a new POST route with the router. + + post('foo/bar', function() { }); + +### put + +Register a new PUT route with the router. + + put('foo/bar', function() { }); + +### patch + +Register a new PATCH route with the router. + + patch('foo/bar', function() { }); + +### delete + +Register a new DELETE route with the router. + + delete('foo/bar', function() { }); + ## URLs From 6bfa0031c86b1c7c2f3b6df16420ec8a1ae85c35 Mon Sep 17 00:00:00 2001 From: Pantelis Sampaziotis Date: Sat, 28 Feb 2015 18:51:32 +0000 Subject: [PATCH 087/276] Updated artisan.md --- artisan.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/artisan.md b/artisan.md index be40f90f116..0ab012fa502 100644 --- a/artisan.md +++ b/artisan.md @@ -124,6 +124,16 @@ Let's look at a few more scheduling examples: $schedule->command('foo')->monthly(); +#### Job That Runs On Specific Days + + $schedule->command('foo')->mondays(); + $schedule->command('foo')->tuesdays(); + $schedule->command('foo')->wednesdays(); + $schedule->command('foo')->thursdays(); + $schedule->command('foo')->fridays(); + $schedule->command('foo')->saturdays(); + $schedule->command('foo')->sundays(); + #### Limit The Environment The Jobs Should Run In $schedule->command('foo')->monthly()->environments('production'); @@ -138,3 +148,15 @@ Let's look at a few more scheduling examples: { return true; }); + +#### E-mail The Output Of A Scheduled Job + + $schedule->command('foo')->emailOutputTo('foo@example.com'); + +#### Send The Output Of The Scheduled Job To A Given Location + + $schedule->command('foo')->sendOutputTo($filePath); + +#### Ping A Given URL After The Job Runs + + $schedule->command('foo')->thenPing($url); \ No newline at end of file From d72fb81e4dc9b7e63b3fc38958a2dcdf314be786 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 28 Feb 2015 13:10:39 -0600 Subject: [PATCH 088/276] fix wording. --- elixir.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir.md b/elixir.md index 936d1fa4857..361ce86aac9 100644 --- a/elixir.md +++ b/elixir.md @@ -42,7 +42,7 @@ The only remaining step is to install Elixir! With a new install of Laravel, you ## Usage -Now that you've installed Elixir, you'll be compiling and concatenating in no time! To get started, edit `gulpfile.js` to tell Gulp what tasks you would like it to perform. This is the same file you would be editing if you were using Gulp without Elixir, the only difference is now you can use the `elixir()` function to more easily configure your Gulp tasks. +Now that you've installed Elixir, you'll be compiling and concatenating in no time! The `gulpfile.js` file in your project's root directory contains all of your Elixir tasks. #### Compile Less From 3fb144b59aac33d5359fd1e38b4645cc5f0e35c6 Mon Sep 17 00:00:00 2001 From: Mark Redeman Date: Sun, 1 Mar 2015 19:19:11 +0100 Subject: [PATCH 089/276] added missing cookies variable for call method --- testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing.md b/testing.md index ffb5648aa45..da0a9addf5c 100644 --- a/testing.md +++ b/testing.md @@ -52,7 +52,7 @@ You may easily call one of your routes for a test using the `call` method: $response = $this->call('GET', 'user/profile'); - $response = $this->call($method, $uri, $parameters, $files, $server, $content); + $response = $this->call($method, $uri, $parameters, $cookies, $files, $server, $content); You may then inspect the `Illuminate\Http\Response` object: From f683c8e11b72fb8d958a5d77bc575d77e5dafa29 Mon Sep 17 00:00:00 2001 From: Nikush Patel Date: Sun, 1 Mar 2015 22:07:18 +0000 Subject: [PATCH 090/276] Move Routing section above Strings. Alphabetical Order. --- helpers.md | 68 +++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/helpers.md b/helpers.md index 55c8afd6938..f1f7b8b6cb5 100644 --- a/helpers.md +++ b/helpers.md @@ -2,8 +2,8 @@ - [Arrays](#arrays) - [Paths](#paths) -- [Strings](#strings) - [Routing](#routing) +- [Strings](#strings) - [URLs](#urls) - [Miscellaneous](#miscellaneous) @@ -211,6 +211,39 @@ Get the fully qualified path to the `public` directory. Get the fully qualified path to the `storage` directory. + +## Routing + +### get + +Register a new GET route with the router. + + get('/', function() { return 'Hello World'; }); + +### post + +Register a new POST route with the router. + + post('foo/bar', function() { }); + +### put + +Register a new PUT route with the router. + + put('foo/bar', function() { }); + +### patch + +Register a new PATCH route with the router. + + patch('foo/bar', function() { }); + +### delete + +Register a new DELETE route with the router. + + delete('foo/bar', function() { }); + ## Strings @@ -338,39 +371,6 @@ Translate a given language line with inflection. Alias of `Lang::choice`. $value = trans_choice('foo.bar', $count); - -## Routing - -### get - -Register a new GET route with the router. - - get('/', function() { return 'Hello World'; }); - -### post - -Register a new POST route with the router. - - post('foo/bar', function() { }); - -### put - -Register a new PUT route with the router. - - put('foo/bar', function() { }); - -### patch - -Register a new PATCH route with the router. - - patch('foo/bar', function() { }); - -### delete - -Register a new DELETE route with the router. - - delete('foo/bar', function() { }); - ## URLs From 84081b5cb675e91aa756e023c30ac8d7cf0ad5d8 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 1 Mar 2015 21:24:02 -0600 Subject: [PATCH 091/276] Update a few things. --- helpers.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helpers.md b/helpers.md index f1f7b8b6cb5..abde00ec617 100644 --- a/helpers.md +++ b/helpers.md @@ -224,25 +224,25 @@ Register a new GET route with the router. Register a new POST route with the router. - post('foo/bar', function() { }); + post('foo/bar', 'FooController@action'); ### put Register a new PUT route with the router. - put('foo/bar', function() { }); + put('foo/bar', 'FooController@action'); ### patch Register a new PATCH route with the router. - patch('foo/bar', function() { }); + patch('foo/bar', 'FooController@action'); ### delete Register a new DELETE route with the router. - delete('foo/bar', function() { }); + delete('foo/bar', 'FooController@action'); ## Strings From 52c60947b459bb4607d31e642eb496fb50822a67 Mon Sep 17 00:00:00 2001 From: Nikush Patel Date: Mon, 2 Mar 2015 04:11:26 +0000 Subject: [PATCH 092/276] Typo --- container.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container.md b/container.md index f5ea60d84ec..b4c7b0472fa 100644 --- a/container.md +++ b/container.md @@ -223,7 +223,7 @@ This tells the container that it should inject the `PusherEventPusher` when a cl ## Contextual Binding -Sometimes you may have two classes that utilize the same interface, but you wish to inject different implementations into each class. For example, when our system receives a new Order, we may want to send an event via [PubNub](http://www.pubnub.com/) rather than Pusher. Laravel provides a simple, fluent interface for definining this behavior: +Sometimes you may have two classes that utilize the same interface, but you wish to inject different implementations into each class. For example, when our system receives a new Order, we may want to send an event via [PubNub](http://www.pubnub.com/) rather than Pusher. Laravel provides a simple, fluent interface for defining this behavior: $this->app->when('App\Handlers\Commands\CreateOrderHandler') ->needs('App\Contracts\EventPusher') From 538c408cee3ad94a4b11c8098d4f1fa212aaefc7 Mon Sep 17 00:00:00 2001 From: byjml Date: Mon, 2 Mar 2015 19:14:36 +0300 Subject: [PATCH 093/276] Use plural table name --- migrations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations.md b/migrations.md index b1013d98bde..5aebdfd2a67 100644 --- a/migrations.md +++ b/migrations.md @@ -22,7 +22,7 @@ The migration will be placed in your `database/migrations` folder, and will cont The `--table` and `--create` options may also be used to indicate the name of the table, and whether the migration will be creating a new table: - php artisan make:migration add_votes_to_user_table --table=users + php artisan make:migration add_votes_to_users_table --table=users php artisan make:migration create_users_table --create=users From bdd132034348eedd044aa2636f5fc1c7a3c13dfb Mon Sep 17 00:00:00 2001 From: "C. T. Lin" Date: Tue, 3 Mar 2015 00:48:21 +0800 Subject: [PATCH 094/276] Update facade list to 5.0 --- facades.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/facades.md b/facades.md index 3ce8b283c03..cf92f27cd83 100644 --- a/facades.md +++ b/facades.md @@ -143,6 +143,7 @@ Artisan | [Illuminate\Console\Application](http://laravel.com/api/5.0/Illumina Auth | [Illuminate\Auth\AuthManager](http://laravel.com/api/5.0/Illuminate/Auth/AuthManager.html) | `auth` Auth (Instance) | [Illuminate\Auth\Guard](http://laravel.com/api/5.0/Illuminate/Auth/Guard.html) | Blade | [Illuminate\View\Compilers\BladeCompiler](http://laravel.com/api/5.0/Illuminate/View/Compilers/BladeCompiler.html) | `blade.compiler` +Bus | [Illuminate\Contracts\Bus\Dispatcher](http://laravel.com/api/5.0/Illuminate/Contracts/Bus/Dispatcher.html) | Cache | [Illuminate\Cache\Repository](http://laravel.com/api/5.0/Illuminate/Cache/Repository.html) | `cache` Config | [Illuminate\Config\Repository](http://laravel.com/api/5.0/Illuminate/Config/Repository.html) | `config` Cookie | [Illuminate\Cookie\CookieJar](http://laravel.com/api/5.0/Illuminate/Cookie/CookieJar.html) | `cookie` @@ -151,15 +152,11 @@ DB | [Illuminate\Database\DatabaseManager](http://laravel.com/api/5.0/Illumina DB (Instance) | [Illuminate\Database\Connection](http://laravel.com/api/5.0/Illuminate/Database/Connection.html) | Event | [Illuminate\Events\Dispatcher](http://laravel.com/api/5.0/Illuminate/Events/Dispatcher.html) | `events` File | [Illuminate\Filesystem\Filesystem](http://laravel.com/api/5.0/Illuminate/Filesystem/Filesystem.html) | `files` -Form | [Illuminate\Html\FormBuilder](http://laravel.com/api/5.0/Illuminate/Html/FormBuilder.html) | `form` Hash | [Illuminate\Contracts\Hashing\Hasher](http://laravel.com/api/5.0/Illuminate/Contracts/Hashing/Hasher.html) | `hash` -HTML | [Illuminate\Html\HtmlBuilder](http://laravel.com/api/5.0/Illuminate/Html/HtmlBuilder.html) | `html` Input | [Illuminate\Http\Request](http://laravel.com/api/5.0/Illuminate/Http/Request.html) | `request` Lang | [Illuminate\Translation\Translator](http://laravel.com/api/5.0/Illuminate/Translation/Translator.html) | `translator` Log | [Illuminate\Log\Writer](http://laravel.com/api/5.0/Illuminate/Log/Writer.html) | `log` Mail | [Illuminate\Mail\Mailer](http://laravel.com/api/5.0/Illuminate/Mail/Mailer.html) | `mailer` -Paginator | [Illuminate\Pagination\Factory](http://laravel.com/api/5.0/Illuminate/Pagination/Factory.html) | `paginator` -Paginator (Instance) | [Illuminate\Pagination\Paginator](http://laravel.com/api/5.0/Illuminate/Pagination/Paginator.html) | Password | [Illuminate\Auth\Passwords\PasswordBroker](http://laravel.com/api/5.0/Illuminate/Auth/Passwords/PasswordBroker.html) | `auth.password` Queue | [Illuminate\Queue\QueueManager](http://laravel.com/api/5.0/Illuminate/Queue/QueueManager.html) | `queue` Queue (Instance) | [Illuminate\Queue\QueueInterface](http://laravel.com/api/5.0/Illuminate/Queue/QueueInterface.html) | @@ -167,13 +164,12 @@ Queue (Base Class) | [Illuminate\Queue\Queue](http://laravel.com/api/5.0/Illumi Redirect | [Illuminate\Routing\Redirector](http://laravel.com/api/5.0/Illuminate/Routing/Redirector.html) | `redirect` Redis | [Illuminate\Redis\Database](http://laravel.com/api/5.0/Illuminate/Redis/Database.html) | `redis` Request | [Illuminate\Http\Request](http://laravel.com/api/5.0/Illuminate/Http/Request.html) | `request` -Response | [Illuminate\Support\Facades\Response](http://laravel.com/api/5.0/Illuminate/Support/Facades/Response.html) | +Response | [Illuminate\Contracts\Routing\ResponseFactory](http://laravel.com/api/5.0/Illuminate/Contracts/Routing/ResponseFactory.html) | Route | [Illuminate\Routing\Router](http://laravel.com/api/5.0/Illuminate/Routing/Router.html) | `router` Schema | [Illuminate\Database\Schema\Blueprint](http://laravel.com/api/5.0/Illuminate/Database/Schema/Blueprint.html) | Session | [Illuminate\Session\SessionManager](http://laravel.com/api/5.0/Illuminate/Session/SessionManager.html) | `session` Session (Instance) | [Illuminate\Session\Store](http://laravel.com/api/5.0/Illuminate/Session/Store.html) | -SSH | [Illuminate\Remote\RemoteManager](http://laravel.com/api/5.0/Illuminate/Remote/RemoteManager.html) | `remote` -SSH (Instance) | [Illuminate\Remote\Connection](http://laravel.com/api/5.0/Illuminate/Remote/Connection.html) | +Storage | [Illuminate\Contracts\Filesystem\Factory](http://laravel.com/api/5.0/Illuminate/Contracts/Filesystem/Factory.html) | `filesystem` URL | [Illuminate\Routing\UrlGenerator](http://laravel.com/api/5.0/Illuminate/Routing/UrlGenerator.html) | `url` Validator | [Illuminate\Validation\Factory](http://laravel.com/api/5.0/Illuminate/Validation/Factory.html) | `validator` Validator (Instance) | [Illuminate\Validation\Validator](http://laravel.com/api/5.0/Illuminate/Validation/Validator.html) | From 9a444e99def250854f61cbbf93636a3f7a8b7533 Mon Sep 17 00:00:00 2001 From: Martijn Thomas Date: Mon, 2 Mar 2015 18:48:51 +0100 Subject: [PATCH 095/276] Added bitbucket to the Social Authentication Docs --- authentication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentication.md b/authentication.md index 4bd075cfee5..97e5af4306a 100644 --- a/authentication.md +++ b/authentication.md @@ -287,7 +287,7 @@ Your user will receive an e-mail with a link that points to the `getReset` metho ## Social Authentication -In addition to typical, form based authentication, Laravel also provides a simple, convenient way to authenticate with OAuth providers using [Laravel Socialite](https://github.com/laravel/socialite). **Socialite currently supports authentication with Facebook, Twitter, Google, and GitHub.** +In addition to typical, form based authentication, Laravel also provides a simple, convenient way to authenticate with OAuth providers using [Laravel Socialite](https://github.com/laravel/socialite). **Socialite currently supports authentication with Facebook, Twitter, Google, GitHub and Bitbucket.** To get started with Socialite, include the package in your `composer.json` file: From 86f609b074cc79e32e34e784c5178cffacebaef4 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 3 Mar 2015 08:59:53 +0100 Subject: [PATCH 096/276] Added Blackfire in the list of included software for Homestead --- homestead.md | 1 + 1 file changed, 1 insertion(+) diff --git a/homestead.md b/homestead.md index 80a2b54b56a..7435d0a92b9 100644 --- a/homestead.md +++ b/homestead.md @@ -35,6 +35,7 @@ Homestead is currently built and tested using Vagrant 1.6. - Beanstalkd - [Laravel Envoy](/docs/ssh#envoy-task-runner) - Fabric + HipChat Extension +- [Blackfire Profiler](#blackfire-profiler) ## Installation & Setup From 6096149fce8ba83c44cf39c8ec8f8c4a3eedfbe2 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 3 Mar 2015 21:01:33 -0600 Subject: [PATCH 097/276] Envoy docs. --- documentation.md | 1 + envoy.md | 169 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 envoy.md diff --git a/documentation.md b/documentation.md index b05cccfba27..a90303945ec 100755 --- a/documentation.md +++ b/documentation.md @@ -29,6 +29,7 @@ - [Core Extension](/docs/5.0/extending) - [Elixir](/docs/5.0/elixir) - [Encryption](/docs/5.0/encryption) + - [Envoy](/docs/5.0/envoy) - [Errors & Logging](/docs/5.0/errors) - [Events](/docs/5.0/events) - [Filesystem / Cloud Storage](/docs/5.0/filesystem) diff --git a/envoy.md b/envoy.md new file mode 100644 index 00000000000..c0ae446f780 --- /dev/null +++ b/envoy.md @@ -0,0 +1,169 @@ +# Envoy Task Runner + +- [Introduction](#introduction) +- [Installation](#envoy-installation) +- [Running Tasks](#envoy-running-tasks) +- [Multiple Servers](#envoy-multiple-servers) +- [Parallel Execution](#envoy-parallel-execution) +- [Task Macros](#envoy-task-macros) +- [Notifications](#envoy-notifications) +- [Updating Envoy](#envoy-updating-envoy) + + +## Introduction + +Laravel Envoy provides a clean, minimal syntax for defining common tasks you run on your remote servers. Using a [Blade](/docs/4.2/templates#blade-templating) style syntax, you can easily setup tasks for deployment, Artisan commands, and more. + +> **Note:** Envoy requires PHP version 5.4 or greater, and only runs on Mac / Linux operating systems. + + +## Installation + +First, install Envoy using the Composer `global` command: + + composer global require "laravel/envoy=~1.0" + +Make sure to place the `~/.composer/vendor/bin` directory in your PATH so the `envoy` executable is found when you run the `envoy` command in your terminal. + +Next, create an `Envoy.blade.php` file in the root of your project. Here's an example to get you started: + + @servers(['web' => '192.168.1.1']) + + @task('foo', ['on' => 'web']) + ls -la + @endtask + +As you can see, an array of `@servers` is defined at the top of the file. You can reference these servers in the `on` option of your task declarations. Within your `@task` declarations you should place the Bash code that will be run on your server when the task is executed. + +The `init` command may be used to easily create a stub Envoy file: + + envoy init user@192.168.1.1 + + +## Running Tasks + +To run a task, use the `run` command of your Envoy installation: + + envoy run foo + +If needed, you may pass variables into the Envoy file using command line switches: + + envoy run deploy --branch=master + +You may use the options via the Blade syntax you are used to: + + @servers(['web' => '192.168.1.1']) + + @task('deploy', ['on' => 'web']) + cd site + git pull origin {{ $branch }} + php artisan migrate + @endtask + +#### Bootstrapping + +You may use the ```@setup``` directive to declare variables and do general PHP work inside the Envoy file: + + @setup + $now = new DateTime(); + + $environment = isset($env) ? $env : "testing"; + @endsetup + +You may also use ```@include``` to include any PHP files: + + @include('vendor/autoload.php'); + + +## Multiple Servers + +You may easily run a task across multiple servers. Simply list the servers in the task declaration: + + @servers(['web-1' => '192.168.1.1', 'web-2' => '192.168.1.2']) + + @task('deploy', ['on' => ['web-1', 'web-2']]) + cd site + git pull origin {{ $branch }} + php artisan migrate + @endtask + +By default, the task will be executed on each server serially. Meaning, the task will finish running on the first server before proceeding to execute on the next server. + + +## Parallel Execution + +If you would like to run a task across multiple servers in parallel, simply add the `parallel` option to your task declaration: + + @servers(['web-1' => '192.168.1.1', 'web-2' => '192.168.1.2']) + + @task('deploy', ['on' => ['web-1', 'web-2'], 'parallel' => true]) + cd site + git pull origin {{ $branch }} + php artisan migrate + @endtask + + +## Task Macros + +Macros allow you to define a set of tasks to be run in sequence using a single command. For instance: + + @servers(['web' => '192.168.1.1']) + + @macro('deploy') + foo + bar + @endmacro + + @task('foo') + echo "HELLO" + @endtask + + @task('bar') + echo "WORLD" + @endtask + +The `deploy` macro can now be run via a single, simple command: + + envoy run deploy + + + +## Notifications + +#### HipChat + +After running a task, you may send a notification to your team's HipChat room using the simple `@hipchat` directive: + + @servers(['web' => '192.168.1.1']) + + @task('foo', ['on' => 'web']) + ls -la + @endtask + + @after + @hipchat('token', 'room', 'Envoy') + @endafter + +You can also specify a custom message to the hipchat room. Any variables declared in ```@setup``` or included with ```@include``` will be available for use in the message: + + @after + @hipchat('token', 'room', 'Envoy', "$task ran on [$environment]") + @endafter + +This is an amazingly simple way to keep your team notified of the tasks being run on the server. + +#### Slack + +The following syntax may be used to send a notification to [Slack](https://slack.com): + + @after + @slack('team', 'token', 'channel') + @endafter + + +## Updating Envoy + +To update Envoy, simply use Composer: + + composer global update + From 2a88b15db16136c77163b3aef357f1c11995278f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 3 Mar 2015 21:04:07 -0600 Subject: [PATCH 098/276] Update docs. --- envoy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/envoy.md b/envoy.md index c0ae446f780..ecea306bf84 100644 --- a/envoy.md +++ b/envoy.md @@ -12,7 +12,7 @@ ## Introduction -Laravel Envoy provides a clean, minimal syntax for defining common tasks you run on your remote servers. Using a [Blade](/docs/4.2/templates#blade-templating) style syntax, you can easily setup tasks for deployment, Artisan commands, and more. +Laravel Envoy provides a clean, minimal syntax for defining common tasks you run on your remote servers. Using a Blade style syntax, you can easily setup tasks for deployment, Artisan commands, and more. > **Note:** Envoy requires PHP version 5.4 or greater, and only runs on Mac / Linux operating systems. From e762138b6c5cda50ddc07885d3ef65adeaa3a827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emin=20=C5=9Een?= Date: Wed, 4 Mar 2015 12:22:29 +0200 Subject: [PATCH 099/276] Added Social Authentication Provider Method $user->getId(); --- authentication.md | 1 + 1 file changed, 1 insertion(+) diff --git a/authentication.md b/authentication.md index 97e5af4306a..ac2f7b1647f 100644 --- a/authentication.md +++ b/authentication.md @@ -337,6 +337,7 @@ Once you have a user instance, you can grab a few more details about the user: $tokenSecret = $user->tokenSecret; // All Providers + $user->getId(); $user->getNickname(); $user->getName(); $user->getEmail(); From 51f10131c05c49e2fb12aaa9d1616d87cf152d10 Mon Sep 17 00:00:00 2001 From: MicMonen Date: Wed, 4 Mar 2015 15:30:02 +0100 Subject: [PATCH 100/276] add object as additional casts type for eloquent --- eloquent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eloquent.md b/eloquent.md index 7c64093627a..e4a55bcd0a2 100644 --- a/eloquent.md +++ b/eloquent.md @@ -1209,7 +1209,7 @@ If you have some attributes that you want to always convert to another data-type 'is_admin' => 'boolean', ]; -Now the `is_admin` attribute will always be cast to a boolean when you access it, even if the underlying value is stored in the database as an integer. Other supported cast types are: `integer`, `real`, `float`, `double`, `string`, `boolean`, and `array`. +Now the `is_admin` attribute will always be cast to a boolean when you access it, even if the underlying value is stored in the database as an integer. Other supported cast types are: `integer`, `real`, `float`, `double`, `string`, `boolean`, `object` and `array`. The `array` cast is particularly useful for working with columns that are stored as serialized JSON. For example, if your database has a TEXT type field that contains serialized JSON, adding the `array` cast to that attribute will automatically deserialize the attribute to a PHP array when you access it on your Eloquent model: From 1886b0dfdcfc18126b1618a032379fabaa50e325 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Wed, 4 Mar 2015 12:42:36 -0500 Subject: [PATCH 101/276] Update Envoy URI. --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 7435d0a92b9..782775f8fd2 100644 --- a/homestead.md +++ b/homestead.md @@ -33,7 +33,7 @@ Homestead is currently built and tested using Vagrant 1.6. - Redis - Memcached - Beanstalkd -- [Laravel Envoy](/docs/ssh#envoy-task-runner) +- [Laravel Envoy](/docs/5.0/envoy) - Fabric + HipChat Extension - [Blackfire Profiler](#blackfire-profiler) From a3c884df75898a90956e1a135f722c70a915d9b2 Mon Sep 17 00:00:00 2001 From: Conor Smith Date: Wed, 4 Mar 2015 19:09:42 +0000 Subject: [PATCH 102/276] Added `resource` to Routing section in helpers.md The `resource` function is the only remaining Routing helper that isn't documented. --- helpers.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helpers.md b/helpers.md index abde00ec617..3598092ac0d 100644 --- a/helpers.md +++ b/helpers.md @@ -243,6 +243,12 @@ Register a new PATCH route with the router. Register a new DELETE route with the router. delete('foo/bar', 'FooController@action'); + +### resource + +Register a new RESTful resource route with the router. + + resource('foo', 'FooController'); ## Strings From 9777617d86383fe719a5f31dab87cf95eecc15b3 Mon Sep 17 00:00:00 2001 From: Donato Rotunno Date: Thu, 5 Mar 2015 09:53:26 +0100 Subject: [PATCH 103/276] Emerge 'deleteFileAfterSend' option for Binary Response --- responses.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/responses.md b/responses.md index f6b413014dd..91c0e11e6af 100644 --- a/responses.md +++ b/responses.md @@ -137,6 +137,8 @@ The `json` method will automatically set the `Content-Type` header to `applicati return response()->download($pathToFile, $name, $headers); + return response()->download($pathToFile)->deleteFileAfterSend(true); + > **Note:** Symfony HttpFoundation, which manages file downloads, requires the file being downloaded to have an ASCII file name. From c85cf214e3d70956f65eb453e7bb667058ac70e5 Mon Sep 17 00:00:00 2001 From: Sjors van Dongen Date: Fri, 6 Mar 2015 10:30:39 +0100 Subject: [PATCH 104/276] Update schema.md Better explanation of renaming columns with Doctrine. --- schema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema.md b/schema.md index 680ea9ab21d..dff37fce7e3 100644 --- a/schema.md +++ b/schema.md @@ -127,7 +127,7 @@ To rename a column, you may use the `renameColumn` method on the Schema builder. $table->renameColumn('from', 'to'); }); -> **Note:** Renaming `enum` column types is not supported. +> **Note:** Renaming columns in a table with `enum` column is currently not supported. ## Dropping Columns From 1a9b504149edf69f5e475411265866d0e0d5c0ba Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 6 Mar 2015 08:25:32 -0600 Subject: [PATCH 105/276] Document vmware support. --- homestead.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 782775f8fd2..ecdec505e18 100644 --- a/homestead.md +++ b/homestead.md @@ -40,10 +40,12 @@ Homestead is currently built and tested using Vagrant 1.6. ## Installation & Setup -### Installing VirtualBox & Vagrant +### Installing VirtualBox / VMware & Vagrant Before launching your Homestead environment, you must install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) and [Vagrant](http://www.vagrantup.com/downloads.html). Both of these software packages provide easy-to-use visual installers for all popular operating systems. +In addition to VirtualBox, Homestead also supports VMware. To use the VMware provider, you will need to purchase both VMware Fusion / Desktop and the [VMware Vagrant plug-in](http://www.vagrantup.com/vmware). VMware provides much faster shared folder performance out of the box. + ### Adding The Vagrant Box Once VirtualBox 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: @@ -84,6 +86,12 @@ The `Homestead.yaml` file will be placed in the `~/.homestead` directory. If you homestead edit +### Configure Your Provider + +The `provider` key in your `Homestead.yaml` file indicates which Vagrant provider should be used: `virtualbox` or `vmware_fusion`. You may set this to whichever provider you prefer. + + provider: virtualbox + ### Set Your SSH Key Next, you should edit the `Homestead.yaml` file. In this file, you can configure the path to your public SSH key, as well as the folders you wish to be shared between your main machine and the Homestead virtual machine. From 945db236ccb9b1ac7a97d5f657530624088df3cb Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 6 Mar 2015 08:25:46 -0600 Subject: [PATCH 106/276] Small heading. --- homestead.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homestead.md b/homestead.md index ecdec505e18..260a31948f5 100644 --- a/homestead.md +++ b/homestead.md @@ -44,6 +44,8 @@ Homestead is currently built and tested using Vagrant 1.6. Before launching your Homestead environment, you must install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) and [Vagrant](http://www.vagrantup.com/downloads.html). Both of these software packages provide easy-to-use visual installers for all popular operating systems. +#### VMware + In addition to VirtualBox, Homestead also supports VMware. To use the VMware provider, you will need to purchase both VMware Fusion / Desktop and the [VMware Vagrant plug-in](http://www.vagrantup.com/vmware). VMware provides much faster shared folder performance out of the box. ### Adding The Vagrant Box From 6e151724e3f3736f1009287cf854f7ac41197d96 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 6 Mar 2015 08:26:00 -0600 Subject: [PATCH 107/276] Note. --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 260a31948f5..280e9a8e09f 100644 --- a/homestead.md +++ b/homestead.md @@ -50,7 +50,7 @@ In addition to VirtualBox, Homestead also supports VMware. To use the VMware pro ### Adding The Vagrant Box -Once VirtualBox 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: +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: vagrant box add laravel/homestead From d621a639d99dd7d0379fa60109a9be825ec1b70b Mon Sep 17 00:00:00 2001 From: orrd Date: Fri, 6 Mar 2015 22:54:02 -0600 Subject: [PATCH 108/276] emailOutputTo() requires sendOutputTo() first The example in the current docs fails with exception 'LogicException' with message 'Must direct output to a file in order to e-mail results.' It appears that you have to call sendOutputTo() first before emailOutputTo() can be used. --- artisan.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/artisan.md b/artisan.md index 0ab012fa502..2ef3e876d17 100644 --- a/artisan.md +++ b/artisan.md @@ -151,7 +151,9 @@ Let's look at a few more scheduling examples: #### E-mail The Output Of A Scheduled Job - $schedule->command('foo')->emailOutputTo('foo@example.com'); +Note that you must send the output to a file first before it can be emailed. + + $schedule->command('foo')->sendOutputTo($filePath)->emailOutputTo('foo@example.com'); #### Send The Output Of The Scheduled Job To A Given Location @@ -159,4 +161,4 @@ Let's look at a few more scheduling examples: #### Ping A Given URL After The Job Runs - $schedule->command('foo')->thenPing($url); \ No newline at end of file + $schedule->command('foo')->thenPing($url); From ce7ed21d6fd8414523c1ecfe41464dade40f0ad4 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Sat, 7 Mar 2015 16:33:44 +0100 Subject: [PATCH 109/276] Missing documentation for cache events --- cache.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cache.md b/cache.md index 3bd92e60f03..de277a0ace9 100644 --- a/cache.md +++ b/cache.md @@ -131,6 +131,28 @@ In contrast, this statement would remove only caches tagged with `authors`, so " Cache::tags('authors')->flush(); + +## Cache events + +Cache actions can trigger events. You may for instance use `Event` listeners to and access the following events. + +A cache entry exists and has been hit: + + Event::listen('cache.hit', function($key, $value) { ... }); + +A cache entry has been asked but does not exist: + + Event::listen('cache.missed', function($key) { ... }); + +A cache entry has been set or updated. `$minutes` will be equal to `0` if no expiration duration is set: + + Event::listen('cache.write', function($key, $value, $minutes) { ... }); + +A cache entry has been deleted: + + Event::listen('cache.delete', function($key) { ... }); + + ## Database Cache From 2679d872125fd1318795757a1b067870556837cf Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Sat, 7 Mar 2015 16:34:42 +0100 Subject: [PATCH 110/276] Remove empty line --- cache.md | 1 - 1 file changed, 1 deletion(-) diff --git a/cache.md b/cache.md index de277a0ace9..73304a33fea 100644 --- a/cache.md +++ b/cache.md @@ -152,7 +152,6 @@ A cache entry has been deleted: Event::listen('cache.delete', function($key) { ... }); - ## Database Cache From 6ba660318232c4fc09be6ecf5cb43b775dfa09ad Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Sat, 7 Mar 2015 16:36:09 +0100 Subject: [PATCH 111/276] Fix typo --- cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache.md b/cache.md index 73304a33fea..2fff3c1ca7e 100644 --- a/cache.md +++ b/cache.md @@ -134,7 +134,7 @@ In contrast, this statement would remove only caches tagged with `authors`, so " ## Cache events -Cache actions can trigger events. You may for instance use `Event` listeners to and access the following events. +Cache actions can trigger events. You may for instance use `Event` listeners to access the following events. A cache entry exists and has been hit: From 69dc61e0f79792afbf28e35bc4ad11fc7be58f91 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 7 Mar 2015 17:49:54 -0600 Subject: [PATCH 112/276] fix formatting. --- artisan.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artisan.md b/artisan.md index 2ef3e876d17..d6a39fa038d 100644 --- a/artisan.md +++ b/artisan.md @@ -151,10 +151,10 @@ Let's look at a few more scheduling examples: #### E-mail The Output Of A Scheduled Job -Note that you must send the output to a file first before it can be emailed. - $schedule->command('foo')->sendOutputTo($filePath)->emailOutputTo('foo@example.com'); +> **Note:** You must send the output to a file before it can be mailed. + #### Send The Output Of The Scheduled Job To A Given Location $schedule->command('foo')->sendOutputTo($filePath); From 45b4bb1d741b5eb5e2ecc9a3b044dad5069d45e4 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Sun, 8 Mar 2015 21:17:43 +1100 Subject: [PATCH 113/276] Update installation.md --- installation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/installation.md b/installation.md index c56dba49df7..832f1468ff8 100644 --- a/installation.md +++ b/installation.md @@ -45,6 +45,7 @@ The Laravel framework has a few system requirements: - Mcrypt PHP Extension - OpenSSL PHP Extension - Mbstring PHP Extension +- Tokenizer PHP Extension As of PHP 5.5, some OS distributions may require you to manually install the PHP JSON extension. When using Ubuntu, this can be done via `apt-get install php5-json`. From 5c5529972629bc7531c767d48fdfdc97656589f2 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 10 Mar 2015 18:58:00 -0500 Subject: [PATCH 114/276] Update docs. --- elixir.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir.md b/elixir.md index 361ce86aac9..6eba74f142e 100644 --- a/elixir.md +++ b/elixir.md @@ -73,7 +73,7 @@ elixir(function(mix) { }); ``` -This assumes that your Sass files are stored in `resources/assets/sass`. +This assumes that your Sass files are stored in `resources/assets/sass`. The `sass` method may only be called once, if you would like to compile multiple Sass files, pass an array to the `sass` method. #### Compile CoffeeScript From f2e3774f172d80d4bca5da8b38b091285a632832 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 10 Mar 2015 19:17:38 -0500 Subject: [PATCH 115/276] fix all kinds of problems. --- cache.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/cache.md b/cache.md index ea34b39c25f..986bece4d79 100644 --- a/cache.md +++ b/cache.md @@ -4,6 +4,7 @@ - [Cache Usage](#cache-usage) - [Increments & Decrements](#increments-and-decrements) - [Cache Tags](#cache-tags) +- [Cache Events](#cache-events) - [Database Cache](#database-cache) @@ -138,25 +139,25 @@ In contrast, this statement would remove only caches tagged with `authors`, so " Cache::tags('authors')->flush(); -## Cache events +## Cache Events -Cache actions can trigger events. You may for instance use `Event` listeners to access the following events. +To execute code on every cache operation, you may listen for the events fired by the cache: -A cache entry exists and has been hit: - - Event::listen('cache.hit', function($key, $value) { ... }); - -A cache entry has been asked but does not exist: - - Event::listen('cache.missed', function($key) { ... }); - -A cache entry has been set or updated. `$minutes` will be equal to `0` if no expiration duration is set: + Event::listen('cache.hit', function($key, $value) { + // + }); - Event::listen('cache.write', function($key, $value, $minutes) { ... }); + Event::listen('cache.missed', function($key) { + // + }); -A cache entry has been deleted: + Event::listen('cache.write', function($key, $value, $minutes) { + // + }); - Event::listen('cache.delete', function($key) { ... }); + Event::listen('cache.delete', function($key) { + // + }); ## Database Cache From 62cab089b967d43c2cad4bcf59aa9b24d75a36db Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Wed, 11 Mar 2015 11:07:37 -0400 Subject: [PATCH 116/276] Clarify Elixir Sass options --- elixir.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/elixir.md b/elixir.md index 6eba74f142e..06d2f65df20 100644 --- a/elixir.md +++ b/elixir.md @@ -54,7 +54,7 @@ elixir(function(mix) { In the example above, Elixir assumes that your Less files are stored in `resources/assets/less`. -#### Compiling Multiple Less Files +#### Compile Multiple Less Files ```javascript elixir(function(mix) { @@ -75,6 +75,27 @@ elixir(function(mix) { This assumes that your Sass files are stored in `resources/assets/sass`. The `sass` method may only be called once, if you would like to compile multiple Sass files, pass an array to the `sass` method. +By default, Elixir, underneath the hood, uses the LibSass library for compilation. In some instances, it might prove advantageous to instead leverage the Ruby version, which, though slower, is more feature rich. Assuming that you have both Ruby and the Sass gem installed (`gem install sass`), you can enable "Ruby-mode" as the fourth argument to the `sass` method, like so: + +```javascript +elixir(function(mix) { + // src, outputDir, pluginOpts, useRuby + mix.sass("app.sass", "public/css", null, true); +}); +``` + +#### Compile Without Source Maps + +```javascript +elixir.config.sourcemaps = false; + +elixir(function(mix) { + mix.sass("app.scss"); +}); +``` + +Source maps are enabled out of the box. As such, for each file that is compiled, you'll find a companion `*.css.map` file in the same directory. This mapping allows you to, when debugging, trace your compiled stylesheet selectors back to your original Sass or Less partials! Should you need to disable this functionality, however, the code sample above will do the trick. + #### Compile CoffeeScript ```javascript From 3bb1f530570dcaaaf2274dbcf3d033adf6861697 Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Wed, 11 Mar 2015 12:21:35 -0400 Subject: [PATCH 117/276] Switch to rubySass example for Elixir. --- elixir.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/elixir.md b/elixir.md index 06d2f65df20..5531914bff4 100644 --- a/elixir.md +++ b/elixir.md @@ -75,12 +75,11 @@ elixir(function(mix) { This assumes that your Sass files are stored in `resources/assets/sass`. The `sass` method may only be called once, if you would like to compile multiple Sass files, pass an array to the `sass` method. -By default, Elixir, underneath the hood, uses the LibSass library for compilation. In some instances, it might prove advantageous to instead leverage the Ruby version, which, though slower, is more feature rich. Assuming that you have both Ruby and the Sass gem installed (`gem install sass`), you can enable "Ruby-mode" as the fourth argument to the `sass` method, like so: +By default, Elixir, underneath the hood, uses the LibSass library for compilation. In some instances, it might prove advantageous to instead leverage the Ruby version, which, though slower, is more feature rich. Assuming that you have both Ruby and the Sass gem installed (`gem install sass`), you may enable Ruby-mode, like so: ```javascript elixir(function(mix) { - // src, outputDir, pluginOpts, useRuby - mix.sass("app.sass", "public/css", null, true); + mix.rubySass("app.sass"); }); ``` From 17044fa5ab38b9bba4f5d679a7bf5677521e2ed3 Mon Sep 17 00:00:00 2001 From: thangngoc89 Date: Thu, 12 Mar 2015 04:11:52 +0700 Subject: [PATCH 118/276] Update IronMQ dependency --- queues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queues.md b/queues.md index ffccc62153f..9a17cbb0297 100644 --- a/queues.md +++ b/queues.md @@ -27,7 +27,7 @@ The following dependencies are needed for the listed queue drivers: - Amazon SQS: `aws/aws-sdk-php` - Beanstalkd: `pda/pheanstalk ~3.0` -- IronMQ: `iron-io/iron_mq` +- IronMQ: `iron-io/iron_mq ~1.0` - Redis: `predis/predis ~1.0` From 78bb025500bbf5bf7acf8d27bb675dda3d14f35d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 11 Mar 2015 20:17:35 -0500 Subject: [PATCH 119/276] fix reference. --- queues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queues.md b/queues.md index 9a17cbb0297..1f0d0690682 100644 --- a/queues.md +++ b/queues.md @@ -27,7 +27,7 @@ The following dependencies are needed for the listed queue drivers: - Amazon SQS: `aws/aws-sdk-php` - Beanstalkd: `pda/pheanstalk ~3.0` -- IronMQ: `iron-io/iron_mq ~1.0` +- IronMQ: `iron-io/iron_mq ~1.5` - Redis: `predis/predis ~1.0` From b0e204acbe5638fdf04ee5a9ce574422902dcf22 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Fri, 13 Mar 2015 01:34:52 +1100 Subject: [PATCH 120/276] Update billing.md --- billing.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/billing.md b/billing.md index 6d964f1a92e..d2c30e316e9 100644 --- a/billing.md +++ b/billing.md @@ -53,7 +53,14 @@ Next, add the `Billable` trait and appropriate date mutators to your model defin #### Stripe Key -Finally, set your Stripe key in one of your bootstrap files or service providers, such as the `AppServiceProvider`: +Finally, set your Stripe key in your `services.php` config file: + + 'stripe' => [ + 'model' => 'User', + 'secret' => env('STRIPE_API_SECRET', 'place_your_stripe_key_here'), + ], + +Alternatively you can store it in one of your bootstrap files or service providers, such as the `AppServiceProvider`: User::setStripeKey('stripe-key'); From 117fb14bf3a48ce12ab4b168f16dc558bdc616e9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 12 Mar 2015 11:05:11 -0500 Subject: [PATCH 121/276] Remove default value. --- billing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/billing.md b/billing.md index d2c30e316e9..87ca3c07268 100644 --- a/billing.md +++ b/billing.md @@ -57,9 +57,9 @@ Finally, set your Stripe key in your `services.php` config file: 'stripe' => [ 'model' => 'User', - 'secret' => env('STRIPE_API_SECRET', 'place_your_stripe_key_here'), + 'secret' => env('STRIPE_API_SECRET'), ], - + Alternatively you can store it in one of your bootstrap files or service providers, such as the `AppServiceProvider`: User::setStripeKey('stripe-key'); From 7e8d7a860f22e286c725b5f832ed8ebff68ea25d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 12 Mar 2015 21:35:55 -0500 Subject: [PATCH 122/276] working on cashier docs --- billing.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/billing.md b/billing.md index 87ca3c07268..ae22cf60278 100644 --- a/billing.md +++ b/billing.md @@ -26,7 +26,8 @@ Laravel Cashier provides an expressive, fluent interface to [Stripe's](https://s First, add the Cashier package to your `composer.json` file: - "laravel/cashier": "~3.0" + "laravel/cashier": "~4.0" (For Stripe APIs on 2015-02-18 version and later) + "laravel/cashier": "~3.0" (For Stripe APIs up to and including 2015-02-16 version) #### Service Provider From 65c53ca2100fe9fd4834b2923ece1263c8ec987b Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 13 Mar 2015 14:33:42 +0100 Subject: [PATCH 123/276] Tweaked docs about Blackfire Blackfire has two sets of credentials: client and server. For homestead, we need the server credentials. Even if it is already mentioned in the docs, people are confused. So, this PR tries to make things a little clearer. Also, what do you think about renaming the YAML `id` and `token` keys to `server-id` and `server-token` respectively? I can make the needed changes and PRs. --- homestead.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homestead.md b/homestead.md index 280e9a8e09f..06336d1e0d3 100644 --- a/homestead.md +++ b/homestead.md @@ -205,10 +205,10 @@ If you wish, you may forward additional ports to the Vagrant box, as well as spe [Blackfire Profiler](https://blackfire.io) by SensioLabs automatically gathers data about your code's execution, such as RAM, CPU time, and disk I/O. Homestead makes it a breeze to use this profiler for your own applications. -All of the proper packages have already been installed on your Homestead box, you simply need to set a Blackfire Server ID and token in your `Homestead.yaml` file: +All of the proper packages have already been installed on your Homestead box, you simply need to set a Blackfire **Server** ID and token in your `Homestead.yaml` file: blackfire: - - id: your-id - token: your-token + - id: your-server-id + token: your-server-token Once you have configured your Blackfire credentials, re-provision the box using `homestead provision` or `vagrant provision`. Of course, be sure to review the [Blackfire documentation](https://blackfire.io/getting-started) to learn how to install the Blackfire companion extension for your web browser. From 0af23be8260b1edc07c9577a6356dfd579555fb5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 13 Mar 2015 09:20:43 -0500 Subject: [PATCH 124/276] Update Vagrant version. --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 280e9a8e09f..4d5dae479ed 100644 --- a/homestead.md +++ b/homestead.md @@ -18,7 +18,7 @@ Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web > **Note:** If you are using Windows, you may need to enable hardware virtualization (VT-x). It can usually be enabled via your BIOS. -Homestead is currently built and tested using Vagrant 1.6. +Homestead is currently built and tested using Vagrant 1.7. ## Included Software From 4cd5a28492890d5017ab75456b6073e0ab3be18e Mon Sep 17 00:00:00 2001 From: widey Date: Fri, 13 Mar 2015 15:44:43 +0000 Subject: [PATCH 125/276] Update routing.md Updated ## Method Spoofing to include PATCH action. --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index 7c07d368786..3ecdc3b94f2 100644 --- a/routing.md +++ b/routing.md @@ -100,7 +100,7 @@ Laravel also stores the CSRF token in a `XSRF-TOKEN` cookie. You can use the coo ## Method Spoofing -HTML forms do not support `PUT` or `DELETE` actions. So, when defining `PUT` or `DELETE` routes that are called from an HTML form, you will need to add a hidden `_method` field to the form. +HTML forms do not support `PUT`, `PATCH` or `DELETE` actions. So, when defining `PUT`, `PATCH` or `DELETE` routes that are called from an HTML form, you will need to add a hidden `_method` field to the form. The value sent with the `_method` field will be used as the HTTP request method. For example: From 3b03b25d884bb24a2a6b52cce91e5da2d1faf7f0 Mon Sep 17 00:00:00 2001 From: findstar Date: Sat, 14 Mar 2015 01:32:00 +0900 Subject: [PATCH 126/276] fix version 4.2 -> 5.0 --- contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing.md b/contributing.md index c222a543970..498e3563278 100644 --- a/contributing.md +++ b/contributing.md @@ -1,3 +1,3 @@ # Contribution Guidelines -If you are submitting documentation for the **current stable release**, submit it to the corresponding branch. For example, documentation for Laravel 4.2 would be submitted to the `4.2` branch. Documentation intended for the next release of Laravel should be submitted to the `master` branch. \ No newline at end of file +If you are submitting documentation for the **current stable release**, submit it to the corresponding branch. For example, documentation for Laravel 5.0 would be submitted to the `5.0` branch. Documentation intended for the next release of Laravel should be submitted to the `master` branch. \ No newline at end of file From 800c995620e6092bb8501bbd9223bfc674e541ff Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 13 Mar 2015 22:05:56 -0500 Subject: [PATCH 127/276] Update docs. --- upgrade.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/upgrade.md b/upgrade.md index c932affffd3..77d848e2736 100644 --- a/upgrade.md +++ b/upgrade.md @@ -1,11 +1,19 @@ # Upgrade Guide +- [Upgrading To 5.0.16](#upgrade-5.0.16) - [Upgrading To 5.0 From 4.2](#upgrade-5.0) - [Upgrading To 4.2 From 4.1](#upgrade-4.2) - [Upgrading To 4.1.29 From <= 4.1.x](#upgrade-4.1.29) - [Upgrading To 4.1.26 From <= 4.1.25](#upgrade-4.1.26) - [Upgrading To 4.1 From 4.0](#upgrade-4.1) + +## Upgrading To 5.0.16 + +In your `bootstrap/autoload.php` file, update the `$compiledPath` variable to: + + $compiledPath = __DIR__.'/../vendor/compiled.php'; + ## Upgrading To 5.0 From 4.2 From 11eea60a3a9dc3506c87ffa6cb309b9e6d7c4555 Mon Sep 17 00:00:00 2001 From: Austin H Date: Sat, 14 Mar 2015 19:50:37 -0700 Subject: [PATCH 128/276] Change "of" to "in" in authentication. The part "You may have this via the `reminder.expire` option of your `config/auth.php` file." sounds rather weird, changing it to "[...] option in your `config/auth.php` file." sounds a bit better. --- authentication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentication.md b/authentication.md index ac2f7b1647f..1b0b96269ce 100644 --- a/authentication.md +++ b/authentication.md @@ -282,7 +282,7 @@ Your user will receive an e-mail with a link that points to the `getReset` metho protected $redirectTo = '/dashboard'; -> **Note:** By default, password reset tokens expire after one hour. You may change this via the `reminder.expire` option of your `config/auth.php` file. +> **Note:** By default, password reset tokens expire after one hour. You may change this via the `reminder.expire` option in your `config/auth.php` file. ## Social Authentication From 9dd045a35f8a145cefb5bb955a6c4ee4a54d3e70 Mon Sep 17 00:00:00 2001 From: Pascal Borreli Date: Sun, 15 Mar 2015 07:51:23 +0000 Subject: [PATCH 129/276] Fixed typos --- extending.md | 2 +- releases.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extending.md b/extending.md index ced62bd29d3..bf67b21e4b3 100644 --- a/extending.md +++ b/extending.md @@ -129,7 +129,7 @@ The `retrieveById` function typically receives a numeric key representing the us The `retrieveByToken` function retrieves a user by their unique `$identifier` and "remember me" `$token`, stored in a field `remember_token`. As with the previous method, the `Authenticatable` implementation should be returned. -The `updateRememberToken` method updates the `$user` field `remember_token` with the new `$token`. The new token can be either a fresh token, assigned on successfull "remember me" login attempt, or a null when user is logged out. +The `updateRememberToken` method updates the `$user` field `remember_token` with the new `$token`. The new token can be either a fresh token, assigned on successful "remember me" login attempt, or a null when user is logged out. The `retrieveByCredentials` method receives the array of credentials passed to the `Auth::attempt` method when attempting to sign into an application. The method should then "query" the underlying persistent storage for the user matching those credentials. Typically, this method will run a query with a "where" condition on `$credentials['username']`. The method should then return an implementation of `UserInterface`. **This method should not attempt to do any password validation or authentication.** diff --git a/releases.md b/releases.md index 7e1dcd10971..a16c1906bd2 100644 --- a/releases.md +++ b/releases.md @@ -119,7 +119,7 @@ The base Laravel controller utilizes the new `DispatchesCommands` trait, allowin $this->dispatch(new PurchasePodcastCommand($user, $podcast)); -Of course, you may also use commands for tasks that are executed synchonrously (are not queued). In fact, using commands is a great way to encapsulate complex tasks your application needs to perform. For more information, check out the [command bus](/docs/5.0/bus) documentation. +Of course, you may also use commands for tasks that are executed synchronously (are not queued). In fact, using commands is a great way to encapsulate complex tasks your application needs to perform. For more information, check out the [command bus](/docs/5.0/bus) documentation. ### Database Queue From bd637bebe070c5ce24412ec1bd9a78f2528e3794 Mon Sep 17 00:00:00 2001 From: Benjamin Goetz Date: Tue, 17 Mar 2015 12:15:42 +0100 Subject: [PATCH 130/276] Clarify TestCase::seed() parameter --- testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing.md b/testing.md index da0a9addf5c..db25561600c 100644 --- a/testing.md +++ b/testing.md @@ -198,7 +198,7 @@ You may re-seed your database from a test using the `seed` method: $this->seed(); - $this->seed($connection); + $this->seed('DatabaseSeeder'); More information on creating seeds may be found in the [migrations and seeding](/docs/migrations#database-seeding) section of the documentation. From 58b3e003dca6b059d950e278977304b1ae666585 Mon Sep 17 00:00:00 2001 From: Martins Sipenko Date: Tue, 17 Mar 2015 16:45:57 +0200 Subject: [PATCH 131/276] Added missing `errorlog` logging option --- errors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/errors.md b/errors.md index 218cbc886f1..bb96fee49ec 100644 --- a/errors.md +++ b/errors.md @@ -16,7 +16,7 @@ For example, if you wish to use a single log file instead of daily files, you ca 'log' => 'single' -Out of the box, Laravel supported `single`, `daily`, and `syslog` logging modes. However, you are free to customize the logging for your application as you wish by overriding the `ConfigureLogging` bootstrapper class. +Out of the box, Laravel supported `single`, `daily`, `syslog` and `errorlog` logging modes. However, you are free to customize the logging for your application as you wish by overriding the `ConfigureLogging` bootstrapper class. ### Error Detail From e3c7f193ff23d61a6aac1e1d1d9bae0f5bbe3c9a Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Thu, 19 Mar 2015 01:51:19 +1100 Subject: [PATCH 132/276] Update homestead.md --- homestead.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homestead.md b/homestead.md index ea0eb776c12..0ba84aad329 100644 --- a/homestead.md +++ b/homestead.md @@ -60,9 +60,9 @@ If this command fails, you may have an old version of Vagrant that requires the ### Installing Homestead -#### Manually Via Git (No Local PHP) +#### Option 1 - Manually Via Git (No Local PHP) -Alternatively, if you do not want to install PHP on your local machine, you may install Homestead manually by simply cloning the repository. Consider cloning the repository into a `Homestead` folder within your "home" directory, as the Homestead box will serve as the host to all of your Laravel (and PHP) projects: +If you do not want to install PHP on your local machine, you may install Homestead manually by simply cloning the repository. Consider cloning the repository into a `Homestead` folder within your "home" directory, as the Homestead box will serve as the host to all of your Laravel (and PHP) projects: git clone https://github.com/laravel/homestead.git Homestead @@ -72,7 +72,7 @@ Once you have installed the Homestead CLI tool, run the `bash init.sh` command t The `Homestead.yaml` file will be placed in your `~/.homestead` directory. -#### With Composer + PHP Tool +#### Option 2 - With Composer + PHP Tool Once the box has been added to your Vagrant installation, you are ready to install the Homestead CLI tool using the Composer `global` command: From 51a163f9282ef9dd4fa1a454420210eb4a4db786 Mon Sep 17 00:00:00 2001 From: Michael Dyrynda Date: Fri, 20 Mar 2015 14:53:29 +1030 Subject: [PATCH 133/276] Add note about destructive nature of running the provision command. --- homestead.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homestead.md b/homestead.md index 0ba84aad329..db3eb6b6aca 100644 --- a/homestead.md +++ b/homestead.md @@ -173,6 +173,8 @@ To connect to your MySQL or Postgres database from your main machine via Navicat Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. There are two ways to do this: First, you may simply add the sites to your `Homestead.yaml` file and then run `homestead provision` or `vagrant provision`. +> **Note:** This process is destructive. When running the `provision` command, your existing databases will be destroyed and recreated. + Alternatively, you may use the `serve` script that is available on your Homestead environment. To use the `serve` script, SSH into your Homestead environment and run the following command: serve domain.app /home/vagrant/Code/path/to/public/directory From 74ba89d4d1924b8f5eb7b04860d5868868c20569 Mon Sep 17 00:00:00 2001 From: Taufik Rahman Date: Fri, 20 Mar 2015 16:28:35 +0700 Subject: [PATCH 134/276] Must extends ServiceProvider This class file must extends ServiceProvider and has register method to work --- filesystem.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/filesystem.md b/filesystem.md index eae560d0361..2a60444dc4c 100644 --- a/filesystem.md +++ b/filesystem.md @@ -127,8 +127,9 @@ The first argument of the `extend` method is the name of the driver and the seco use League\Flysystem\Filesystem; use Dropbox\Client as DropboxClient; use League\Flysystem\Dropbox\DropboxAdapter; + use Illuminate\Support\ServiceProvider; - class DropboxFilesystemServiceProvider { + class DropboxFilesystemServiceProvider extends ServiceProvider { public function boot() { @@ -139,5 +140,10 @@ The first argument of the `extend` method is the name of the driver and the seco return new Filesystem(new DropboxAdapter($client)); }); } + + public function register() + { + // + } } From 3c68829af3b9329414d3f438c59da1160f2730cd Mon Sep 17 00:00:00 2001 From: Taufik Rahman Date: Fri, 20 Mar 2015 16:30:41 +0700 Subject: [PATCH 135/276] fix indentation fix indentation on DropboxFilesystemServiceProvider Class --- filesystem.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/filesystem.md b/filesystem.md index 2a60444dc4c..211076f506e 100644 --- a/filesystem.md +++ b/filesystem.md @@ -129,7 +129,7 @@ The first argument of the `extend` method is the name of the driver and the seco use League\Flysystem\Dropbox\DropboxAdapter; use Illuminate\Support\ServiceProvider; - class DropboxFilesystemServiceProvider extends ServiceProvider { + class DropboxFilesystemServiceProvider extends ServiceProvider { public function boot() { @@ -142,8 +142,8 @@ The first argument of the `extend` method is the name of the driver and the seco } public function register() - { - // - } + { + // + } } From eab44ee3a394385c10fab3589ef885ab3edeb428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20=C5=A0kvorc?= Date: Sat, 21 Mar 2015 02:02:20 +0100 Subject: [PATCH 136/276] Typo fix --- container.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container.md b/container.md index b4c7b0472fa..33c9b352fac 100644 --- a/container.md +++ b/container.md @@ -144,7 +144,7 @@ Lastly, but most importantly, you may simply "type-hint" the dependency in the c ### Injecting Concrete Dependencies -A very powerful features of the service container is its ability to bind an interface to a given implementation. For example, perhaps our application integrates with the [Pusher](https://pusher.com) web service for sending and receiving real-time events. If we are using Pusher's PHP SDK, we could inject an instance of the Pusher client into a class: +A very powerful feature of the service container is its ability to bind an interface to a given implementation. For example, perhaps our application integrates with the [Pusher](https://pusher.com) web service for sending and receiving real-time events. If we are using Pusher's PHP SDK, we could inject an instance of the Pusher client into a class: Date: Fri, 20 Mar 2015 18:45:15 -0700 Subject: [PATCH 137/276] Standarize indentation to tabs instead of mixture. Currently the indentation is, for the most part, tabs. However, some of the indentation is spaces, and there doesn't seem to be a good reason for a lot of this indentation switch. For example, some of the indentation is only 3 spaces or 7 spaces instead of 4 or 8. This is even more inconsistent and has probably happened over time as a result of PRs. This fixes inconsistencies such as that and makes it 1 tab or 2 tabs. This does not change specifically-spaced formatting to tabs, such as aligning far-spaced -> in the queries markdown document and other documents, meaning that ->'s are still perfectly aligned. For example, the following is changed: Old: if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) { // The user is active, not suspended, and exists. } New: if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) { // The user is active, not suspended, and exists. } Alternatively, the following is not changed: DB::table('users') ->join('contacts', function($join) { $join->on('users.id', '=', 'contacts.user_id') ->where('contacts.user_id', '>', 5); }) ->get(); This is to preserve the formatting of -> alignment. --- authentication.md | 8 ++-- configuration.md | 6 +-- elixir.md | 96 +++++++++++++++++++++++------------------------ eloquent.md | 8 ++-- installation.md | 6 +-- routing.md | 16 ++++---- schema.md | 10 ++--- templates.md | 4 +- testing.md | 18 ++++----- upgrade.md | 8 ++-- validation.md | 24 ++++++------ 11 files changed, 102 insertions(+), 102 deletions(-) diff --git a/authentication.md b/authentication.md index 1b0b96269ce..c87a55b9899 100644 --- a/authentication.md +++ b/authentication.md @@ -70,10 +70,10 @@ The `intended` redirect function will redirect the user to the URL they were att You also may add extra conditions to the authentication query: - if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) - { - // The user is active, not suspended, and exists. - } + if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) + { + // The user is active, not suspended, and exists. + } #### Determining If A User Is Authenticated diff --git a/configuration.md b/configuration.md index 717bef0c641..6b076177b06 100644 --- a/configuration.md +++ b/configuration.md @@ -139,8 +139,8 @@ If the `.htaccess` file that ships with Laravel does not work with your Apache i On Nginx, the following directive in your site configuration will allow "pretty" URLs: - location / { - try_files $uri $uri/ /index.php?$query_string; - } + location / { + try_files $uri $uri/ /index.php?$query_string; + } Of course, when using [Homestead](/docs/5.0/homestead), pretty URLs will be configured automatically. diff --git a/elixir.md b/elixir.md index 5531914bff4..e934f49c5db 100644 --- a/elixir.md +++ b/elixir.md @@ -37,7 +37,7 @@ Next, you'll want to pull in [Gulp](http://gulpjs.com) as a global NPM package l The only remaining step is to install Elixir! With a new install of Laravel, you'll find a `package.json` file in the root. Think of this like your `composer.json` file, except it defines Node dependencies instead of PHP. You may install the dependencies it references by running: - npm install + npm install ## Usage @@ -48,7 +48,7 @@ Now that you've installed Elixir, you'll be compiling and concatenating in no ti ```javascript elixir(function(mix) { - mix.less("app.less"); + mix.less("app.less"); }); ``` @@ -58,10 +58,10 @@ In the example above, Elixir assumes that your Less files are stored in `resourc ```javascript elixir(function(mix) { - mix.less([ - 'app.less', - 'something-else.less' - ]); + mix.less([ + 'app.less', + 'something-else.less' + ]); }); ``` @@ -69,7 +69,7 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.sass("app.sass"); + mix.sass("app.sass"); }); ``` @@ -79,7 +79,7 @@ By default, Elixir, underneath the hood, uses the LibSass library for compilatio ```javascript elixir(function(mix) { - mix.rubySass("app.sass"); + mix.rubySass("app.sass"); }); ``` @@ -89,7 +89,7 @@ elixir(function(mix) { elixir.config.sourcemaps = false; elixir(function(mix) { - mix.sass("app.scss"); + mix.sass("app.scss"); }); ``` @@ -99,7 +99,7 @@ Source maps are enabled out of the box. As such, for each file that is compiled, ```javascript elixir(function(mix) { - mix.coffee(); + mix.coffee(); }); ``` @@ -118,7 +118,7 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.phpUnit(); + mix.phpUnit(); }); ``` @@ -126,7 +126,7 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.phpSpec(); + mix.phpSpec(); }); ``` @@ -134,10 +134,10 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.styles([ - "normalize.css", - "main.css" - ]); + mix.styles([ + "normalize.css", + "main.css" + ]); }); ``` @@ -147,10 +147,10 @@ Paths passed to this method are relative to the `resources/css` directory. ```javascript elixir(function(mix) { - mix.styles([ - "normalize.css", - "main.css" - ], 'public/build/css/everything.css'); + mix.styles([ + "normalize.css", + "main.css" + ], 'public/build/css/everything.css'); }); ``` @@ -158,10 +158,10 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.styles([ - "normalize.css", - "main.css" - ], 'public/build/css/everything.css', 'public/css'); + mix.styles([ + "normalize.css", + "main.css" + ], 'public/build/css/everything.css', 'public/css'); }); ``` @@ -171,7 +171,7 @@ The third argument to both the `styles` and `scripts` methods determines the rel ```javascript elixir(function(mix) { - mix.stylesIn("public/css"); + mix.stylesIn("public/css"); }); ``` @@ -179,10 +179,10 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.scripts([ - "jquery.js", - "app.js" - ]); + mix.scripts([ + "jquery.js", + "app.js" + ]); }); ``` @@ -192,7 +192,7 @@ Again, this assumes all paths are relative to the `resources/js` directory. ```javascript elixir(function(mix) { - mix.scriptsIn("public/js/some/directory"); + mix.scriptsIn("public/js/some/directory"); }); ``` @@ -209,7 +209,7 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.version("css/all.css"); + mix.version("css/all.css"); }); ``` @@ -227,7 +227,7 @@ You may also pass an array to the `version` method to version multiple files: ```javascript elixir(function(mix) { - mix.version(["css/all.css", "js/app.js"]); + mix.version(["css/all.css", "js/app.js"]); }); ``` @@ -240,7 +240,7 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.copy('vendor/foo/bar.css', 'public/css/bar.css'); + mix.copy('vendor/foo/bar.css', 'public/css/bar.css'); }); ``` @@ -248,7 +248,7 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.copy('vendor/package/views', 'resources/views'); + mix.copy('vendor/package/views', 'resources/views'); }); ``` @@ -272,23 +272,23 @@ Now that you've told Elixir which tasks to execute, you only need to trigger Gul #### Execute All Registered Tasks Once - gulp + gulp #### Watch Assets For Changes - gulp watch + gulp watch #### Only Compile Scripts - gulp scripts + gulp scripts #### Only Compile Styles - gulp styles + gulp styles #### Watch Tests And PHP Classes for Changes - gulp tdd + gulp tdd > **Note:** All tasks will assume a development environment, and will exclude minification. For production, use `gulp --production`. @@ -299,17 +299,17 @@ You can even create your own Gulp tasks, and hook them into Elixir. Imagine that uses the Terminal to verbally notify you with some message. Here's what that might look like: ```javascript - var gulp = require("gulp"); - var shell = require("gulp-shell"); - var elixir = require("laravel-elixir"); +var gulp = require("gulp"); +var shell = require("gulp-shell"); +var elixir = require("laravel-elixir"); - elixir.extend("message", function(message) { +elixir.extend("message", function(message) { - gulp.task("say", function() { - gulp.src("").pipe(shell("say " + message)); - }); + gulp.task("say", function() { + gulp.src("").pipe(shell("say " + message)); + }); - return this.queueTask("say"); + return this.queueTask("say"); }); ``` @@ -334,7 +334,7 @@ You're done! Now, you can mix it in. ```javascript elixir(function(mix) { - mix.message("Tea, Earl Grey, Hot"); + mix.message("Tea, Earl Grey, Hot"); }); ``` diff --git a/eloquent.md b/eloquent.md index e4a55bcd0a2..00dd4cea178 100644 --- a/eloquent.md +++ b/eloquent.md @@ -1304,10 +1304,10 @@ When you pass a model to the `route` or `action` methods, it's primary key is in In this example the `$user->id` property will be inserted into the `{user}` place-holder of the generated URL. However, if you would like to use another property instead of the ID, you may override the `getRouteKey` method on your model: - public function getRouteKey() - { - return $this->slug; - } + public function getRouteKey() + { + return $this->slug; + } ## Converting To Arrays / JSON diff --git a/installation.md b/installation.md index 832f1468ff8..c946c8dd9d9 100644 --- a/installation.md +++ b/installation.md @@ -87,8 +87,8 @@ If the `.htaccess` file that ships with Laravel does not work with your Apache i On Nginx, the following directive in your site configuration will allow "pretty" URLs: - location / { - try_files $uri $uri/ /index.php?$query_string; - } + location / { + try_files $uri $uri/ /index.php?$query_string; + } Of course, when using [Homestead](/docs/5.0/homestead), pretty URLs will be configured automatically. diff --git a/routing.md b/routing.md index 3ecdc3b94f2..5b75b947eb8 100644 --- a/routing.md +++ b/routing.md @@ -65,7 +65,7 @@ Laravel automatically generates a CSRF "token" for each active user session mana #### Insert The CSRF Token Into A Form - + Of course, using the Blade [templating engine](/docs/5.0/templates): @@ -80,10 +80,10 @@ In addition to looking for the CSRF token as a "POST" parameter, the middleware $.ajaxSetup({ - headers: { - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') - } - }); + headers: { + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') + } + }); Now all AJAX requests will automatically include the CSRF token: @@ -106,8 +106,8 @@ The value sent with the `_method` field will be used as the HTTP request method.
- -
+ + ## Route Parameters @@ -204,7 +204,7 @@ Named routes allow you to conveniently generate URLs or redirects for a specific You may also specify route names for controller actions: Route::get('user/profile', [ - 'as' => 'profile', 'uses' => 'UserController@showProfile' + 'as' => 'profile', 'uses' => 'UserController@showProfile' ]); Now, you may use the route's name when generating URLs or redirects: diff --git a/schema.md b/schema.md index dff37fce7e3..aeb85b41c34 100644 --- a/schema.md +++ b/schema.md @@ -231,9 +231,9 @@ Command | Description To set the storage engine for a table, set the `engine` property on the schema builder: - Schema::create('users', function($table) - { - $table->engine = 'InnoDB'; + Schema::create('users', function($table) + { + $table->engine = 'InnoDB'; - $table->string('email'); - }); + $table->string('email'); + }); diff --git a/templates.md b/templates.md index ae89cc6d63e..e10c280068b 100644 --- a/templates.md +++ b/templates.md @@ -101,9 +101,9 @@ If you don't want the data to be escaped, you may use the following syntax: @endforeach @forelse($users as $user) -
  • {{ $user->name }}
  • +
  • {{ $user->name }}
  • @empty -

    No users

    +

    No users

    @endforelse @while (true) diff --git a/testing.md b/testing.md index db25561600c..268c857ccbf 100644 --- a/testing.md +++ b/testing.md @@ -151,18 +151,18 @@ Laravel ships with several `assert` methods to make testing a little easier: #### Asserting The Session Has Errors - public function testMethod() - { - $this->call('GET', '/'); + public function testMethod() + { + $this->call('GET', '/'); - $this->assertSessionHasErrors(); + $this->assertSessionHasErrors(); - // Asserting the session has errors for a given key... - $this->assertSessionHasErrors('name'); + // Asserting the session has errors for a given key... + $this->assertSessionHasErrors('name'); - // Asserting the session has errors for several keys... - $this->assertSessionHasErrors(['name', 'age']); - } + // Asserting the session has errors for several keys... + $this->assertSessionHasErrors(['name', 'age']); + } #### Asserting Old Input Has Some Data diff --git a/upgrade.md b/upgrade.md index 77d848e2736..ecf31a86dde 100644 --- a/upgrade.md +++ b/upgrade.md @@ -195,12 +195,12 @@ For example, you may add `"laravelcollective/html": "~5.0"` to your `composer.js You'll also need to add the Form and HTML facades and service provider. Edit `config/app.php` and add this line to the 'providers' array: - 'Collective\Html\HtmlServiceProvider', + 'Collective\Html\HtmlServiceProvider', Next, add these lines to the 'aliases' array: - 'Form' => 'Collective\Html\FormFacade', - 'Html' => 'Collective\Html\HtmlFacade', + 'Form' => 'Collective\Html\FormFacade', + 'Html' => 'Collective\Html\HtmlFacade', ### CacheManager @@ -275,7 +275,7 @@ If you are extending the `Illuminate\Pagination\Presenter` class, the abstract m If you are using the Iron.io queue driver, you will need to add a new `encrypt` option to your queue configuration file: - 'encrypt' => true + 'encrypt' => true ## Upgrading To 4.1.29 From <= 4.1.x diff --git a/validation.md b/validation.md index c3fcab674a6..f4a1417e60e 100644 --- a/validation.md +++ b/validation.md @@ -35,18 +35,18 @@ Multiple rules may be delimited using either a "pipe" character, or as separate #### Validating Multiple Fields - $validator = Validator::make( - [ - 'name' => 'Dayle', - 'password' => 'lamepassword', - 'email' => 'email@example.com' - ], - [ - 'name' => 'required', - 'password' => 'required|min:8', - 'email' => 'required|email|unique:users' - ] - ); + $validator = Validator::make( + [ + 'name' => 'Dayle', + 'password' => 'lamepassword', + 'email' => 'email@example.com' + ], + [ + 'name' => 'required', + 'password' => 'required|min:8', + 'email' => 'required|email|unique:users' + ] + ); Once a `Validator` instance has been created, the `fails` (or `passes`) method may be used to perform the validation. From e41c91edab45c3c9dbf9636de7c5e4e432c0c9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Israel=20Ortu=C3=B1o?= Date: Sun, 22 Mar 2015 01:51:34 +0100 Subject: [PATCH 138/276] Punctuation fix --- elixir.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir.md b/elixir.md index e934f49c5db..6e9e25bf709 100644 --- a/elixir.md +++ b/elixir.md @@ -73,7 +73,7 @@ elixir(function(mix) { }); ``` -This assumes that your Sass files are stored in `resources/assets/sass`. The `sass` method may only be called once, if you would like to compile multiple Sass files, pass an array to the `sass` method. +This assumes that your Sass files are stored in `resources/assets/sass`. The `sass` method may only be called once. If you would like to compile multiple Sass files, pass an array to the `sass` method. By default, Elixir, underneath the hood, uses the LibSass library for compilation. In some instances, it might prove advantageous to instead leverage the Ruby version, which, though slower, is more feature rich. Assuming that you have both Ruby and the Sass gem installed (`gem install sass`), you may enable Ruby-mode, like so: From c3b25fc6b6df3f0a2a810f96c4eb2b61ee449f41 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 22 Mar 2015 01:36:54 +0000 Subject: [PATCH 139/276] Add pagination method changes to upgrade.md --- upgrade.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/upgrade.md b/upgrade.md index ecf31a86dde..d28bce3fc4f 100644 --- a/upgrade.md +++ b/upgrade.md @@ -210,6 +210,10 @@ If your application code was injecting `Illuminate\Cache\CacheManager` to get a Replace any calls to `$paginator->links()` with `$paginator->render()`. +Replace any calls to `$paginator->getFrom()` and `$paginator->getTo()` with `$paginator->firstItem()` and `$paginator->lastItem()` respectively. + +Remove the "get" prefix from calls to `$paginator->getPerPage()`, `$paginator->getCurrentPage()`, `$paginator->getLastPage()` and `$paginator->getTotal()` (e.g. `$paginator->perPage()`). + ### Beanstalk Queuing Laravel 5.0 now requires `"pda/pheanstalk": "~3.0"` instead of `"pda/pheanstalk": "~2.1"`. From 581956ee1b698208bd82e06ce3aa9a0b2362b428 Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Sun, 22 Mar 2015 03:36:02 -0400 Subject: [PATCH 140/276] Add Elixir note about mixing custom Gulp tasks --- elixir.md | 52 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/elixir.md b/elixir.md index 6e9e25bf709..aaccfb0cb6c 100644 --- a/elixir.md +++ b/elixir.md @@ -293,36 +293,66 @@ Now that you've told Elixir which tasks to execute, you only need to trigger Gul > **Note:** All tasks will assume a development environment, and will exclude minification. For production, use `gulp --production`. -## Extensions +## Custom Tasks and Extensions -You can even create your own Gulp tasks, and hook them into Elixir. Imagine that you want to add a fun task that - uses the Terminal to verbally notify you with some message. Here's what that might look like: +Sometimes, you'll want to hook your own Gulp tasks into Elixir. Perhaps you have a special bit of functionality that you'd like Elixir to mix and watch for you. No problem! + +As an example, imagine that you have a general task that simply speaks a bit of text when called. + +```javascript +gulp.task("speak", function() { + var message = "Tea...Earl Grey...Hot"; + + gulp.src("").pipe(shell("say " + message)); +}); +``` + +Easy enough. From the command line, you may, of course, call `gulp speak` to trigger the task. To add it to Elixir, however, use the `mix.task()` method: + +```javascript +elixir(function(mix) { + mix.task('speak'); +}); +``` + +That's it! Now, each time you run Gulp, your custom "speak" task will be executed alongside any other Elixir tasks that you've mixed in. To additionally register a watcher, so that your custom tasks will be re-triggered each time one or more files are modified, you may pass a regular expression as the second argument. + +```javascript +elixir(function(mix) { + mix.task('speak', 'app/**/*.php'); +}); +``` + +By adding this second argument, we've instructed Elixir to re-trigger the "speak" task each time a PHP file in the "app/" directory is saved. + + +For even more flexibility, you can create full Elixir extensions. Using the previous "speak" example, you may write an extension, like so: ```javascript var gulp = require("gulp"); var shell = require("gulp-shell"); var elixir = require("laravel-elixir"); -elixir.extend("message", function(message) { +elixir.extend("speak", function(message) { - gulp.task("say", function() { + gulp.task("speak", function() { gulp.src("").pipe(shell("say " + message)); }); - return this.queueTask("say"); + return this.queueTask("speak"); }); ``` -Notice that we `extend` Elixir's API by passing the key that we will use within our Gulpfile, as well as a callback function that will create the Gulp task. +Notice that we `extend` Elixir's API by passing the name that we will reference within our Gulpfile, as well as a callback function that will create the Gulp task. -If you want your custom task to be monitored, then register a watcher as well. +As before, if you want your custom task to be monitored, then register a watcher. ```javascript -this.registerWatcher("message", "**/*.php"); +this.registerWatcher("speak", "app/**/*.php"); ``` -This lines designates that when any file that matches the regex, `**/*.php` is modified, we want to trigger the `message` task. +This lines designates that when any file that matches the regular expression, `app/**/*.php`, is modified, we want to trigger the `speak` task. That's it! You may either place this at the top of your Gulpfile, or instead extract it to a custom tasks file. If you choose the latter approach, simply require it into your Gulpfile, like so: @@ -334,7 +364,7 @@ You're done! Now, you can mix it in. ```javascript elixir(function(mix) { - mix.message("Tea, Earl Grey, Hot"); + mix.speak("Tea, Earl Grey, Hot"); }); ``` From 8cbcefdc84326500f96239734a5ec8277fadd452 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Sun, 22 Mar 2015 17:16:45 +0100 Subject: [PATCH 141/276] Add link to Envoy Github repository Just a quick link to the Github repo if people want to check out the code for Envoy. --- envoy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/envoy.md b/envoy.md index ecea306bf84..5486cb404a8 100644 --- a/envoy.md +++ b/envoy.md @@ -12,7 +12,7 @@ ## Introduction -Laravel Envoy provides a clean, minimal syntax for defining common tasks you run on your remote servers. Using a Blade style syntax, you can easily setup tasks for deployment, Artisan commands, and more. +[Laravel Envoy](https://github.com/laravel/envoy) provides a clean, minimal syntax for defining common tasks you run on your remote servers. Using a Blade style syntax, you can easily setup tasks for deployment, Artisan commands, and more. > **Note:** Envoy requires PHP version 5.4 or greater, and only runs on Mac / Linux operating systems. From e7501611464c2d1c7c22fc5c2b2c4182d40520c0 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Sun, 22 Mar 2015 17:55:05 +0100 Subject: [PATCH 142/276] Update Slack docs to correct usage The current docs are wrong and very unclear at how to set up Slack notifications with Envoy. I've updated the docs to the old one which was present in the Envoy readme on Github which is much more clear. --- envoy.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/envoy.md b/envoy.md index ecea306bf84..5270ee25d4c 100644 --- a/envoy.md +++ b/envoy.md @@ -157,8 +157,22 @@ This is an amazingly simple way to keep your team notified of the tasks being ru The following syntax may be used to send a notification to [Slack](https://slack.com): @after - @slack('team', 'token', 'channel') + @slack('hook', 'channel', 'message') @endafter + +You may retrieve your token by creating an `Incoming WebHooks` integration on Slack's website. + +The hook argument is the entire webhook URL provided by the Incoming Webhooks Slack Integration: + +- `https://hooks.slack.com/services/ZZZZZZZZZ/YYYYYYYYY/XXXXXXXXXXXXXXX` + +You may provide one of the following for the channel argument: + +- For a regular channel: `#channel` +- For a specific user: `@user` +- If no argument is provided Envoy will use the default channel configured on the Slack website. + +> Note: Slack notifications will only be sent if all tasks complete successfully. ## Updating Envoy From 88f5771bb85d1df154e0fd7ec0f626a858506d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Israel=20Ortu=C3=B1o?= Date: Sun, 22 Mar 2015 19:16:07 +0100 Subject: [PATCH 143/276] Replaced IoC Replacing IoC container to Service Container --- facades.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/facades.md b/facades.md index cf92f27cd83..d5cb7743d52 100644 --- a/facades.md +++ b/facades.md @@ -10,11 +10,11 @@ ## Introduction -Facades provide a "static" interface to classes that are available in the application's [IoC container](/docs/5.0/container). Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods. +Facades provide a "static" interface to classes that are available in the application's [service container](/docs/5.0/container). Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods. Occasionally, you may wish to create your own facades for your application's and packages, so let's explore the concept, development and usage of these classes. -> **Note:** Before digging into facades, it is strongly recommended that you become very familiar with the Laravel [IoC container](/docs/5.0/container). +> **Note:** Before digging into facades, it is strongly recommended that you become very familiar with the Laravel [service container](/docs/5.0/container). ## Explanation @@ -23,7 +23,7 @@ In the context of a Laravel application, a facade is a class that provides acces Your facade class only needs to implement a single method: `getFacadeAccessor`. It's the `getFacadeAccessor` method's job to define what to resolve from the container. The `Facade` base class makes use of the `__callStatic()` magic-method to defer calls from your facade to the resolved object. -So, when you make a facade call like `Cache::get`, Laravel resolves the Cache manager class out of the IoC container and calls the `get` method on the class. In technical terms, Laravel Facades are a convenient syntax for using the Laravel IoC container as a service locator. +So, when you make a facade call like `Cache::get`, Laravel resolves the Cache manager class out of the service container and calls the `get` method on the class. In technical terms, Laravel Facades are a convenient syntax for using the Laravel service container as a service locator. ## Practical Usage @@ -45,9 +45,9 @@ However, if we look at that `Illuminate\Support\Facades\Cache` class, you'll see } -The Cache class extends the base `Facade` class and defines a method `getFacadeAccessor()`. Remember, this method's job is to return the name of an IoC binding. +The Cache class extends the base `Facade` class and defines a method `getFacadeAccessor()`. Remember, this method's job is to return the name of a service container binding. -When a user references any static method on the `Cache` facade, Laravel resolves the `cache` binding from the IoC container and runs the requested method (in this case, `get`) against that object. +When a user references any static method on the `Cache` facade, Laravel resolves the `cache` binding from the service container and runs the requested method (in this case, `get`) against that object. So, our `Cache::get` call could be re-written like so: @@ -82,7 +82,7 @@ Remember, if you are using a facade in a controller that is namespaced, you will Creating a facade for your own application or package is simple. You only need 3 things: -- An IoC binding. +- A service container binding. - A facade class. - A facade alias configuration. @@ -99,7 +99,7 @@ Let's look at an example. Here, we have a class defined as `PaymentGateway\Payme } -We need to be able to resolve this class from the IoC container. So, let's add a binding to a service provider: +We need to be able to resolve this class from the service container. So, let's add a binding to a service provider: App::bind('payment', function() { @@ -134,9 +134,9 @@ Unit testing is an important aspect of why facades work the way that they do. In ## Facade Class Reference -Below you will find every facade and its underlying class. This is a useful tool for quickly digging into the API documentation for a given facade root. The [IoC binding](/docs/5.0/container) key is also included where applicable. +Below you will find every facade and its underlying class. This is a useful tool for quickly digging into the API documentation for a given facade root. The [service container binding](/docs/5.0/container) key is also included where applicable. -Facade | Class | IoC Binding +Facade | Class | Service Container Binding ------------- | ------------- | ------------- App | [Illuminate\Foundation\Application](http://laravel.com/api/5.0/Illuminate/Foundation/Application.html) | `app` Artisan | [Illuminate\Console\Application](http://laravel.com/api/5.0/Illuminate/Console/Application.html) | `artisan` From c146c72966635663fea6943e85fb63b0678ac7c5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 22 Mar 2015 13:30:27 -0500 Subject: [PATCH 144/276] formatting. --- envoy.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/envoy.md b/envoy.md index 5270ee25d4c..45a2050b49c 100644 --- a/envoy.md +++ b/envoy.md @@ -159,19 +159,18 @@ The following syntax may be used to send a notification to [Slack](https://slack @after @slack('hook', 'channel', 'message') @endafter - -You may retrieve your token by creating an `Incoming WebHooks` integration on Slack's website. -The hook argument is the entire webhook URL provided by the Incoming Webhooks Slack Integration: +You may retrieve your webhook URL by creating an `Incoming WebHooks` integration on Slack's website. The `hook` argument should be the entire webhook URL provided by the Incoming Webhooks Slack Integration. For example: + + https://hooks.slack.com/services/ZZZZZZZZZ/YYYYYYYYY/XXXXXXXXXXXXXXX -- `https://hooks.slack.com/services/ZZZZZZZZZ/YYYYYYYYY/XXXXXXXXXXXXXXX` - You may provide one of the following for the channel argument: -- For a regular channel: `#channel` -- For a specific user: `@user` -- If no argument is provided Envoy will use the default channel configured on the Slack website. - +- To send the notification to a channel: `#channel` +- To send the notification to a user: `@user` + +If no `channel` argument is provided the default channel will be used. + > Note: Slack notifications will only be sent if all tasks complete successfully. From 8deea1890ccea0dbbf36bcb131b75a08deb74b1d Mon Sep 17 00:00:00 2001 From: Piotr Date: Sun, 22 Mar 2015 19:38:13 +0100 Subject: [PATCH 145/276] array_fetch wrong bracket parring - typo --- helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers.md b/helpers.md index 3598092ac0d..e347b568ccd 100644 --- a/helpers.md +++ b/helpers.md @@ -49,7 +49,7 @@ The `array_fetch` method returns a flattened array containing the selected neste $array = [ ['developer' => ['name' => 'Taylor']], ['developer' => ['name' => 'Dayle']] - ); + ]; $array = array_fetch($array, 'developer.name'); From fd01fbace12fe5b9735d1d8a7f17cecb7ec56698 Mon Sep 17 00:00:00 2001 From: An Phan Date: Mon, 23 Mar 2015 11:59:20 +0800 Subject: [PATCH 146/276] Added an instruction to replace FollowSymLinks with SymLinksIfOwnerMatch --- configuration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration.md b/configuration.md index 6b076177b06..87100cb80d8 100644 --- a/configuration.md +++ b/configuration.md @@ -135,6 +135,8 @@ If the `.htaccess` file that ships with Laravel does not work with your Apache i RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] +If `Options +FollowSymLinks` creates a 500 error, try replacing it with `Options +SymLinksIfOwnerMatch`. + ### Nginx On Nginx, the following directive in your site configuration will allow "pretty" URLs: From e0959213783e91fa90c5307ebeee2d0848a99b7c Mon Sep 17 00:00:00 2001 From: Alfred Nutile Date: Mon, 23 Mar 2015 05:37:49 -0400 Subject: [PATCH 147/276] Add example for VALUE_IS_ARRAY Using the docs I got ~~~ [InvalidArgumentException] Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value. ~~~ Looking in the code for `InputOption::VALUE_IS_ARRAY` I could not find and example, so figured it would be good to add to docs. --- commands.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands.md b/commands.md index 8aac98c4925..682932a0a29 100644 --- a/commands.md +++ b/commands.md @@ -50,6 +50,10 @@ For options, the argument `mode` may be: `InputOption::VALUE_REQUIRED`, `InputOp The `VALUE_IS_ARRAY` mode indicates that the switch may be used multiple times when calling the command: + InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY + +Would then allow for this command: + php artisan foo --option=bar --option=baz The `VALUE_NONE` option indicates that the option is simply used as a "switch": From 16d43aa667a492f10cf548b28e364e587d7bf157 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 23 Mar 2015 20:58:40 -0500 Subject: [PATCH 148/276] Fix. --- configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.md b/configuration.md index 87100cb80d8..272f64ce11a 100644 --- a/configuration.md +++ b/configuration.md @@ -135,7 +135,7 @@ If the `.htaccess` file that ships with Laravel does not work with your Apache i RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] -If `Options +FollowSymLinks` creates a 500 error, try replacing it with `Options +SymLinksIfOwnerMatch`. +If your web host doesn't allow the `FollowSymlinks` option, try replacing it with `Options +SymLinksIfOwnerMatch`. ### Nginx From 8ecb2fd1cf11c02d84ebdc0e53434d3d528e9469 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Tue, 24 Mar 2015 16:40:24 +1100 Subject: [PATCH 149/276] Update billing.md --- billing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/billing.md b/billing.md index ae22cf60278..83da9c8d6fa 100644 --- a/billing.md +++ b/billing.md @@ -10,7 +10,7 @@ - [Cancelling A Subscription](#cancelling-a-subscription) - [Resuming A Subscription](#resuming-a-subscription) - [Checking Subscription Status](#checking-subscription-status) -- [Handling Failed Payments](#handling-failed-payments) +- [Handling Failed Subscriptions](#handling-failed-subscriptions) - [Handling Other Stripe Webhooks](#handling-other-stripe-webhooks) - [Invoices](#invoices) @@ -237,14 +237,14 @@ The `onPlan` method may be used to determine if the user is subscribed to a give // } - -## Handling Failed Payments + +## Handling Failed Subscriptions What if a customer's credit card expires? No worries - Cashier includes a Webhook controller that can easily cancel the customer's subscription for you. Just point a route to the controller: Route::post('stripe/webhook', 'Laravel\Cashier\WebhookController@handleWebhook'); -That's it! Failed payments will be captured and handled by the controller. The controller will cancel the customer's subscription after three failed payment attempts. The `stripe/webhook` URI in this example is just for example. You will need to configure the URI in your Stripe settings. +That's it! Failed payments will be captured and handled by the controller. The controller will cancel the customer's subscription when Stripe determines the subscription has failed (normally after three failed payment attempts). The `stripe/webhook` URI in this example is just for example. You will need to configure the URI in your Stripe settings. ## Handling Other Stripe Webhooks From d8fd835e027101bd7a0a11a05b166e76b5cc4db0 Mon Sep 17 00:00:00 2001 From: Alexandru Bucur Date: Tue, 24 Mar 2015 11:40:30 +0200 Subject: [PATCH 150/276] Named params examples for queries --- database.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/database.md b/database.md index f605bd84767..6f2e4d1f85c 100644 --- a/database.md +++ b/database.md @@ -50,6 +50,13 @@ Once you have configured your database connection, you may run queries using the The `select` method will always return an `array` of results. +You can also run a select query using named prepared statements. + + $results = DB::select('select * from users where id = :id', ['id' => 1]); + +> **Note:** You can not reuse the same named prepared statement. + + #### Running An Insert Statement DB::insert('insert into users (id, name) values (?, ?)', [1, 'Dayle']); From 573787f6ad20635140e76e26124b1352bcbd875b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Mar 2015 08:23:27 -0500 Subject: [PATCH 151/276] update docs --- configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.md b/configuration.md index 272f64ce11a..68e409cac71 100644 --- a/configuration.md +++ b/configuration.md @@ -37,7 +37,7 @@ Once Laravel is installed, you should also [configure your local environment](/d ### Permissions -Laravel may require one set of permissions to be configured: folders within `storage` require write access by the web server. +Laravel may require one set of permissions to be configured: folders within `storage` and `vendor` require write access by the web server. ## Accessing Configuration Values From 019c008068f5324da46a7a59fff01b030b9e3797 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Mar 2015 08:55:21 -0500 Subject: [PATCH 152/276] install docs --- installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation.md b/installation.md index c946c8dd9d9..451394ff5be 100644 --- a/installation.md +++ b/installation.md @@ -65,7 +65,7 @@ Once Laravel is installed, you should also [configure your local environment](/d ### Permissions -Laravel may require some permissions to be configured: folders within `storage` require write access by the web server. +Laravel may require some permissions to be configured: folders within `storage` and `vendor` require write access by the web server. ## Pretty URLs From 61054dec094a6ed3b8046ea93de0c80f0bdbcdae Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Mar 2015 09:58:18 -0500 Subject: [PATCH 153/276] Note support policy officially. --- releases.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/releases.md b/releases.md index a16c1906bd2..ed9643e2073 100644 --- a/releases.md +++ b/releases.md @@ -1,9 +1,17 @@ # Release Notes +- [Support Policy](#support-policy) - [Laravel 5.0](#laravel-5.0) - [Laravel 4.2](#laravel-4.2) - [Laravel 4.1](#laravel-4.1) + +## Support Policy + +Security fixes are **always** applied to the previous major version of Laravel. Currently, **all** security fixes and patches will be applied to both Laravel 5.x **and** Laravel 4.x. + +When feasible, security fixes will also be applied to even older releases of the framework, such as Laravel 3.x. + ## Laravel 5.0 From fdfa7999ce6c53915375ae57d525d946ebb00859 Mon Sep 17 00:00:00 2001 From: infonobody Date: Tue, 24 Mar 2015 23:37:59 +0800 Subject: [PATCH 154/276] Need namespace --- eloquent.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eloquent.md b/eloquent.md index 00dd4cea178..9a702e75ec7 100644 --- a/eloquent.md +++ b/eloquent.md @@ -634,7 +634,7 @@ Even though the `posts` table does not contain a `country_id` column, the `hasMa public function posts() { - return $this->hasManyThrough('App\Post', 'User'); + return $this->hasManyThrough('App\Post', 'App\User'); } } @@ -645,7 +645,7 @@ If you would like to manually specify the keys of the relationship, you may pass public function posts() { - return $this->hasManyThrough('App\Post', 'User', 'country_id', 'user_id'); + return $this->hasManyThrough('App\Post', 'App\User', 'country_id', 'user_id'); } } From 122cdb46da9dec210a3df6052c3e7e010edbd908 Mon Sep 17 00:00:00 2001 From: Jonathan Klein Date: Mon, 16 Mar 2015 10:39:44 -0400 Subject: [PATCH 155/276] Explaining how to set a custom DB connection --- validation.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/validation.md b/validation.md index f4a1417e60e..f946aa81bb9 100644 --- a/validation.md +++ b/validation.md @@ -48,6 +48,30 @@ Multiple rules may be delimited using either a "pipe" character, or as separate ] ); +#### Setting a Custom Database Connection For the Validator + +Sometimes you need to set a custom connection for database queries that the Validator will make. +As seen above, setting `unique:users` as a validation rule will use the default database connection to +query the database and confirm uniqueness. To override this, do the following: + + $verifier = App::make('validation.presence'); + $verifier->setConnection('connectionName'); + + $validator = Validator::make( + [ + 'name' => 'Dayle', + 'password' => 'lamepassword', + 'email' => 'email@example.com', + ], + [ + 'name' => 'required', + 'password' => 'required|min:8', + 'email' => 'required|email|unique:users', + ] + ); + + $validator->setPresenceVerifier($verifier); + Once a `Validator` instance has been created, the `fails` (or `passes`) method may be used to perform the validation. if ($validator->fails()) From df55454566b5a50698ed113111598b4c17b6fe7d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Mar 2015 15:50:24 -0500 Subject: [PATCH 156/276] fixes --- validation.md | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/validation.md b/validation.md index f946aa81bb9..f1d1e48a64a 100644 --- a/validation.md +++ b/validation.md @@ -44,34 +44,10 @@ Multiple rules may be delimited using either a "pipe" character, or as separate [ 'name' => 'required', 'password' => 'required|min:8', - 'email' => 'required|email|unique:users' + 'email' => 'required|email|unique:users' ] ); -#### Setting a Custom Database Connection For the Validator - -Sometimes you need to set a custom connection for database queries that the Validator will make. -As seen above, setting `unique:users` as a validation rule will use the default database connection to -query the database and confirm uniqueness. To override this, do the following: - - $verifier = App::make('validation.presence'); - $verifier->setConnection('connectionName'); - - $validator = Validator::make( - [ - 'name' => 'Dayle', - 'password' => 'lamepassword', - 'email' => 'email@example.com', - ], - [ - 'name' => 'required', - 'password' => 'required|min:8', - 'email' => 'required|email|unique:users', - ] - ); - - $validator->setPresenceVerifier($verifier); - Once a `Validator` instance has been created, the `fails` (or `passes`) method may be used to perform the validation. if ($validator->fails()) @@ -604,6 +580,20 @@ The field under validation must be a valid timezone identifier according to the The field under validation must be unique on a given database table. If the `column` option is not specified, the field name will be used. +Occasionally, you may need to set a custom connection for database queries made by the Validator. As seen above, setting `unique:users` as a validation rule will use the default database connection to query the database. To override this, do the following: + + $verifier = App::make('validation.presence'); + + $verifier->setConnection('connectionName'); + + $validator = Validator::make($input, [ + 'name' => 'required', + 'password' => 'required|min:8', + 'email' => 'required|email|unique:users', + ]); + + $validator->setPresenceVerifier($verifier); + #### Basic Usage Of Unique Rule 'email' => 'unique:users' From c85a347581c06d3646115430eaaa1badc9e60ac1 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Mar 2015 16:00:50 -0500 Subject: [PATCH 157/276] fixes --- database.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/database.md b/database.md index 6f2e4d1f85c..62ad062427c 100644 --- a/database.md +++ b/database.md @@ -50,12 +50,9 @@ Once you have configured your database connection, you may run queries using the The `select` method will always return an `array` of results. -You can also run a select query using named prepared statements. +You may also execute a query using named bindings: $results = DB::select('select * from users where id = :id', ['id' => 1]); - -> **Note:** You can not reuse the same named prepared statement. - #### Running An Insert Statement From 516d3a55d37d58dab0bb0a633509528546cc47c2 Mon Sep 17 00:00:00 2001 From: Bill Columbia Date: Tue, 24 Mar 2015 19:02:58 -0400 Subject: [PATCH 158/276] Add tips for amending your path with composer executables --- homestead.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homestead.md b/homestead.md index db3eb6b6aca..427120f8c18 100644 --- a/homestead.md +++ b/homestead.md @@ -80,6 +80,8 @@ Once the box has been added to your Vagrant installation, you are ready to insta Make sure to place the `~/.composer/vendor/bin` directory in your PATH so the `homestead` executable is found when you run the `homestead` command in your terminal. + PATH=~/.composer/vendor/bin:$PATH + Once you have installed the Homestead CLI tool, run the `init` command to create the `Homestead.yaml` configuration file: homestead init From db84244eddfc652cb470a6a9665e88f7bb74154a Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Wed, 25 Mar 2015 11:19:40 +0000 Subject: [PATCH 159/276] Mention the ability to queue cookies using the `CookieJar` --- requests.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/requests.md b/requests.md index edce281512e..e7c7aa257bd 100644 --- a/requests.md +++ b/requests.md @@ -159,6 +159,30 @@ _By "forever", we really mean five years._ $response->withCookie(cookie()->forever('name', 'value')); +#### Queueing Cookies + +We can also queue a cookie using Laravel’s `CookieJar`. Queued cookies are automatically added to a subsequent response. + + queue('name', 'value', $minutes); + return (new Response($content, 200)); + } + } + ## Files From e3a2d6ea9200326c580cdb9ee34c44a59f8c89b0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Mar 2015 08:27:19 -0500 Subject: [PATCH 160/276] formatting --- filesystem.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/filesystem.md b/filesystem.md index 211076f506e..4c88e4eae3b 100644 --- a/filesystem.md +++ b/filesystem.md @@ -129,7 +129,7 @@ The first argument of the `extend` method is the name of the driver and the seco use League\Flysystem\Dropbox\DropboxAdapter; use Illuminate\Support\ServiceProvider; - class DropboxFilesystemServiceProvider extends ServiceProvider { + class DropboxFilesystemServiceProvider extends ServiceProvider { public function boot() { @@ -140,10 +140,10 @@ The first argument of the `extend` method is the name of the driver and the seco return new Filesystem(new DropboxAdapter($client)); }); } - + public function register() - { - // - } + { + // + } } From f43c98d1acddb031cd1f3b350aec44fc54e1e514 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Mar 2015 08:30:18 -0500 Subject: [PATCH 161/276] working on docs --- requests.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/requests.md b/requests.md index e7c7aa257bd..5dc9686fba5 100644 --- a/requests.md +++ b/requests.md @@ -161,25 +161,25 @@ _By "forever", we really mean five years._ #### Queueing Cookies -We can also queue a cookie using Laravel’s `CookieJar`. Queued cookies are automatically added to a subsequent response. +You may also "queue" a cookie to be added to the outgoing response, even before that response has been created: queue('name', 'value', $minutes); - return (new Response($content, 200)); + Cookie::queue('name', 'value'); + + return response('Hello World'); } } From a94641c94dfc5921bc7b6fedb897dad2f798cebd Mon Sep 17 00:00:00 2001 From: An Phan Date: Thu, 26 Mar 2015 18:46:56 +0800 Subject: [PATCH 162/276] Adding document on dynamic where clauses --- queries.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/queries.md b/queries.md index 9f3aaac1384..735a52fffaa 100644 --- a/queries.md +++ b/queries.md @@ -128,6 +128,23 @@ This method will return an array of role titles. You may also specify a custom k $users = DB::table('users')->skip(10)->take(5)->get(); +#### Dynamic Where Clauses + +This feature allows you to write `where()` and `orWhere()` statements in a more readable and elegant fashion. + + $admin = DB::table('users')->whereId(1)->first(); + + $john = DB::table('users') + ->whereIdAndEmail(2, 'john@doe.com') + ->first(); + + $jane = DB::table('users') + ->whereNameOrGender('Jane', 'F') + ->first(); + + // Note that snake_case column names are converted into PascalCase + $doe = DB::table('users')->whereLastName('doe')->first(); + ## Joins From 2e74c5dabb01a5d57d612cfe07e680253556ccad Mon Sep 17 00:00:00 2001 From: Jim Rubenstein Date: Wed, 25 Mar 2015 10:25:13 -0400 Subject: [PATCH 163/276] Improves Route@Group attributes documentation --- routing.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/routing.md b/routing.md index 5b75b947eb8..61aaebb1c21 100644 --- a/routing.md +++ b/routing.md @@ -220,7 +220,16 @@ The `currentRouteName` method returns the name of the route handling the current ## Route Groups -Sometimes you may need to apply filters to a group of routes. Instead of specifying the filter on each route, you may use a route group: +Sometimes many of your routes will share common requirements such as URL segments, middleware, namespaces, etc. Instead of specifying each of these options on each route individually, you may use a route group to apply attributes to many routes. + +Shared attributes are specified in an array format as the first parameter to the `Route@group` method. Attributes are applied to nested route groups and merged as you'd expect. + + +### Middleware + +Middleware is applied to all routes within the group by defining the list of middleware with the `middleware` parameter on the attribute array. You may specify your middleware as a string describing a single middleware task, or as an array of strings describing multiple middleware tasks. Middleware will be executed in the order you define this array: + +#### Applying filters to a group of routes via middleware Route::group(['middleware' => 'auth'], function() { @@ -233,16 +242,27 @@ Sometimes you may need to apply filters to a group of routes. Instead of specify { // Has Auth Filter }); + }); -You may use the `namespace` parameter within your `group` array to specify the namespace for all controllers within the group: + +### Namespaces + +You may use the `namespace` parameter within your `group` attributes array to specify the namespace for all controllers within the group: + +#### Applying namespaces and nested namespaces to a group of routes Route::group(['namespace' => 'Admin'], function() { - // + // Controllers will be expected to be within the App\Http\Controllers\Admin namespace + + Route::group(['namespace' => 'User'], function() + { + // Controllers will be expected to be within the App\Http\Controllers\Admin\User namespace + }); }); -> **Note:** By default, the `RouteServiceProvider` includes your `routes.php` file within a namespace group, allowing you to register controller routes without specifying the full namespace. +> **Note:** By default, the `RouteServiceProvider` includes your `routes.php` file within a namespace group, allowing you to register controller routes without specifying the full (App\Http\Controllers) namespace prefix. ### Sub-Domain Routing @@ -262,18 +282,42 @@ Laravel routes also handle wildcard sub-domains, and will pass your wildcard par }); -### Route Prefixing +### Route prefixing + +If you'd like your routes within a group to share the same URL prefix, you can utilize the `prefix` key on the attribute array to define the URL prefix that all routes must match. -A group of routes may be prefixed by using the `prefix` option in the attributes array of a group: +#### Registering a URL prefix for a group of routes Route::group(['prefix' => 'admin'], function() { + Route::get('users', function() + { + // Matches the /admin/users URL + }); + }); - Route::get('user', function() +You can also utilize the `prefix` parameter to pass common parameters to your routes: + +#### Registering a URL parameter in a route prefix + + Route::group(['prefix' => 'accounts/{account_id}'], function() + { + Route::get('detail', function($account_id) { - // + // $account_id will be the value retrieved by the 'account_id' parameter from the route group prefix }); + }); + +Like Routes, you can define parameter constraints for the named parameters in your prefix: + +#### Defining route prefix parameter constraints using regular expressions + + Route::group([ + 'prefix' => 'accounts/{account_id}', + 'where' => ['account_id' => '[0-9]+'], + ], function() { + // All routes within this group will require $account_id to be numeric, otherwise the group will not match }); From a8542d707d488967309ffc81581226be76d10e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Israel=20Ortu=C3=B1o?= Date: Thu, 26 Mar 2015 14:42:52 +0100 Subject: [PATCH 164/276] Fixed typo --- filesystem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem.md b/filesystem.md index 4c88e4eae3b..537a010a6dd 100644 --- a/filesystem.md +++ b/filesystem.md @@ -113,7 +113,7 @@ The `Storage` facade may be used to interact with any of your configured disks. Laravel's Flysystem integration provides drivers for several "drivers" out of the box; however, Flysystem is not limited to these and has adapters for many other storage systems. You can create a custom driver if you want to use one of these additional adapters in your Laravel application. Don't worry, it's not too hard! -In order to set up the custom filesystem you will need to create a service provider such as `DropboxFilesystemServiceProvider`. In the provider's `boot` method, you can inject an instance of the `Illuminate\Contracts\Filesystem\Factory` contract and call the `extend` method of the injected instance. Alternatively, You may use the `Disk` facade's `extend` method. +In order to set up the custom filesystem you will need to create a service provider such as `DropboxFilesystemServiceProvider`. In the provider's `boot` method, you can inject an instance of the `Illuminate\Contracts\Filesystem\Factory` contract and call the `extend` method of the injected instance. Alternatively, you may use the `Disk` facade's `extend` method. The first argument of the `extend` method is the name of the driver and the second is a Closure that receives the `$app` and `$config` variables. The resolver Closure must return an instance of `League\Flysystem\Filesystem`. From 11930352c5dfcd5e7b2dd6bf06794aa240e3d2fb Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 26 Mar 2015 14:36:39 -0500 Subject: [PATCH 165/276] Docs on withoutOverlapping. --- artisan.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/artisan.md b/artisan.md index d6a39fa038d..a4900c7480b 100644 --- a/artisan.md +++ b/artisan.md @@ -134,6 +134,14 @@ Let's look at a few more scheduling examples: $schedule->command('foo')->saturdays(); $schedule->command('foo')->sundays(); +### Prevent Jobs From Overlapping + +By default, scheduled jobs will be run even if the previous instance of the job is still running. To prevent this, you may use the `withoutOverlapping` method: + + $schedule->command('foo')->withoutOverlapping(); + +In this example, the `foo` command will be run every minute if it is not already running. + #### Limit The Environment The Jobs Should Run In $schedule->command('foo')->monthly()->environments('production'); From b084b617000879af3494435ccc17da86b08b178f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 26 Mar 2015 14:47:41 -0500 Subject: [PATCH 166/276] fix heading --- artisan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artisan.md b/artisan.md index a4900c7480b..db086faa311 100644 --- a/artisan.md +++ b/artisan.md @@ -134,7 +134,7 @@ Let's look at a few more scheduling examples: $schedule->command('foo')->saturdays(); $schedule->command('foo')->sundays(); -### Prevent Jobs From Overlapping +#### Prevent Jobs From Overlapping By default, scheduled jobs will be run even if the previous instance of the job is still running. To prevent this, you may use the `withoutOverlapping` method: From 779bb6654875e8561b63d83cb79a91830c4605d6 Mon Sep 17 00:00:00 2001 From: mhein Date: Fri, 27 Mar 2015 16:38:48 -0700 Subject: [PATCH 167/276] Clarification on accessing data inside a view when passing an array using the format. --- views.md | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 views.md diff --git a/views.md b/views.md old mode 100644 new mode 100755 index 42413ef66af..1c4eaa981c1 --- a/views.md +++ b/views.md @@ -45,6 +45,8 @@ If you wish, you may pass an array of data as the second parameter to the `view` $view = view('greetings', $data); +When passing information in this manner, `$data` should be an array with key/value pairs. Inside your view, you can then access each value using it's corresponding key, like `{{ this }}` (assuming `$data['this']` exists). + #### Sharing Data With All Views Occasionally, you may need to share a piece of data with all views that are rendered by your application. You have several options: the `view` helper, the `Illuminate\Contracts\View\Factory` [contract](/docs/5.0/contracts), or a wildcard [view composer](#view-composers). From 4b66beadba1538445a8e51c3971a41f21581a733 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 28 Mar 2015 16:44:17 -0300 Subject: [PATCH 168/276] Better word in this context. The word "method" isn't better in this context ? I'm not native english speaker, the word "command" in this context not sounds strange? --- billing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/billing.md b/billing.md index 83da9c8d6fa..b99d48b7f70 100644 --- a/billing.md +++ b/billing.md @@ -183,7 +183,7 @@ If the user cancels a subscription and then resumes that subscription before the ## Checking Subscription Status -To verify that a user is subscribed to your application, use the `subscribed` command: +To verify that a user is subscribed to your application, use the `subscribed` method: if ($user->subscribed()) { From f2278159d0f9d283032fe13672d8af9ed34740a1 Mon Sep 17 00:00:00 2001 From: Koko Kurak Date: Sun, 29 Mar 2015 22:38:45 +0200 Subject: [PATCH 169/276] Fix invalid class name --- container.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container.md b/container.md index 33c9b352fac..af6f8b5eab5 100644 --- a/container.md +++ b/container.md @@ -18,7 +18,7 @@ Let's look at a simple example: Date: Mon, 30 Mar 2015 07:07:32 +0800 Subject: [PATCH 170/276] Use database_path(), available since v5.0.22 Signed-off-by: crynobone --- packages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.md b/packages.md index 96ae2cc64c1..bec793fe958 100644 --- a/packages.md +++ b/packages.md @@ -132,7 +132,7 @@ You may want to publish groups of files separately. For instance, you might want // Publish your migrations $this->publishes([ - __DIR__.'/../database/migrations/' => base_path('/database/migrations') + __DIR__.'/../database/migrations/' => database_path('/migrations') ], 'migrations'); You can then publish these files separately by referencing their tag like so: From 81b2e5905253591db95c2b47f71491d75538f8d0 Mon Sep 17 00:00:00 2001 From: mhein Date: Fri, 27 Mar 2015 16:38:48 -0700 Subject: [PATCH 171/276] Clarification on accessing data inside a view when passing an array using the format. --- views.md | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 views.md diff --git a/views.md b/views.md old mode 100644 new mode 100755 index 42413ef66af..1c4eaa981c1 --- a/views.md +++ b/views.md @@ -45,6 +45,8 @@ If you wish, you may pass an array of data as the second parameter to the `view` $view = view('greetings', $data); +When passing information in this manner, `$data` should be an array with key/value pairs. Inside your view, you can then access each value using it's corresponding key, like `{{ this }}` (assuming `$data['this']` exists). + #### Sharing Data With All Views Occasionally, you may need to share a piece of data with all views that are rendered by your application. You have several options: the `view` helper, the `Illuminate\Contracts\View\Factory` [contract](/docs/5.0/contracts), or a wildcard [view composer](#view-composers). From 7a54a448cfeb86a901fbe8cfea911751c4265481 Mon Sep 17 00:00:00 2001 From: morganhein Date: Mon, 30 Mar 2015 08:56:45 -0700 Subject: [PATCH 172/276] Removed 'this' as a key example To reduce confusion with the 'this' keyword of instance objects. --- views.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views.md b/views.md index 1c4eaa981c1..8b9bc2f9d5b 100755 --- a/views.md +++ b/views.md @@ -45,7 +45,7 @@ If you wish, you may pass an array of data as the second parameter to the `view` $view = view('greetings', $data); -When passing information in this manner, `$data` should be an array with key/value pairs. Inside your view, you can then access each value using it's corresponding key, like `{{ this }}` (assuming `$data['this']` exists). +When passing information in this manner, `$data` should be an array with key/value pairs. Inside your view, you can then access each value using it's corresponding key, like `{{ $key }}` (assuming `$data['$key']` exists). #### Sharing Data With All Views From f6781d21226fb7e00433a71239e342a9f20764f2 Mon Sep 17 00:00:00 2001 From: Darron Driver Date: Tue, 31 Mar 2015 06:15:11 +0200 Subject: [PATCH 173/276] adding 'true' to the list of accepted values --- validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation.md b/validation.md index f1d1e48a64a..e85fe648c9b 100644 --- a/validation.md +++ b/validation.md @@ -366,7 +366,7 @@ Below is a list of all available validation rules and their function: #### accepted -The field under validation must be _yes_, _on_, or _1_. This is useful for validating "Terms of Service" acceptance. +The field under validation must be _yes_, _on_, _1_, or _true_. This is useful for validating "Terms of Service" acceptance. #### active_url From 07e68a40f35428ecbe3048378c19b1595eb806f9 Mon Sep 17 00:00:00 2001 From: Tom Stones Date: Wed, 1 Apr 2015 12:50:41 +1100 Subject: [PATCH 174/276] Removed references to 5.3 --- helpers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers.md b/helpers.md index e347b568ccd..46b3c4f680b 100644 --- a/helpers.md +++ b/helpers.md @@ -180,7 +180,7 @@ Filter the array using the given Closure. ### head -Return the first element in the array. Useful for method chaining in PHP 5.3.x. +Return the first element in the array. $first = head($this->returnsArray('foo')); @@ -463,6 +463,6 @@ Get a View instance for the given view path. ### with -Return the given object. Useful for method chaining constructors in PHP 5.3.x. +Return the given object. $value = with(new Foo)->doWork(); From 918256fbc30ec5e56f6eb2277eb67bffdb45c13b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 1 Apr 2015 09:34:05 -0500 Subject: [PATCH 175/276] Removing incorrect section on extending blade. --- templates.md | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/templates.md b/templates.md index e10c280068b..930cbe909ad 100644 --- a/templates.md +++ b/templates.md @@ -2,7 +2,6 @@ - [Blade Templating](#blade-templating) - [Other Blade Control Structures](#other-blade-control-structures) -- [Extending Blade](#extending-blade) ## Blade Templating @@ -138,20 +137,3 @@ To overwrite a section entirely, you may use the `overwrite` statement: {{-- This comment will not be in the rendered HTML --}} - -## Extending Blade - -Blade even allows you to define your own custom control structures. When a Blade file is compiled, each custom extension is called with the view contents, allowing you to do anything from simple `str_replace` manipulations to more complex regular expressions. - -The Blade compiler comes with the helper methods `createMatcher` and `createPlainMatcher`, which generate the expression you need to build your own custom directives. - -The `createPlainMatcher` method is used for directives with no arguments like `@endif` and `@stop`, while `createMatcher` is used for directives with arguments. - -The following example creates a `@datetime($var)` directive which simply calls `->format()` on `$var`: - - Blade::extend(function($view, $compiler) - { - $pattern = $compiler->createOpenMatcher('datetime'); - - return preg_replace($pattern, '$1format(\'m/d/Y H:i\')); ?>', $view); - }); From a13bd60862d9baaae179b4a1df7da909c54175ac Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 1 Apr 2015 10:00:56 -0500 Subject: [PATCH 176/276] various fixes --- routing.md | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/routing.md b/routing.md index 61aaebb1c21..cdd58f9a88b 100644 --- a/routing.md +++ b/routing.md @@ -220,27 +220,25 @@ The `currentRouteName` method returns the name of the route handling the current ## Route Groups -Sometimes many of your routes will share common requirements such as URL segments, middleware, namespaces, etc. Instead of specifying each of these options on each route individually, you may use a route group to apply attributes to many routes. +Sometimes many of your routes will share common requirements such as URL segments, middleware, namespaces, etc. Instead of specifying each of these options on every route individually, you may use a route group to apply attributes to many routes. -Shared attributes are specified in an array format as the first parameter to the `Route@group` method. Attributes are applied to nested route groups and merged as you'd expect. +Shared attributes are specified in an array format as the first parameter to the `Route::group` method. ### Middleware -Middleware is applied to all routes within the group by defining the list of middleware with the `middleware` parameter on the attribute array. You may specify your middleware as a string describing a single middleware task, or as an array of strings describing multiple middleware tasks. Middleware will be executed in the order you define this array: +Middleware is applied to all routes within the group by defining the list of middleware with the `middleware` parameter on the group attribute array. Middleware will be executed in the order you define this array: -#### Applying filters to a group of routes via middleware - - Route::group(['middleware' => 'auth'], function() + Route::group(['middleware' => 'foo|bar'], function() { Route::get('/', function() { - // Has Auth Filter + // Has Foo And Bar Middleware }); Route::get('user/profile', function() { - // Has Auth Filter + // Has Foo And Bar Middleware }); }); @@ -248,21 +246,19 @@ Middleware is applied to all routes within the group by defining the list of mid ### Namespaces -You may use the `namespace` parameter within your `group` attributes array to specify the namespace for all controllers within the group: - -#### Applying namespaces and nested namespaces to a group of routes +You may use the `namespace` parameter in your group attribute array to specify the namespace for all controllers within the group: Route::group(['namespace' => 'Admin'], function() { - // Controllers will be expected to be within the App\Http\Controllers\Admin namespace + // Controllers Within The "App\Http\Controllers\Admin" Namespace Route::group(['namespace' => 'User'], function() { - // Controllers will be expected to be within the App\Http\Controllers\Admin\User namespace + // Controllers Within The "App\Http\Controllers\Admin" Namespace }); }); -> **Note:** By default, the `RouteServiceProvider` includes your `routes.php` file within a namespace group, allowing you to register controller routes without specifying the full (App\Http\Controllers) namespace prefix. +> **Note:** By default, the `RouteServiceProvider` includes your `routes.php` file within a namespace group, allowing you to register controller routes without specifying the full `App\Http\Controllers` namespace prefix. ### Sub-Domain Routing @@ -282,17 +278,15 @@ Laravel routes also handle wildcard sub-domains, and will pass your wildcard par }); -### Route prefixing - -If you'd like your routes within a group to share the same URL prefix, you can utilize the `prefix` key on the attribute array to define the URL prefix that all routes must match. +### Route Prefixing -#### Registering a URL prefix for a group of routes +A group of routes may be prefixed by using the `prefix` option in the attributes array of a group: Route::group(['prefix' => 'admin'], function() { Route::get('users', function() { - // Matches the /admin/users URL + // Matches The "/admin/users" URL }); }); @@ -304,20 +298,18 @@ You can also utilize the `prefix` parameter to pass common parameters to your ro { Route::get('detail', function($account_id) { - // $account_id will be the value retrieved by the 'account_id' parameter from the route group prefix + // }); }); -Like Routes, you can define parameter constraints for the named parameters in your prefix: - -#### Defining route prefix parameter constraints using regular expressions +You can even define parameter constraints for the named parameters in your prefix: Route::group([ 'prefix' => 'accounts/{account_id}', 'where' => ['account_id' => '[0-9]+'], ], function() { - // All routes within this group will require $account_id to be numeric, otherwise the group will not match + // Define Routes Here }); From 62f161daa5f1e6288811355456b75c484da3eaa4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 1 Apr 2015 10:06:27 -0500 Subject: [PATCH 177/276] fixes --- queries.md | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/queries.md b/queries.md index 735a52fffaa..7fe5e5866f6 100644 --- a/queries.md +++ b/queries.md @@ -116,21 +116,9 @@ This method will return an array of role titles. You may also specify a custom k $users = DB::table('users') ->whereNull('updated_at')->get(); -#### Order By, Group By, And Having - - $users = DB::table('users') - ->orderBy('name', 'desc') - ->groupBy('count') - ->having('count', '>', 100) - ->get(); - -#### Offset & Limit - - $users = DB::table('users')->skip(10)->take(5)->get(); - #### Dynamic Where Clauses -This feature allows you to write `where()` and `orWhere()` statements in a more readable and elegant fashion. +You may even use "dynamic" where statements to fluently build where statements using magic methods: $admin = DB::table('users')->whereId(1)->first(); @@ -139,11 +127,20 @@ This feature allows you to write `where()` and `orWhere()` statements in a more ->first(); $jane = DB::table('users') - ->whereNameOrGender('Jane', 'F') + ->whereNameOrAge('Jane', 22) ->first(); - // Note that snake_case column names are converted into PascalCase - $doe = DB::table('users')->whereLastName('doe')->first(); +#### Order By, Group By, And Having + + $users = DB::table('users') + ->orderBy('name', 'desc') + ->groupBy('count') + ->having('count', '>', 100) + ->get(); + +#### Offset & Limit + + $users = DB::table('users')->skip(10)->take(5)->get(); ## Joins From 778d44b71c6d04078657e13e0a414109ebc2c3a1 Mon Sep 17 00:00:00 2001 From: Mark Beech Date: Wed, 1 Apr 2015 21:14:42 +0100 Subject: [PATCH 178/276] Added missing tag --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index cdd58f9a88b..3fe313a6350 100644 --- a/routing.md +++ b/routing.md @@ -224,7 +224,7 @@ Sometimes many of your routes will share common requirements such as URL segment Shared attributes are specified in an array format as the first parameter to the `Route::group` method. - + ### Middleware Middleware is applied to all routes within the group by defining the list of middleware with the `middleware` parameter on the group attribute array. Middleware will be executed in the order you define this array: From 4140d7502857a3d1d76efe384893876a8da8493a Mon Sep 17 00:00:00 2001 From: Mark Beech Date: Wed, 1 Apr 2015 21:38:01 +0100 Subject: [PATCH 179/276] Another missing --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index 3fe313a6350..ee5abb3d23c 100644 --- a/routing.md +++ b/routing.md @@ -243,7 +243,7 @@ Middleware is applied to all routes within the group by defining the list of mid }); - + ### Namespaces You may use the `namespace` parameter in your group attribute array to specify the namespace for all controllers within the group: From 52697454e8bb53ca8e77dca20b875bbdafe29c6c Mon Sep 17 00:00:00 2001 From: Ed Rands Date: Wed, 1 Apr 2015 16:53:19 -0700 Subject: [PATCH 180/276] Add compact @section() syntax example --- templates.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates.md b/templates.md index 930cbe909ad..a1e40f42451 100644 --- a/templates.md +++ b/templates.md @@ -13,6 +13,9 @@ Blade is a simple, yet powerful templating engine provided with Laravel. Unlike + + App Name - @yield('title') + @section('sidebar') This is the master sidebar. @@ -27,6 +30,8 @@ Blade is a simple, yet powerful templating engine provided with Laravel. Unlike #### Using A Blade Layout @extends('layouts.master') + + @section('title', 'Page Title') @section('sidebar') @@parent From 3e380b9df07fdc74e5b3d24aef910b796b792e44 Mon Sep 17 00:00:00 2001 From: Chris Cook Date: Thu, 2 Apr 2015 09:43:00 +0100 Subject: [PATCH 181/276] Remove extra word --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index ee5abb3d23c..3969c42dceb 100644 --- a/routing.md +++ b/routing.md @@ -21,7 +21,7 @@ You will define most of the routes for your application in the `app/Http/routes. return 'Hello World'; }); -#### Other Basic Routes Route +#### Other Basic Routes Route::post('foo/bar', function() { From c719850b99f7f12c87e985bf64cc6990aa81df58 Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Thu, 2 Apr 2015 17:34:35 -0400 Subject: [PATCH 182/276] Add Browserify note --- elixir.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/elixir.md b/elixir.md index aaccfb0cb6c..b20d9bf6777 100644 --- a/elixir.md +++ b/elixir.md @@ -252,6 +252,18 @@ elixir(function(mix) { }); ``` +#### Trigger Browserify + +```javascript +elixir(function(mix) { + mix.browserify('index.js'); +}); +``` + +Want to require modules in the browser? Hoping to use EcmaScript 6 sooner than later? Need a built-in JSX transformer? If so, [Browserify](http://browserify.org/), along with the `browserify` Elixir task, will handle the job nicely. + +This task assumes that your scripts are stored in `resources/js`, though you're free to override the default. + #### Method Chaining Of course, you may chain almost all of Elixir's methods together to build your recipe: From 91bc93df9e565425db7e4c70f01e36c6b5c7591a Mon Sep 17 00:00:00 2001 From: James Holland Date: Thu, 2 Apr 2015 22:09:05 -0400 Subject: [PATCH 183/276] Add additional "\User" level to namespace example I'm still learning ... but assume nested route::group corresponds to nested namespace. --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index 3969c42dceb..59426bcb278 100644 --- a/routing.md +++ b/routing.md @@ -254,7 +254,7 @@ You may use the `namespace` parameter in your group attribute array to specify t Route::group(['namespace' => 'User'], function() { - // Controllers Within The "App\Http\Controllers\Admin" Namespace + // Controllers Within The "App\Http\Controllers\Admin\User" Namespace }); }); From eb505092356ca15c732136637d5420687b0f3c04 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 4 Apr 2015 09:24:25 -0500 Subject: [PATCH 184/276] Update docs for confirm feature. --- envoy.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/envoy.md b/envoy.md index 6481de4026a..6bfc424705e 100644 --- a/envoy.md +++ b/envoy.md @@ -74,6 +74,16 @@ You may also use ```@include``` to include any PHP files: @include('vendor/autoload.php'); +#### Confirming Tasks Before Running + +If you would like to be prompted for confirmation before running a given task on your servers, you may use the `confirm` directive: + + @task('deploy', ['on' => 'web', 'confirm' => true]) + cd site + git pull origin {{ $branch }} + php artisan migrate + @endtask + ## Multiple Servers From 1360cf1621cec53d1c263c404bc92bd6d1d39bbf Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Sat, 4 Apr 2015 11:25:59 -0400 Subject: [PATCH 185/276] Sass/Less may be called multiple times now --- elixir.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir.md b/elixir.md index b20d9bf6777..1ef5be62624 100644 --- a/elixir.md +++ b/elixir.md @@ -73,7 +73,7 @@ elixir(function(mix) { }); ``` -This assumes that your Sass files are stored in `resources/assets/sass`. The `sass` method may only be called once. If you would like to compile multiple Sass files, pass an array to the `sass` method. +This assumes that your Sass files are stored in `resources/assets/sass`. By default, Elixir, underneath the hood, uses the LibSass library for compilation. In some instances, it might prove advantageous to instead leverage the Ruby version, which, though slower, is more feature rich. Assuming that you have both Ruby and the Sass gem installed (`gem install sass`), you may enable Ruby-mode, like so: From f7382cbae98e14a91d024527262ffa17228bbef5 Mon Sep 17 00:00:00 2001 From: Alfred Nutile Date: Sun, 5 Apr 2015 12:04:47 -0400 Subject: [PATCH 186/276] Add Port 4430 to 443 --- homestead.md | 1 + 1 file changed, 1 insertion(+) diff --git a/homestead.md b/homestead.md index 427120f8c18..e6828017ff7 100644 --- a/homestead.md +++ b/homestead.md @@ -190,6 +190,7 @@ The following ports are forwarded to your Homestead environment: - **SSH:** 2222 → Forwards To 22 - **HTTP:** 8000 → Forwards To 80 +- **HTTPS:** 44300 → Forwards To 443 - **MySQL:** 33060 → Forwards To 3306 - **Postgres:** 54320 → Forwards To 5432 From 7477228104e99c28bcd0beba60dbddb37949bd20 Mon Sep 17 00:00:00 2001 From: AyubM Date: Sun, 5 Apr 2015 12:54:30 -0400 Subject: [PATCH 187/276] replace old ModelNotFoundException logging with new way The old code that was here no longer works in Laravel 5, so I removed it and replaced it with the current way of error handling. --- eloquent.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/eloquent.md b/eloquent.md index 9a702e75ec7..87b5bb44d1b 100644 --- a/eloquent.md +++ b/eloquent.md @@ -69,20 +69,37 @@ Once a model is defined, you are ready to start retrieving and creating records #### Retrieving A Model By Primary Key Or Throw An Exception -Sometimes you may wish to throw an exception if a model is not found, allowing you to catch the exceptions using an `App::error` handler and display a 404 page. +Sometimes you may wish to throw an exception if a model is not found. $model = User::findOrFail(1); $model = User::where('votes', '>', 100)->firstOrFail(); -To register the error handler, listen for the `ModelNotFoundException` +Doing this will let you catch the exception so you can log and display an error page as necessary. To register the error handler for the `ModelNotFoundException`, edit the `app/Exceptions/Handler.php` file. use Illuminate\Database\Eloquent\ModelNotFoundException; - App::error(function(ModelNotFoundException $e) - { - return Response::make('Not Found', 404); - }); + class Handler extends ExceptionHandler { + public function report(Exception $e) + { + if ($e instanceof ModelNotFoundException) { + // log the error + } + + return parent::report($e); + } + + public function render($request, Exception $e) + { + if ($e instanceof ModelNotFoundException) { + // display the error with a custom page (make the view in the views/errors folder) + // alternatively, for a simple 404 page use abort(404) + return response(view('errors.modelnotfound'), 404); + } + + return parent::render($request, $e); + } + } #### Querying Using Eloquent Models From e9397c4c2a0ccc7627ccc4c55e6f60b698794fe5 Mon Sep 17 00:00:00 2001 From: Jim Ciallella Date: Mon, 6 Apr 2015 21:47:36 -0400 Subject: [PATCH 188/276] Add Memcached cache configuration example. Add a link to the Redis cache page --- cache.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cache.md b/cache.md index 986bece4d79..a663a46cfab 100644 --- a/cache.md +++ b/cache.md @@ -6,6 +6,8 @@ - [Cache Tags](#cache-tags) - [Cache Events](#cache-events) - [Database Cache](#database-cache) +- [Memcached Cache](#memcached-cache) +- [Redis Cache](#redis-cache) ## Configuration @@ -170,3 +172,25 @@ When using the `database` cache driver, you will need to setup a table to contai $table->text('value'); $table->integer('expiration'); }); + + +#### Memcached Cache + +Requires the [Memcached PECL package](http://pecl.php.net/package/memcached) to be installed. + +The default [configuration](#configuration) uses TCP/IP based on [Memcached::addServer](http://php.net/manual/en/memcached.addserver.php) + + 'memcached' => array( + array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), + ), + +For better performance, start Memcached as a UNIX socket, and then set `host` to a socket file path and `port` to `0` + + 'memcached' => array( + array('host' => '/var/run/memcached/memcached.sock', 'port' => 0, 'weight' => 100), + ), + + +#### Redis Cache + +See [Redis Configuration](/docs/redis#configuration) From 55f59af788859a3fb436eee6c05e3e4a7fa21aa8 Mon Sep 17 00:00:00 2001 From: Jessie Siat Date: Tue, 7 Apr 2015 10:10:49 +0800 Subject: [PATCH 189/276] fixed typo --- validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation.md b/validation.md index e85fe648c9b..8c5d434abdd 100644 --- a/validation.md +++ b/validation.md @@ -224,7 +224,7 @@ If you plan to have authorization logic in another part of your application, sim ### Customizing The Flashed Error Format -If you wish to customize the format of the validation errors that are flashed to the session when validation fails, override the `formatValidationErrors` on your base request (`App\Http\Requests\Request`). Don't forget to import the `Illuminate\Validation\Validator` class at the top of the file: +If you wish to customize the format of the validation errors that are flashed to the session when validation fails, override the `formatErrors` on your base request (`App\Http\Requests\Request`). Don't forget to import the `Illuminate\Validation\Validator` class at the top of the file: /** * {@inheritdoc} From 6d5dfde45f5ea0b3fb9c28cb0a07aaf9d44f4657 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 7 Apr 2015 11:03:55 -0500 Subject: [PATCH 190/276] tweak docs. --- cache.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cache.md b/cache.md index a663a46cfab..8e6e3289a03 100644 --- a/cache.md +++ b/cache.md @@ -176,15 +176,15 @@ When using the `database` cache driver, you will need to setup a table to contai #### Memcached Cache -Requires the [Memcached PECL package](http://pecl.php.net/package/memcached) to be installed. +Using the Memcached cache requires the [Memcached PECL package](http://pecl.php.net/package/memcached) to be installed. -The default [configuration](#configuration) uses TCP/IP based on [Memcached::addServer](http://php.net/manual/en/memcached.addserver.php) +The default [configuration](#configuration) uses TCP/IP based on [Memcached::addServer](http://php.net/manual/en/memcached.addserver.php): 'memcached' => array( array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), ), -For better performance, start Memcached as a UNIX socket, and then set `host` to a socket file path and `port` to `0` +You may also set the `host` option to a UNIX socket path. If you do this, the `port` option should be set to `0`: 'memcached' => array( array('host' => '/var/run/memcached/memcached.sock', 'port' => 0, 'weight' => 100), From d099e9022f9ce0babe26974e6fa491879f56ff78 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 7 Apr 2015 11:08:13 -0500 Subject: [PATCH 191/276] working on docs --- eloquent.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/eloquent.md b/eloquent.md index 87b5bb44d1b..8d2a7366aeb 100644 --- a/eloquent.md +++ b/eloquent.md @@ -69,36 +69,28 @@ Once a model is defined, you are ready to start retrieving and creating records #### Retrieving A Model By Primary Key Or Throw An Exception -Sometimes you may wish to throw an exception if a model is not found. +Sometimes you may wish to throw an exception if a model is not found. To do this, you may use the `firstOrFail` method: $model = User::findOrFail(1); $model = User::where('votes', '>', 100)->firstOrFail(); -Doing this will let you catch the exception so you can log and display an error page as necessary. To register the error handler for the `ModelNotFoundException`, edit the `app/Exceptions/Handler.php` file. +Doing this will let you catch the exception so you can log and display an error page as necessary. To catch the `ModelNotFoundException`, add some logic to your `app/Exceptions/Handler.php` file. use Illuminate\Database\Eloquent\ModelNotFoundException; class Handler extends ExceptionHandler { - public function report(Exception $e) - { - if ($e instanceof ModelNotFoundException) { - // log the error - } - - return parent::report($e); - } - + public function render($request, Exception $e) { - if ($e instanceof ModelNotFoundException) { - // display the error with a custom page (make the view in the views/errors folder) - // alternatively, for a simple 404 page use abort(404) - return response(view('errors.modelnotfound'), 404); + if ($e instanceof ModelNotFoundException) + { + // Custom logic for model not found... } - + return parent::render($request, $e); } + } #### Querying Using Eloquent Models From b9c48f069f26705cc8513f27bf4d6126fe718785 Mon Sep 17 00:00:00 2001 From: Nekrasov Ilya Date: Tue, 7 Apr 2015 21:22:53 +0300 Subject: [PATCH 192/276] Update schema.md --- schema.md | 1 + 1 file changed, 1 insertion(+) diff --git a/schema.md b/schema.md index aeb85b41c34..387aef0ebc6 100644 --- a/schema.md +++ b/schema.md @@ -75,6 +75,7 @@ Command | Description `$table->increments('id');` | Incrementing ID to the table (primary key). `$table->integer('votes');` | INTEGER equivalent to the table `$table->json('options');` | JSON equivalent to the table +`$table->jsonb('options');` | JSONB equivalent to the table `$table->longText('description');` | LONGTEXT equivalent to the table `$table->mediumInteger('numbers');` | MEDIUMINT equivalent to the table `$table->mediumText('description');` | MEDIUMTEXT equivalent to the table From 8eb6b09cd477e0b69db00039915055675f6b181f Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 7 Apr 2015 19:35:14 +0100 Subject: [PATCH 193/276] Typo fixes --- schema.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema.md b/schema.md index 387aef0ebc6..075a4c4a5b2 100644 --- a/schema.md +++ b/schema.md @@ -61,7 +61,7 @@ The table builder contains a variety of column types that you may use when build Command | Description ------------- | ------------- -`$table->bigIncrements('id');` | Incrementing ID using a "big integer" equivalent. +`$table->bigIncrements('id');` | Incrementing ID using a "big integer" equivalent `$table->bigInteger('votes');` | BIGINT equivalent to the table `$table->binary('data');` | BLOB equivalent to the table `$table->boolean('confirmed');` | BOOLEAN equivalent to the table @@ -72,7 +72,7 @@ Command | Description `$table->double('column', 15, 8);` | DOUBLE equivalent with precision, 15 digits in total and 8 after the decimal point `$table->enum('choices', ['foo', 'bar']);` | ENUM equivalent to the table `$table->float('amount');` | FLOAT equivalent to the table -`$table->increments('id');` | Incrementing ID to the table (primary key). +`$table->increments('id');` | Incrementing ID to the table (primary key) `$table->integer('votes');` | INTEGER equivalent to the table `$table->json('options');` | JSON equivalent to the table `$table->jsonb('options');` | JSONB equivalent to the table From 276df9dd7a5d66a5c377a7793e50802d975ff26a Mon Sep 17 00:00:00 2001 From: Mulia Arifandi Nasution Date: Wed, 8 Apr 2015 07:16:06 +0700 Subject: [PATCH 194/276] Remove executable permissions from markdown files --- documentation.md | 0 views.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 documentation.md mode change 100755 => 100644 views.md diff --git a/documentation.md b/documentation.md old mode 100755 new mode 100644 diff --git a/views.md b/views.md old mode 100755 new mode 100644 From cc8c2e868282cf4fd5df92c2e5f4de0bd0588998 Mon Sep 17 00:00:00 2001 From: Mulia Arifandi Nasution Date: Wed, 8 Apr 2015 07:17:10 +0700 Subject: [PATCH 195/276] Fix typo --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index 59426bcb278..171fcec2962 100644 --- a/routing.md +++ b/routing.md @@ -346,7 +346,7 @@ If you wish to specify your own "not found" behavior, pass a Closure as the thir throw new NotFoundHttpException; }); -If you wish to use your own resolution logic, you should use the `Router::bind` method. The Closure you pass to the `bind` method will receive the value of the URI segment, and should return an instance of the class you want to be injected into the route: +If you wish to use your own resolution logic, you should use the `Route::bind` method. The Closure you pass to the `bind` method will receive the value of the URI segment, and should return an instance of the class you want to be injected into the route: Route::bind('user', function($value) { From 890e8b38b441cb1df090ce93926c5a89f7206ae6 Mon Sep 17 00:00:00 2001 From: lagbox Date: Wed, 8 Apr 2015 10:20:45 -0400 Subject: [PATCH 196/276] Update eloquent.md Adjusted to include 'plural'. --- eloquent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eloquent.md b/eloquent.md index 8d2a7366aeb..e18f980121d 100644 --- a/eloquent.md +++ b/eloquent.md @@ -43,7 +43,7 @@ You may also generate Eloquent models using the `make:model` command: php artisan make:model User -Note that we did not tell Eloquent which table to use for our `User` model. The "snake case" name of the class will be used as the table name unless another name is explicitly specified. So, in this case, Eloquent will assume the `User` model stores records in the `users` table. You may specify a custom table by defining a `table` property on your model: +Note that we did not tell Eloquent which table to use for our `User` model. The "snake case", plural name of the class will be used as the table name unless another name is explicitly specified. So, in this case, Eloquent will assume the `User` model stores records in the `users` table. You may specify a custom table by defining a `table` property on your model: class User extends Model { From 27ab20ce904cc2ce615c0130b6abcbf72a4e929f Mon Sep 17 00:00:00 2001 From: Emmanuel Maggion Date: Thu, 9 Apr 2015 10:07:45 +0800 Subject: [PATCH 197/276] Set port to listen for serve script If you don't set the port to listen nginx won't restart due to bad configuration file. --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 427120f8c18..8327702bf82 100644 --- a/homestead.md +++ b/homestead.md @@ -179,7 +179,7 @@ Once your Homestead environment is provisioned and running, you may want to add Alternatively, you may use the `serve` script that is available on your Homestead environment. To use the `serve` script, SSH into your Homestead environment and run the following command: - serve domain.app /home/vagrant/Code/path/to/public/directory + serve domain.app /home/vagrant/Code/path/to/public/directory 80 > **Note:** After running the `serve` command, do not forget to add the new site to the `hosts` file on your main machine! From 2fa23acf6a3365b02f8e6ca766b4c5d58fb472d8 Mon Sep 17 00:00:00 2001 From: Kaden Lee Date: Thu, 9 Apr 2015 16:29:58 +0900 Subject: [PATCH 198/276] Remove unneccessary new lines in the paragraphs --- elixir.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/elixir.md b/elixir.md index 1ef5be62624..0f2f05765cc 100644 --- a/elixir.md +++ b/elixir.md @@ -9,8 +9,7 @@ ## Introduction -Laravel Elixir provides a clean, fluent API for defining basic [Gulp](http://gulpjs.com) tasks for your -Laravel application. Elixir supports several common CSS and JavaScript pre-processors, and even testing tools. +Laravel Elixir provides a clean, fluent API for defining basic [Gulp](http://gulpjs.com) tasks for your Laravel application. Elixir supports several common CSS and JavaScript pre-processors, and even testing tools. If you've ever been confused about how to get started with Gulp and asset compilation, you will love Laravel Elixir! @@ -23,9 +22,7 @@ Before triggering Elixir, you must first ensure that Node.js is installed on you node -v -By default, Laravel Homestead includes everything you need; however, if you aren't using Vagrant, then you -can easily install Node by visiting [their download page](http://nodejs.org/download/). Don't worry, it's -quick and easy! +By default, Laravel Homestead includes everything you need; however, if you aren't using Vagrant, then you can easily install Node by visiting [their download page](http://nodejs.org/download/). Don't worry, it's quick and easy! ### Gulp From 607cff49e500ab53d592b092a0fd0a642b1d92d2 Mon Sep 17 00:00:00 2001 From: Jason Gilmore Date: Thu, 9 Apr 2015 09:19:06 -0400 Subject: [PATCH 199/276] Updated User class in Model Setup to extend Model The User model example found in the Model Setup section extended Eloquent. I've updated it to instead extend Model. --- billing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/billing.md b/billing.md index b99d48b7f70..a015cbbd164 100644 --- a/billing.md +++ b/billing.md @@ -44,7 +44,7 @@ Next, add the `Billable` trait and appropriate date mutators to your model defin use Laravel\Cashier\Billable; use Laravel\Cashier\Contracts\Billable as BillableContract; - class User extends Eloquent implements BillableContract { + class User extends Model implements BillableContract { use Billable; From f4e9bdba4f126fca857d7670e7dac573c4299987 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 10 Apr 2015 23:06:56 -0500 Subject: [PATCH 200/276] Docs. --- homestead.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homestead.md b/homestead.md index 8327702bf82..cc6ba80054a 100644 --- a/homestead.md +++ b/homestead.md @@ -214,5 +214,7 @@ All of the proper packages have already been installed on your Homestead box, yo blackfire: - id: your-server-id token: your-server-token + client-id: your-client-id + client-token: your-client-token Once you have configured your Blackfire credentials, re-provision the box using `homestead provision` or `vagrant provision`. Of course, be sure to review the [Blackfire documentation](https://blackfire.io/getting-started) to learn how to install the Blackfire companion extension for your web browser. From 891ad40b3593a6386b8edbd5832198fccc97a02f Mon Sep 17 00:00:00 2001 From: Dion Bosschieter Date: Sun, 12 Apr 2015 14:45:55 +0200 Subject: [PATCH 201/276] Column changing requires doctrine/dbal --- schema.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/schema.md b/schema.md index 075a4c4a5b2..b7d167fe594 100644 --- a/schema.md +++ b/schema.md @@ -104,6 +104,8 @@ If you are using the MySQL database, you may use the `after` method to specify t ## Changing Columns +**Note:** Before changing a column, be sure to add the doctrine/dbal dependency to your composer.json file. + Sometimes you may need to modify an existing column. For example, you may wish to increase the size of a string column. The `change` method makes it easy! For example, let's increase the size of the `name` column from 25 to 50: Schema::table('users', function($table) From 64490458bf82b3052881558a35b470463856a249 Mon Sep 17 00:00:00 2001 From: Gordon Oppenheimer Date: Sun, 12 Apr 2015 09:17:08 -0400 Subject: [PATCH 202/276] Update eloquent.md "Retrieving All Models" should be "Retrieving All Records" --- eloquent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eloquent.md b/eloquent.md index e18f980121d..05b3a08fd78 100644 --- a/eloquent.md +++ b/eloquent.md @@ -55,7 +55,7 @@ Note that we did not tell Eloquent which table to use for our `User` model. The Once a model is defined, you are ready to start retrieving and creating records in your table. Note that you will need to place `updated_at` and `created_at` columns on your table by default. If you do not wish to have these columns automatically maintained, set the `$timestamps` property on your model to `false`. -#### Retrieving All Models +#### Retrieving All Records $users = User::all(); From c868cb04c8e5ed9730870c447948ae48783ddbc9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 12 Apr 2015 14:32:50 -0500 Subject: [PATCH 203/276] Formatting. --- schema.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema.md b/schema.md index b7d167fe594..075a92ac3af 100644 --- a/schema.md +++ b/schema.md @@ -104,7 +104,7 @@ If you are using the MySQL database, you may use the `after` method to specify t ## Changing Columns -**Note:** Before changing a column, be sure to add the doctrine/dbal dependency to your composer.json file. +**Note:** Before changing a column, be sure to add the `doctrine/dbal` dependency to your `composer.json` file. Sometimes you may need to modify an existing column. For example, you may wish to increase the size of a string column. The `change` method makes it easy! For example, let's increase the size of the `name` column from 25 to 50: @@ -130,7 +130,7 @@ To rename a column, you may use the `renameColumn` method on the Schema builder. $table->renameColumn('from', 'to'); }); -> **Note:** Renaming columns in a table with `enum` column is currently not supported. +> **Note:** Renaming columns in a table with `enum` column is currently not supported. ## Dropping Columns From e103358dad2272251750ce355a4845621b09c7cc Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 12 Apr 2015 14:59:19 -0500 Subject: [PATCH 204/276] Ports. --- homestead.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homestead.md b/homestead.md index cc6ba80054a..1abc25c134a 100644 --- a/homestead.md +++ b/homestead.md @@ -130,6 +130,8 @@ You can make any Homestead site use [HHVM](http://hhvm.com) by setting the `hhvm to: /home/vagrant/Code/Laravel/public hhvm: true +Each site will be accessible by HTTP via port 8000 and HTTPS via port 44300. + ### Bash Aliases To add Bash aliases to your Homestead box, simply add to the `aliases` file in the root of the `~/.homestead` directory. From 83094211a2f5f8b9ada9aa17133cb3b9996f65f8 Mon Sep 17 00:00:00 2001 From: Adam Engebretson Date: Tue, 14 Apr 2015 12:18:43 -0500 Subject: [PATCH 205/276] Update routing.md --- routing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/routing.md b/routing.md index 171fcec2962..fb261bd0cf3 100644 --- a/routing.md +++ b/routing.md @@ -120,6 +120,8 @@ Of course, you can capture segments of the request URI within your route: { return 'User '.$id; }); + +> Note: Route parameters cannot contain the `-` character. Use an underscore (`_`) instead. #### Optional Route Parameters From 417716614e6351d220aa2e4f4370003a3fa776e5 Mon Sep 17 00:00:00 2001 From: lagbox Date: Tue, 14 Apr 2015 22:28:33 -0400 Subject: [PATCH 206/276] Added $view argument to View Composer closures --- views.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views.md b/views.md index 8b9bc2f9d5b..8c8eb0e1526 100644 --- a/views.md +++ b/views.md @@ -105,7 +105,7 @@ Let's organize our view composers within a [service provider](/docs/5.0/provider View::composer('profile', 'App\Http\ViewComposers\ProfileComposer'); // Using Closure based composers... - View::composer('dashboard', function() + View::composer('dashboard', function($view) { }); @@ -176,7 +176,7 @@ Just before the view is rendered, the composer's `compose` method is called with The `composer` method accepts the `*` character as a wildcard, so you may attach a composer to all views like so: - View::composer('*', function() + View::composer('*', function($view) { // }); From 58440a6667df4a988472e5a535c9ed41b24a86d3 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 15 Apr 2015 11:03:52 -0500 Subject: [PATCH 207/276] Bold. --- routing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routing.md b/routing.md index fb261bd0cf3..9eef8ae52ff 100644 --- a/routing.md +++ b/routing.md @@ -120,8 +120,8 @@ Of course, you can capture segments of the request URI within your route: { return 'User '.$id; }); - -> Note: Route parameters cannot contain the `-` character. Use an underscore (`_`) instead. + +> **Note:** Route parameters cannot contain the `-` character. Use an underscore (`_`) instead. #### Optional Route Parameters From 920eeb46556817030e99f18f19c7fd5e789cde2b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 15 Apr 2015 15:05:42 -0500 Subject: [PATCH 208/276] Update docs to Cashier 5.0 --- billing.md | 1 + 1 file changed, 1 insertion(+) diff --git a/billing.md b/billing.md index a015cbbd164..1d34b72d06f 100644 --- a/billing.md +++ b/billing.md @@ -26,6 +26,7 @@ Laravel Cashier provides an expressive, fluent interface to [Stripe's](https://s First, add the Cashier package to your `composer.json` file: + "laravel/cashier": "~5.0" (For Stripe SDK ~2.0, and Stripe APIs on 2015-02-18 version and later) "laravel/cashier": "~4.0" (For Stripe APIs on 2015-02-18 version and later) "laravel/cashier": "~3.0" (For Stripe APIs up to and including 2015-02-16 version) From 1cecf1a560b9c502472ac10e26008a7ef90199f2 Mon Sep 17 00:00:00 2001 From: Justus Renton Date: Thu, 16 Apr 2015 22:21:22 -0500 Subject: [PATCH 209/276] Updating 4.1 upgrade links --- upgrade.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/upgrade.md b/upgrade.md index d28bce3fc4f..6ed7c61aee8 100644 --- a/upgrade.md +++ b/upgrade.md @@ -337,15 +337,15 @@ To upgrade your application to Laravel 4.1, change your `laravel/framework` vers ### Replacing Files -Replace your `public/index.php` file with [this fresh copy from the repository](https://github.com/laravel/laravel/blob/master/public/index.php). +Replace your `public/index.php` file with [this fresh copy from the repository](https://github.com/laravel/laravel/blob/v4.1.0/public/index.php). -Replace your `artisan` file with [this fresh copy from the repository](https://github.com/laravel/laravel/blob/master/artisan). +Replace your `artisan` file with [this fresh copy from the repository](https://github.com/laravel/laravel/blob/v4.1.0/artisan). ### Adding Configuration Files & Options -Update your `aliases` and `providers` arrays in your `app/config/app.php` configuration file. The updated values for these arrays can be found [in this file](https://github.com/laravel/laravel/blob/master/app/config/app.php). Be sure to add your custom and package service providers / aliases back to the arrays. +Update your `aliases` and `providers` arrays in your `app/config/app.php` configuration file. The updated values for these arrays can be found [in this file](https://github.com/laravel/laravel/blob/v4.1.0/app/config/app.php). Be sure to add your custom and package service providers / aliases back to the arrays. -Add the new `app/config/remote.php` file [from the repository](https://github.com/laravel/laravel/blob/master/app/config/remote.php). +Add the new `app/config/remote.php` file [from the repository](https://github.com/laravel/laravel/blob/v4.1.0/app/config/remote.php). Add the new `expire_on_close` configuration option to your `app/config/session.php` file. The default value should be `false`. @@ -365,7 +365,7 @@ If `app/controllers/BaseController.php` has a `use` statement at the top, change Password reminders have been overhauled for greater flexibility. You may examine the new stub controller by running the `php artisan auth:reminders-controller` Artisan command. You may also browse the [updated documentation](/docs/security#password-reminders-and-reset) and update your application accordingly. -Update your `app/lang/en/reminders.php` language file to match [this updated file](https://github.com/laravel/laravel/blob/master/app/lang/en/reminders.php). +Update your `app/lang/en/reminders.php` language file to match [this updated file](https://github.com/laravel/laravel/blob/v4.1.0/app/lang/en/reminders.php). ### Environment Detection Updates @@ -379,7 +379,7 @@ Laravel now generates a single log file: `app/storage/logs/laravel.log`. However In your `bootstrap/start.php` file, remove the call to `$app->redirectIfTrailingSlash()`. This method is no longer needed as this functionality is now handled by the `.htaccess` file included with the framework. -Next, replace your Apache `.htaccess` file with [this new one](https://github.com/laravel/laravel/blob/master/public/.htaccess) that handles trailing slashes. +Next, replace your Apache `.htaccess` file with [this new one](https://github.com/laravel/laravel/blob/v4.1.0/public/.htaccess) that handles trailing slashes. ### Current Route Access From b6954de882c177e8f36fadb10ff1924c39549e85 Mon Sep 17 00:00:00 2001 From: Clemo Date: Sat, 18 Apr 2015 17:09:53 +0200 Subject: [PATCH 210/276] add descending sortBy order info. --- eloquent.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eloquent.md b/eloquent.md index 05b3a08fd78..2a00211c349 100644 --- a/eloquent.md +++ b/eloquent.md @@ -1134,10 +1134,15 @@ When filtering collections, the callback provided will be used as callback for [ { return $role->created_at; }); + $roles = $roles->sortByDesc(function($role) + { + return $role->created_at; + }); #### Sorting A Collection By A Value $roles = $roles->sortBy('created_at'); + $roles = $roles->sortByDesc('created_at'); #### Returning A Custom Collection Type From 3ab1fa3bba47253ea237d6ed12b8de3735c33e00 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 18 Apr 2015 11:34:46 -0500 Subject: [PATCH 211/276] formatting --- eloquent.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eloquent.md b/eloquent.md index 2a00211c349..95552c8f041 100644 --- a/eloquent.md +++ b/eloquent.md @@ -1134,6 +1134,7 @@ When filtering collections, the callback provided will be used as callback for [ { return $role->created_at; }); + $roles = $roles->sortByDesc(function($role) { return $role->created_at; @@ -1142,6 +1143,7 @@ When filtering collections, the callback provided will be used as callback for [ #### Sorting A Collection By A Value $roles = $roles->sortBy('created_at'); + $roles = $roles->sortByDesc('created_at'); #### Returning A Custom Collection Type From bd059ff60f88b1d69863d15f5be50a3313f33e72 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Sun, 19 Apr 2015 03:41:34 +1000 Subject: [PATCH 212/276] Update commands.md --- commands.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands.md b/commands.md index 682932a0a29..8fa63117057 100644 --- a/commands.md +++ b/commands.md @@ -126,4 +126,10 @@ Sometimes you may wish to call other commands from your command. You may do so u #### Registering An Artisan Command -Once your command is finished, you need to register it with Artisan so it will be available for use. This is typically done in the `app/Console/Kernel.php` file. Within this file, you will find a list of commands in the `commands` property. To register your command, simply add it to this list. When Artisan boots, all the commands listed in this property will be resolved by the [service container](/docs/5.0/container) and registered with Artisan. +Once your command is finished, you need to register it with Artisan so it will be available for use. This is typically done in the `app/Console/Kernel.php` file. Within this file, you will find a list of commands in the `commands` property. To register your command, simply add it to this list. + + protected $commands = [ + 'App\Console\Commands\FooCommand' + ]; + +When Artisan boots, all the commands listed in this property will be resolved by the [service container](/docs/5.0/container) and registered with Artisan. From 4dc226576854f1557f35db95f9a8414a1186da93 Mon Sep 17 00:00:00 2001 From: An Phan Date: Mon, 20 Apr 2015 12:20:12 +0800 Subject: [PATCH 213/276] Added relative URL sample to queue:subscribe --- queues.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/queues.md b/queues.md index 1f0d0690682..2a1444a1f73 100644 --- a/queues.md +++ b/queues.md @@ -216,6 +216,8 @@ Push queues allow you to utilize the powerful Laravel 5 queue facilities without Next, you may use the `queue:subscribe` Artisan command to register a URL end-point that will receive newly pushed queue jobs: + php artisan queue:subscribe queue_name queue/receive + php artisan queue:subscribe queue_name http://foo.com/queue/receive Now, when you login to your Iron dashboard, you will see your new push queue, as well as the subscribed URL. You may subscribe as many URLs as you wish to a given queue. Next, create a route for your `queue/receive` end-point and return the response from the `Queue::marshal` method: From 31b7e9c6daeada555f0a22c30e010437de60020e Mon Sep 17 00:00:00 2001 From: And-re Date: Mon, 20 Apr 2015 12:44:15 +0200 Subject: [PATCH 214/276] add missing word in migrations.md --- migrations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations.md b/migrations.md index 5aebdfd2a67..49392d35c8e 100644 --- a/migrations.md +++ b/migrations.md @@ -37,7 +37,7 @@ The `--table` and `--create` options may also be used to indicate the name of th ### Forcing Migrations In Production -Some migration operations are destructive, meaning they may cause you to lose data. In order to protect you from running these commands against your production database, you will prompted for confirmation before these commands are executed. To force the commands to run without a prompt, use the `--force` flag: +Some migration operations are destructive, meaning they may cause you to lose data. In order to protect you from running these commands against your production database, you will be prompted for confirmation before these commands are executed. To force the commands to run without a prompt, use the `--force` flag: php artisan migrate --force From 43b610d95692575f996d7032fe7b613a1470a815 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 20 Apr 2015 15:23:17 +0200 Subject: [PATCH 215/276] Change email --- contributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributions.md b/contributions.md index 176d8f9498a..10967fe7e84 100644 --- a/contributions.md +++ b/contributions.md @@ -48,7 +48,7 @@ If you are unsure if your feature qualifies as a major or minor, please ask Tayl ## Security Vulnerabilities -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylorotwell@gmail.com. All security vulnerabilities will be promptly addressed. +If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. ## Coding Style From f91d453a6000143af3197d2b6d1cef55763ce45c Mon Sep 17 00:00:00 2001 From: dnixx Date: Tue, 21 Apr 2015 10:47:35 +0200 Subject: [PATCH 216/276] Fix example path --- commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands.md b/commands.md index 8fa63117057..ba4b511f2a3 100644 --- a/commands.md +++ b/commands.md @@ -20,7 +20,7 @@ To create a new command, you may use the `make:console` Artisan command, which w php artisan make:console FooCommand -The command above would generate a class at `app/Console/FooCommand.php`. +The command above would generate a class at `app/Console/Commands/FooCommand.php`. When creating the command, the `--command` option may be used to assign the terminal command name: From 64c981f98ca38d75ceafa63bcff62662e1aca272 Mon Sep 17 00:00:00 2001 From: Adam Engebretson Date: Tue, 21 Apr 2015 10:30:27 -0500 Subject: [PATCH 217/276] Adding guzzle requirement note --- artisan.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/artisan.md b/artisan.md index db086faa311..70d80125c71 100644 --- a/artisan.md +++ b/artisan.md @@ -170,3 +170,7 @@ In this example, the `foo` command will be run every minute if it is not already #### Ping A Given URL After The Job Runs $schedule->command('foo')->thenPing($url); + +Using the `thenPing($url)` feature require that the Guzzle 4 HTTP library be installed into your application. You can add Guzzle 4 to your project by adding the following line to your `composer.json` file: + + "guzzlehttp/guzzle": "~4.0" From 2d4bd5ba620181fc0f12ed60f4fee4505098f6de Mon Sep 17 00:00:00 2001 From: Adam Engebretson Date: Tue, 21 Apr 2015 10:37:41 -0500 Subject: [PATCH 218/276] Adding `config_path` to helpers.md --- helpers.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helpers.md b/helpers.md index 46b3c4f680b..a1b52d7fe0a 100644 --- a/helpers.md +++ b/helpers.md @@ -211,6 +211,10 @@ Get the fully qualified path to the `public` directory. Get the fully qualified path to the `storage` directory. +### config_path + +Get the fully qualitifed path to the `config` directory. + ## Routing From 0c04572b6060b2d8abfcf2e17f73692ba3f8b6e9 Mon Sep 17 00:00:00 2001 From: Adam Engebretson Date: Tue, 21 Apr 2015 12:55:19 -0500 Subject: [PATCH 219/276] Alphabetizing --- helpers.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helpers.md b/helpers.md index a1b52d7fe0a..73342da1174 100644 --- a/helpers.md +++ b/helpers.md @@ -203,6 +203,10 @@ Get the fully qualified path to the `app` directory. Get the fully qualified path to the root of the application install. +### config_path + +Get the fully qualitifed path to the `config` directory. + ### public_path Get the fully qualified path to the `public` directory. @@ -211,10 +215,6 @@ Get the fully qualified path to the `public` directory. Get the fully qualified path to the `storage` directory. -### config_path - -Get the fully qualitifed path to the `config` directory. - ## Routing From dcd788b6db0b97b8e0a49bdd3a5bb5516800c4a1 Mon Sep 17 00:00:00 2001 From: Adam Engebretson Date: Tue, 21 Apr 2015 12:58:26 -0500 Subject: [PATCH 220/276] Using 4 or 5 --- artisan.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/artisan.md b/artisan.md index 70d80125c71..532dfc58f63 100644 --- a/artisan.md +++ b/artisan.md @@ -171,6 +171,8 @@ In this example, the `foo` command will be run every minute if it is not already $schedule->command('foo')->thenPing($url); -Using the `thenPing($url)` feature require that the Guzzle 4 HTTP library be installed into your application. You can add Guzzle 4 to your project by adding the following line to your `composer.json` file: +Using the `thenPing($url)` feature require that the Guzzle 4 or 5 HTTP library be installed into your application. You can add Guzzle 4 or 5 to your project by adding the following line to your `composer.json` file: "guzzlehttp/guzzle": "~4.0" + // or + "guzzlehttp/guzzle": "~5.0" From ed5d14205e1944ddddc106806ecbefa5256f5b39 Mon Sep 17 00:00:00 2001 From: Adam Engebretson Date: Tue, 21 Apr 2015 16:23:34 -0500 Subject: [PATCH 221/276] Using 5 --- artisan.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/artisan.md b/artisan.md index 532dfc58f63..28b5e7747ae 100644 --- a/artisan.md +++ b/artisan.md @@ -171,8 +171,6 @@ In this example, the `foo` command will be run every minute if it is not already $schedule->command('foo')->thenPing($url); -Using the `thenPing($url)` feature require that the Guzzle 4 or 5 HTTP library be installed into your application. You can add Guzzle 4 or 5 to your project by adding the following line to your `composer.json` file: +Using the `thenPing($url)` feature require that the Guzzle 5 HTTP library be installed into your application. You can add Guzzle 5 to your project by adding the following line to your `composer.json` file: - "guzzlehttp/guzzle": "~4.0" - // or "guzzlehttp/guzzle": "~5.0" From 7b889138de1a4fec8bd2dae8ccea5f92c7fe4331 Mon Sep 17 00:00:00 2001 From: Adam Engebretson Date: Tue, 21 Apr 2015 16:24:01 -0500 Subject: [PATCH 222/276] Using Guzzle 5 for mail requirement --- mail.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mail.md b/mail.md index 2e159f64a34..cd327097b00 100644 --- a/mail.md +++ b/mail.md @@ -13,9 +13,9 @@ Laravel provides a clean, simple API over the popular [SwiftMailer](http://swift ### API Drivers -Laravel also includes drivers for the Mailgun and Mandrill HTTP APIs. These APIs are often simpler and quicker than the SMTP servers. Both of these drivers require that the Guzzle 4 HTTP library be installed into your application. You can add Guzzle 4 to your project by adding the following line to your `composer.json` file: +Laravel also includes drivers for the Mailgun and Mandrill HTTP APIs. These APIs are often simpler and quicker than the SMTP servers. Both of these drivers require that the Guzzle 5 HTTP library be installed into your application. You can add Guzzle 5 to your project by adding the following line to your `composer.json` file: - "guzzlehttp/guzzle": "~4.0" + "guzzlehttp/guzzle": "~5.0" #### Mailgun Driver From 5a2d6f454124bfb73d24adac6b6ea0fc9cb785ae Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 21 Apr 2015 17:10:25 -0500 Subject: [PATCH 223/276] Fix typo. --- artisan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artisan.md b/artisan.md index 28b5e7747ae..0e106e64373 100644 --- a/artisan.md +++ b/artisan.md @@ -171,6 +171,6 @@ In this example, the `foo` command will be run every minute if it is not already $schedule->command('foo')->thenPing($url); -Using the `thenPing($url)` feature require that the Guzzle 5 HTTP library be installed into your application. You can add Guzzle 5 to your project by adding the following line to your `composer.json` file: +Using the `thenPing($url)` feature requires the Guzzle HTTP library. You can add Guzzle 5 to your project by adding the following line to your `composer.json` file: "guzzlehttp/guzzle": "~5.0" From 48eecaca99e5938ee9a37abb97755ac45c6efc79 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 23 Apr 2015 09:33:30 -0500 Subject: [PATCH 224/276] Update Homestead docs for simplicity. --- homestead.md | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/homestead.md b/homestead.md index c29ad863e7b..c5cb27ff4db 100644 --- a/homestead.md +++ b/homestead.md @@ -34,7 +34,6 @@ Homestead is currently built and tested using Vagrant 1.7. - Memcached - Beanstalkd - [Laravel Envoy](/docs/5.0/envoy) -- Fabric + HipChat Extension - [Blackfire Profiler](#blackfire-profiler) @@ -60,9 +59,7 @@ If this command fails, you may have an old version of Vagrant that requires the ### Installing Homestead -#### Option 1 - Manually Via Git (No Local PHP) - -If you do not want to install PHP on your local machine, you may install Homestead manually by simply cloning the repository. Consider cloning the repository into a `Homestead` folder within your "home" directory, as the Homestead box will serve as the host to all of your Laravel (and PHP) projects: +You may install Homestead manually by simply cloning the repository. Consider cloning the repository into a `Homestead` folder within your "home" directory, as the Homestead box will serve as the host to all of your Laravel (and PHP) projects: git clone https://github.com/laravel/homestead.git Homestead @@ -72,24 +69,6 @@ Once you have installed the Homestead CLI tool, run the `bash init.sh` command t The `Homestead.yaml` file will be placed in your `~/.homestead` directory. -#### Option 2 - With Composer + PHP Tool - -Once the box has been added to your Vagrant installation, you are ready to install the Homestead CLI tool using the Composer `global` command: - - composer global require "laravel/homestead=~2.0" - -Make sure to place the `~/.composer/vendor/bin` directory in your PATH so the `homestead` executable is found when you run the `homestead` command in your terminal. - - PATH=~/.composer/vendor/bin:$PATH - -Once you have installed the Homestead CLI tool, run the `init` command to create the `Homestead.yaml` configuration file: - - homestead init - -The `Homestead.yaml` file will be placed in the `~/.homestead` directory. If you're using a Mac or Linux system, you may edit `Homestead.yaml` file by running the `homestead edit` command in your terminal: - - homestead edit - ### Configure Your Provider The `provider` key in your `Homestead.yaml` file indicates which Vagrant provider should be used: `virtualbox` or `vmware_fusion`. You may set this to whichever provider you prefer. @@ -138,7 +117,7 @@ To add Bash aliases to your Homestead box, simply add to the `aliases` file in t ### Launch The Vagrant Box -Once you have edited the `Homestead.yaml` to your liking, run the `homestead up` command from your Homestead directory. +Once you have edited the `Homestead.yaml` to your liking, run the `vagrant up` command from your Homestead directory. Vagrant will boot the virtual machine, and configure your shared folders and Nginx sites automatically! To destroy the machine, you may use the `vagrant destroy --force` command. @@ -157,14 +136,14 @@ To learn how to connect to your databases, read on! ### Connecting Via SSH -To connect to your Homestead environment via SSH, issue the `vagrant ssh` command from your Homestead directory. - -Since you will probably need to SSH into your Homestead machine frequently, consider creating an "alias" on your host machine: +Since you will probably need to SSH into your Homestead machine frequently, consider creating an "alias" on your host machine to quickly SSH into the Homestead box: alias vm="ssh vagrant@127.0.0.1 -p 2222" Once you create this alias, you can simply use the "vm" command to SSH into your Homestead machine from anywhere on your system. +Alternatively, you can use the `vagrant ssh` command from your Homestead directory. + ### Connecting To Your Databases A `homestead` database is configured for both MySQL and Postgres out of the box. For even more convenience, Laravel's `local` database configuration is set to use this database by default. @@ -175,7 +154,7 @@ To connect to your MySQL or Postgres database from your main machine via Navicat ### Adding Additional Sites -Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. There are two ways to do this: First, you may simply add the sites to your `Homestead.yaml` file and then run `homestead provision` or `vagrant provision`. +Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. There are two ways to do this: First, you may simply add the sites to your `Homestead.yaml` file and then run `vagrant provision` from your Homestead directory. > **Note:** This process is destructive. When running the `provision` command, your existing databases will be destroyed and recreated. @@ -220,4 +199,4 @@ All of the proper packages have already been installed on your Homestead box, yo client-id: your-client-id client-token: your-client-token -Once you have configured your Blackfire credentials, re-provision the box using `homestead provision` or `vagrant provision`. Of course, be sure to review the [Blackfire documentation](https://blackfire.io/getting-started) to learn how to install the Blackfire companion extension for your web browser. +Once you have configured your Blackfire credentials, re-provision the box using `vagrant provision` from your Homestead directory. Of course, be sure to review the [Blackfire documentation](https://blackfire.io/getting-started) to learn how to install the Blackfire companion extension for your web browser. From 0285f33bb2f2687d6ecad504d906150e3fe223d6 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 23 Apr 2015 09:46:39 -0500 Subject: [PATCH 225/276] Add note on encryption of cookies. --- session.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/session.md b/session.md index 6635409c3a5..7b08eac51bf 100644 --- a/session.md +++ b/session.md @@ -17,6 +17,8 @@ Before using Redis sessions with Laravel, you will need to install the `predis/p > **Note:** If you need all stored session data to be encrypted, set the `encrypt` configuration option to `true`. +> **Note:** When using the `cookie` session driver, you should **never** remove the `EncryptCookie` middleware from your HTTP kernel. If you remove this middleware, your application will be vulnerable to remote code injection. + #### Reserved Keys The Laravel framework uses the `flash` session key internally, so you should not add an item to the session by that name. From b08487b049eab2286efa4a6cc5bf8317a4741216 Mon Sep 17 00:00:00 2001 From: Dimitris Savvopoulos Date: Thu, 23 Apr 2015 19:50:00 +0200 Subject: [PATCH 226/276] Plural --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index 9eef8ae52ff..047cf010b5d 100644 --- a/routing.md +++ b/routing.md @@ -229,7 +229,7 @@ Shared attributes are specified in an array format as the first parameter to the ### Middleware -Middleware is applied to all routes within the group by defining the list of middleware with the `middleware` parameter on the group attribute array. Middleware will be executed in the order you define this array: +Middleware are applied to all routes within the group by defining the list of middleware with the `middleware` parameter on the group attribute array. Middleware will be executed in the order you define this array: Route::group(['middleware' => 'foo|bar'], function() { From c0f38bb5599dced527ff3daf589507a5064343dd Mon Sep 17 00:00:00 2001 From: Benoth Date: Fri, 24 Apr 2015 10:56:33 +0200 Subject: [PATCH 227/276] Missing Closure Declaration of StartSession::handle() must be compatible with Illuminate\Contracts\Routing\Middleware::handle($request, Closure $next) --- middleware.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/middleware.md b/middleware.md index b9e9b345e9f..362e1c34137 100644 --- a/middleware.md +++ b/middleware.md @@ -105,11 +105,12 @@ Once the middleware has been defined in the HTTP kernel, you may use the `middle Sometimes a middleware may need to do some work after the HTTP response has already been sent to the browser. For example, the "session" middleware included with Laravel writes the session data to storage _after_ the response has been sent to the browser. To accomplish this, you may define the middleware as "terminable". + use Closure; use Illuminate\Contracts\Routing\TerminableMiddleware; class StartSession implements TerminableMiddleware { - public function handle($request, $next) + public function handle($request, Closure $next) { return $next($request); } From 888347f46c4ea32bd9a3ffe218d46aa6fda83a7f Mon Sep 17 00:00:00 2001 From: Eric Nikolay Katz Date: Fri, 24 Apr 2015 16:45:25 -0400 Subject: [PATCH 228/276] remove reference to homestead cli in docs 5.0 branch --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index c5cb27ff4db..c1e121e8639 100644 --- a/homestead.md +++ b/homestead.md @@ -63,7 +63,7 @@ You may install Homestead manually by simply cloning the repository. Consider cl git clone https://github.com/laravel/homestead.git Homestead -Once you have installed the Homestead CLI tool, run the `bash init.sh` command to create the `Homestead.yaml` configuration file: +Once you have cloned the Homestead repository, run the `bash init.sh` command from the Homestead directory to create the `Homestead.yaml` configuration file: bash init.sh From a4c8887c98ecb9a96e9b9cf363e0853b87a94078 Mon Sep 17 00:00:00 2001 From: shin1x1 Date: Sun, 26 Apr 2015 23:13:22 +0900 Subject: [PATCH 229/276] Update cache.md because file support increment and decrement --- cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache.md b/cache.md index 8e6e3289a03..682efae904d 100644 --- a/cache.md +++ b/cache.md @@ -93,7 +93,7 @@ When using multiple cache stores, you may access them via the `store` method: ## Increments & Decrements -All drivers except `file` and `database` support the `increment` and `decrement` operations: +All drivers except `database` support the `increment` and `decrement` operations: #### Incrementing A Value From bbf4092494f4f26bb6be57e12059cf921bbd89ab Mon Sep 17 00:00:00 2001 From: Lukas Geiter Date: Mon, 27 Apr 2015 22:01:44 +0200 Subject: [PATCH 230/276] Fix multiple middleware code example --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index 047cf010b5d..6e4d86c46cc 100644 --- a/routing.md +++ b/routing.md @@ -231,7 +231,7 @@ Shared attributes are specified in an array format as the first parameter to the Middleware are applied to all routes within the group by defining the list of middleware with the `middleware` parameter on the group attribute array. Middleware will be executed in the order you define this array: - Route::group(['middleware' => 'foo|bar'], function() + Route::group(['middleware' => ['foo', 'bar']], function() { Route::get('/', function() { From 660b98e78f54b3d64a082272bd7289649ff5dcd9 Mon Sep 17 00:00:00 2001 From: Leon Bienek Date: Thu, 30 Apr 2015 22:11:31 +0100 Subject: [PATCH 231/276] Adding docs for the recent tax work --- billing.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/billing.md b/billing.md index 1d34b72d06f..d6db137b6bd 100644 --- a/billing.md +++ b/billing.md @@ -7,6 +7,7 @@ - [No Card Up Front](#no-card-up-front) - [Swapping Subscriptions](#swapping-subscriptions) - [Subscription Quantity](#subscription-quantity) +- [Subscription Tax](#subscription-tax) - [Cancelling A Subscription](#cancelling-a-subscription) - [Resuming A Subscription](#resuming-a-subscription) - [Checking Subscription Status](#checking-subscription-status) @@ -163,6 +164,18 @@ Sometimes subscriptions are affected by "quantity". For example, your applicatio // Subtract five to the subscription's current quantity... $user->subscription()->decrement(5); + +## Subscription Tax + +To specify the percentage tax a user pays on a subscription, simply implement the `getTaxPercent` method on your model, and return an integer between 0 and 100. + + public function getTaxPercent() + { + return 20; + } + +This enables you to apply a tax rate on a model-by-model basis, which may be helpful for a userbase that spans multiple countries. + ## Cancelling A Subscription From e280428d2b13fa4621456712d82863518c36f201 Mon Sep 17 00:00:00 2001 From: Leon Bienek Date: Thu, 30 Apr 2015 22:16:29 +0100 Subject: [PATCH 232/276] Wording tweaks --- billing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/billing.md b/billing.md index d6db137b6bd..1690e8aaef3 100644 --- a/billing.md +++ b/billing.md @@ -167,7 +167,7 @@ Sometimes subscriptions are affected by "quantity". For example, your applicatio ## Subscription Tax -To specify the percentage tax a user pays on a subscription, simply implement the `getTaxPercent` method on your model, and return an integer between 0 and 100. +With Cashier, it's easy to override the `tax_percent` value sent to Stripe. To specify the percentage tax a user pays on a subscription, simply implement the `getTaxPercent` method on your model, and return an numeric value between 0 and 100, with no more than 2 decimal places. public function getTaxPercent() { From d3a1698b90a399f0f7fb7de359d3e624067e1d71 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 30 Apr 2015 20:25:12 -0500 Subject: [PATCH 233/276] Fixes. --- billing.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/billing.md b/billing.md index 1690e8aaef3..5fbafa3772a 100644 --- a/billing.md +++ b/billing.md @@ -167,14 +167,14 @@ Sometimes subscriptions are affected by "quantity". For example, your applicatio ## Subscription Tax -With Cashier, it's easy to override the `tax_percent` value sent to Stripe. To specify the percentage tax a user pays on a subscription, simply implement the `getTaxPercent` method on your model, and return an numeric value between 0 and 100, with no more than 2 decimal places. +With Cashier, it's easy to override the `tax_percent` value sent to Stripe. To specify the tax percentage a user pays on a subscription. Implement the `getTaxPercent` method on your model, and return a numeric value between 0 and 100, with no more than 2 decimal places. public function getTaxPercent() { return 20; } - -This enables you to apply a tax rate on a model-by-model basis, which may be helpful for a userbase that spans multiple countries. + +This enables you to apply a tax rate on a model-by-model basis, which may be helpful for a user base that spans multiple countries. ## Cancelling A Subscription From 87f8d1778bccd145519b6e5fd4c971c90300dd17 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 1 May 2015 07:39:20 -0500 Subject: [PATCH 234/276] Fix grammar. --- billing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/billing.md b/billing.md index 5fbafa3772a..8475bc89a2c 100644 --- a/billing.md +++ b/billing.md @@ -167,7 +167,7 @@ Sometimes subscriptions are affected by "quantity". For example, your applicatio ## Subscription Tax -With Cashier, it's easy to override the `tax_percent` value sent to Stripe. To specify the tax percentage a user pays on a subscription. Implement the `getTaxPercent` method on your model, and return a numeric value between 0 and 100, with no more than 2 decimal places. +With Cashier, it's easy to override the `tax_percent` value sent to Stripe. To specify the tax percentage a user pays on a subscription, implement the `getTaxPercent` method on your model, and return a numeric value between 0 and 100, with no more than 2 decimal places. public function getTaxPercent() { From 95f9380c1e0ab62118ccaa49d2bc43a80b0b13c8 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 1 May 2015 07:47:39 -0500 Subject: [PATCH 235/276] use placeholder for version --- artisan.md | 2 +- authentication.md | 12 +++--- billing.md | 2 +- bus.md | 6 +-- collections.md | 2 +- commands.md | 4 +- configuration.md | 8 ++-- container.md | 4 +- contracts.md | 4 +- controllers.md | 8 ++-- documentation.md | 98 +++++++++++++++++++++++------------------------ eloquent.md | 2 +- events.md | 4 +- facades.md | 82 +++++++++++++++++++-------------------- filesystem.md | 2 +- homestead.md | 2 +- installation.md | 4 +- lifecycle.md | 4 +- localization.md | 2 +- mail.md | 2 +- migrations.md | 2 +- packages.md | 2 +- pagination.md | 2 +- providers.md | 6 +-- queues.md | 4 +- redis.md | 2 +- releases.md | 24 ++++++------ requests.md | 4 +- responses.md | 10 ++--- routing.md | 6 +-- session.md | 2 +- testing.md | 2 +- upgrade.md | 16 ++++---- views.md | 6 +-- 34 files changed, 171 insertions(+), 171 deletions(-) diff --git a/artisan.md b/artisan.md index 0e106e64373..8477bd86a87 100644 --- a/artisan.md +++ b/artisan.md @@ -49,7 +49,7 @@ Sometimes you may wish to execute an Artisan command outside of the CLI. For exa // }); -You may even queue Artisan commands so they are processed in the background by your [queue workers](/docs/5.0/queues): +You may even queue Artisan commands so they are processed in the background by your [queue workers](/docs/{{version}}/queues): Route::get('/foo', function() { diff --git a/authentication.md b/authentication.md index c87a55b9899..f16eb1f3906 100644 --- a/authentication.md +++ b/authentication.md @@ -58,7 +58,7 @@ If you choose not to use the provided `AuthController` implementation, you will } -The `attempt` method accepts an array of key / value pairs as its first argument. The `password` value will be [hashed](/docs/5.0/hashing). The other values in the array will be used to find the user in your database table. So, in the example above, the user will be retrieved by the value of the `email` column. If the user is found, the hashed password stored in the database will be compared with the hashed `password` value passed to the method via the array. If the two hashed passwords match, a new authenticated session will be started for the user. +The `attempt` method accepts an array of key / value pairs as its first argument. The `password` value will be [hashed](/docs/{{version}}/hashing). The other values in the array will be used to find the user in your database table. So, in the example above, the user will be retrieved by the value of the `email` column. If the user is found, the hashed password stored in the database will be compared with the hashed `password` value passed to the method via the array. If the two hashed passwords match, a new authenticated session will be started for the user. The `attempt` method will return `true` if authentication was successful. Otherwise, `false` will be returned. @@ -140,7 +140,7 @@ Of course, if you are using the built-in Laravel authentication controllers, a c #### Authentication Events -When the `attempt` method is called, the `auth.attempt` [event](/docs/5.0/events) will be fired. If the authentication attempt is successful and the user is logged in, the `auth.login` event will be fired as well. +When the `attempt` method is called, the `auth.attempt` [event](/docs/{{version}}/events) will be fired. If the authentication attempt is successful and the user is logged in, the `auth.login` event will be fired as well. ## Retrieving The Authenticated User @@ -194,7 +194,7 @@ Second, you may access the authenticated user via an `Illuminate\Http\Request` i } -Thirdly, you may type-hint the `Illuminate\Contracts\Auth\Authenticatable` contract. This type-hint may be added to a controller constructor, controller method, or any other constructor of a class resolved by the [service container](/docs/5.0/container): +Thirdly, you may type-hint the `Illuminate\Contracts\Auth\Authenticatable` contract. This type-hint may be added to a controller constructor, controller method, or any other constructor of a class resolved by the [service container](/docs/{{version}}/container): ## Protecting Routes -[Route middleware](/docs/5.0/middleware) can be used to allow only authenticated users to access a given route. Laravel provides the `auth` middleware by default, and it is defined in `app\Http\Middleware\Authenticate.php`. All you need to do is attach it to a route definition: +[Route middleware](/docs/{{version}}/middleware) can be used to allow only authenticated users to access a given route. Laravel provides the `auth` middleware by default, and it is defined in `app\Http\Middleware\Authenticate.php`. All you need to do is attach it to a route definition: // With A Route Closure... @@ -247,7 +247,7 @@ By default, the `basic` middleware will use the `email` column on the user recor #### Setting Up A Stateless HTTP Basic Filter -You may also use HTTP Basic Authentication without setting a user identifier cookie in the session, which is particularly useful for API authentication. To do so, [define a middleware](/docs/5.0/middleware) that calls the `onceBasic` method: +You may also use HTTP Basic Authentication without setting a user identifier cookie in the session, which is particularly useful for API authentication. To do so, [define a middleware](/docs/{{version}}/middleware) that calls the `onceBasic` method: public function handle($request, Closure $next) { @@ -293,7 +293,7 @@ To get started with Socialite, include the package in your `composer.json` file: "laravel/socialite": "~2.0" -Next, register the `Laravel\Socialite\SocialiteServiceProvider` in your `config/app.php` configuration file. You may also register a [facade](/docs/5.0/facades): +Next, register the `Laravel\Socialite\SocialiteServiceProvider` in your `config/app.php` configuration file. You may also register a [facade](/docs/{{version}}/facades): 'Socialize' => 'Laravel\Socialite\Facades\Socialite', diff --git a/billing.md b/billing.md index 8475bc89a2c..dc195850f9d 100644 --- a/billing.md +++ b/billing.md @@ -204,7 +204,7 @@ To verify that a user is subscribed to your application, use the `subscribed` me // } -The `subscribed` method makes a great candidate for a [route middleware](/docs/5.0/middleware): +The `subscribed` method makes a great candidate for a [route middleware](/docs/{{version}}/middleware): public function handle($request, Closure $next) { diff --git a/bus.md b/bus.md index 25d002c998a..78b2367dbfe 100644 --- a/bus.md +++ b/bus.md @@ -55,7 +55,7 @@ The newly generated class will be placed in the `app/Commands` directory. By def } -The `handle` method may also type-hint dependencies, and they will be automatically injected by the [service container](/docs/5.0/container). For example: +The `handle` method may also type-hint dependencies, and they will be automatically injected by the [service container](/docs/{{version}}/container). For example: /** * Execute the command. @@ -116,7 +116,7 @@ If you would like to convert an existing command into a queued command, simply i Then, just write your command normally. When you dispatch it to the bus that bus will automatically queue the command for background processing. It doesn't get any easier than that. -For more information on interacting with queued commands, view the full [queue documentation](/docs/5.0/queues). +For more information on interacting with queued commands, view the full [queue documentation](/docs/{{version}}/queues). ## Command Pipeline @@ -141,7 +141,7 @@ A command pipe is defined with a `handle` method, just like a middleware: } -Command pipe classes are resolved through the [IoC container](/docs/5.0/container), so feel free to type-hint any dependencies you need within their constructors. +Command pipe classes are resolved through the [IoC container](/docs/{{version}}/container), so feel free to type-hint any dependencies you need within their constructors. You may even define a `Closure` as a command pipe: diff --git a/collections.md b/collections.md index a006a157897..12d861eb261 100644 --- a/collections.md +++ b/collections.md @@ -31,7 +31,7 @@ As mentioned above, the `collect` helper will return a new `Illuminate\Support\C $collection = Collection::make([1, 2, 3]); -Of course, collections of [Eloquent](/docs/5.0/eloquent) objects are always returned as `Collection` instances; however, you should feel free to use the `Collection` class wherever it is convenient for your application. +Of course, collections of [Eloquent](/docs/{{version}}/eloquent) objects are always returned as `Collection` instances; however, you should feel free to use the `Collection` class wherever it is convenient for your application. #### Explore The Collection diff --git a/commands.md b/commands.md index ba4b511f2a3..ee077afb7e5 100644 --- a/commands.md +++ b/commands.md @@ -51,7 +51,7 @@ For options, the argument `mode` may be: `InputOption::VALUE_REQUIRED`, `InputOp The `VALUE_IS_ARRAY` mode indicates that the switch may be used multiple times when calling the command: InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY - + Would then allow for this command: php artisan foo --option=bar --option=baz @@ -132,4 +132,4 @@ Once your command is finished, you need to register it with Artisan so it will b 'App\Console\Commands\FooCommand' ]; -When Artisan boots, all the commands listed in this property will be resolved by the [service container](/docs/5.0/container) and registered with Artisan. +When Artisan boots, all the commands listed in this property will be resolved by the [service container](/docs/{{version}}/container) and registered with Artisan. diff --git a/configuration.md b/configuration.md index 68e409cac71..7d190b67b54 100644 --- a/configuration.md +++ b/configuration.md @@ -30,7 +30,7 @@ Renaming your application is entirely optional, and you are free to keep the `Ap Laravel needs very little configuration out of the box. You are free to get started developing! However, you may wish to review the `config/app.php` file and its documentation. It contains several options such as `timezone` and `locale` that you may wish to change according to your location. -Once Laravel is installed, you should also [configure your local environment](/docs/5.0/configuration#environment-configuration). +Once Laravel is installed, you should also [configure your local environment](/docs/{{version}}/configuration#environment-configuration). > **Note:** You should never have the `app.debug` configuration option set to `true` for a production application. @@ -83,7 +83,7 @@ You may also pass arguments to the `environment` method to check if the environm // The environment is either local OR staging... } -To obtain an instance of the application, resolve the `Illuminate\Contracts\Foundation\Application` contract via the [service container](/docs/5.0/container). Of course, if you are within a [service provider](/docs/5.0/providers), the application instance is available via the `$this->app` instance variable. +To obtain an instance of the application, resolve the `Illuminate\Contracts\Foundation\Application` contract via the [service container](/docs/{{version}}/container). Of course, if you are within a [service provider](/docs/{{version}}/providers), the application instance is available via the `$this->app` instance variable. An application instance may also be accessed via the `app` helper or the `App` facade: @@ -117,7 +117,7 @@ The default template for maintenance mode responses is located in `resources/vie ### Maintenance Mode & Queues -While your application is in maintenance mode, no [queued jobs](/docs/5.0/queues) will be handled. The jobs will continue to be handled as normal once the application is out of maintenance mode. +While your application is in maintenance mode, no [queued jobs](/docs/{{version}}/queues) will be handled. The jobs will continue to be handled as normal once the application is out of maintenance mode. ## Pretty URLs @@ -145,4 +145,4 @@ On Nginx, the following directive in your site configuration will allow "pretty" try_files $uri $uri/ /index.php?$query_string; } -Of course, when using [Homestead](/docs/5.0/homestead), pretty URLs will be configured automatically. +Of course, when using [Homestead](/docs/{{version}}/homestead), pretty URLs will be configured automatically. diff --git a/container.md b/container.md index af6f8b5eab5..74c250304b9 100644 --- a/container.md +++ b/container.md @@ -61,7 +61,7 @@ A deep understanding of the Laravel service container is essential to building a ### Binding -Almost all of your service container bindings will be registered within [service providers](/docs/5.0/providers), so all of these examples will demonstrate using the container in that context. However, if you need an instance of the container elsewhere in your application, such as a factory, you may type-hint the `Illuminate\Contracts\Container\Container` contract and an instance of the container will be injected for you. Alternatively, you may use the `App` facade to access the container. +Almost all of your service container bindings will be registered within [service providers](/docs/{{version}}/providers), so all of these examples will demonstrate using the container in that context. However, if you need an instance of the container elsewhere in your application, such as a factory, you may type-hint the `Illuminate\Contracts\Container\Container` contract and an instance of the container will be injected for you. Alternatively, you may use the `App` facade to access the container. #### Registering A Basic Resolver @@ -295,7 +295,7 @@ Laravel provides several opportunities to use the service container to increase } -In this example, the `OrderRepository` class will automatically be injected into the controller. This means that a "mock" `OrderRepository` may be bound into the container when [unit testing](/docs/5.0/testing), allowing for painless stubbing of database layer interaction. +In this example, the `OrderRepository` class will automatically be injected into the controller. This means that a "mock" `OrderRepository` may be bound into the container when [unit testing](/docs/{{version}}/testing), allowing for painless stubbing of database layer interaction. #### Other Examples Of Container Usage diff --git a/contracts.md b/contracts.md index 4a7417950f3..463629a8568 100644 --- a/contracts.md +++ b/contracts.md @@ -137,7 +137,7 @@ Contract | Laravel 4.x Facade ## How To Use Contracts -So, how do you get an implementation of a contract? It's actually quite simple. Many types of classes in Laravel are resolved through the [service container](/docs/5.0/container), including controllers, event listeners, filters, queue jobs, and even route Closures. So, to get an implementation of a contract, you can just "type-hint" the interface in the constructor of the class being resolved. For example, take a look at this event handler: +So, how do you get an implementation of a contract? It's actually quite simple. Many types of classes in Laravel are resolved through the [service container](/docs/{{version}}/container), including controllers, event listeners, filters, queue jobs, and even route Closures. So, to get an implementation of a contract, you can just "type-hint" the interface in the constructor of the class being resolved. For example, take a look at this event handler: ## Controller Middleware -[Middleware](/docs/5.0/middleware) may be specified on controller routes like so: +[Middleware](/docs/{{version}}/middleware) may be specified on controller routes like so: Route::get('profile', [ 'middleware' => 'auth', @@ -220,7 +220,7 @@ If it becomes necessary to add additional routes to a resource controller beyond #### Constructor Injection -The Laravel [service container](/docs/5.0/container) is used to resolve all Laravel controllers. As a result, you are able to type-hint any dependencies your controller may need in its constructor: +The Laravel [service container](/docs/{{version}}/container) is used to resolve all Laravel controllers. As a result, you are able to type-hint any dependencies your controller may need in its constructor: **Note:** Method injection is fully compatible with [model binding](/docs/5.0/routing#route-model-binding). The container will intelligently determine which arguments are model bound and which arguments should be injected. +> **Note:** Method injection is fully compatible with [model binding](/docs/{{version}}/routing#route-model-binding). The container will intelligently determine which arguments are model bound and which arguments should be injected. ## Route Caching diff --git a/documentation.md b/documentation.md index a90303945ec..37d9d28f7ee 100644 --- a/documentation.md +++ b/documentation.md @@ -1,56 +1,56 @@ - Prologue - - [Release Notes](/docs/5.0/releases) - - [Upgrade Guide](/docs/5.0/upgrade) - - [Contribution Guide](/docs/5.0/contributions) + - [Release Notes](/docs/{{version}}/releases) + - [Upgrade Guide](/docs/{{version}}/upgrade) + - [Contribution Guide](/docs/{{version}}/contributions) - Setup - - [Installation](/docs/5.0/installation) - - [Configuration](/docs/5.0/configuration) - - [Homestead](/docs/5.0/homestead) + - [Installation](/docs/{{version}}/installation) + - [Configuration](/docs/{{version}}/configuration) + - [Homestead](/docs/{{version}}/homestead) - The Basics - - [Routing](/docs/5.0/routing) - - [Middleware](/docs/5.0/middleware) - - [Controllers](/docs/5.0/controllers) - - [Requests](/docs/5.0/requests) - - [Responses](/docs/5.0/responses) - - [Views](/docs/5.0/views) + - [Routing](/docs/{{version}}/routing) + - [Middleware](/docs/{{version}}/middleware) + - [Controllers](/docs/{{version}}/controllers) + - [Requests](/docs/{{version}}/requests) + - [Responses](/docs/{{version}}/responses) + - [Views](/docs/{{version}}/views) - Architecture Foundations - - [Service Providers](/docs/5.0/providers) - - [Service Container](/docs/5.0/container) - - [Contracts](/docs/5.0/contracts) - - [Facades](/docs/5.0/facades) - - [Request Lifecycle](/docs/5.0/lifecycle) - - [Application Structure](/docs/5.0/structure) + - [Service Providers](/docs/{{version}}/providers) + - [Service Container](/docs/{{version}}/container) + - [Contracts](/docs/{{version}}/contracts) + - [Facades](/docs/{{version}}/facades) + - [Request Lifecycle](/docs/{{version}}/lifecycle) + - [Application Structure](/docs/{{version}}/structure) - Services - - [Authentication](/docs/5.0/authentication) - - [Billing](/docs/5.0/billing) - - [Cache](/docs/5.0/cache) - - [Collections](/docs/5.0/collections) - - [Command Bus](/docs/5.0/bus) - - [Core Extension](/docs/5.0/extending) - - [Elixir](/docs/5.0/elixir) - - [Encryption](/docs/5.0/encryption) - - [Envoy](/docs/5.0/envoy) - - [Errors & Logging](/docs/5.0/errors) - - [Events](/docs/5.0/events) - - [Filesystem / Cloud Storage](/docs/5.0/filesystem) - - [Hashing](/docs/5.0/hashing) - - [Helpers](/docs/5.0/helpers) - - [Localization](/docs/5.0/localization) - - [Mail](/docs/5.0/mail) - - [Package Development](/docs/5.0/packages) - - [Pagination](/docs/5.0/pagination) - - [Queues](/docs/5.0/queues) - - [Session](/docs/5.0/session) - - [Templates](/docs/5.0/templates) - - [Unit Testing](/docs/5.0/testing) - - [Validation](/docs/5.0/validation) + - [Authentication](/docs/{{version}}/authentication) + - [Billing](/docs/{{version}}/billing) + - [Cache](/docs/{{version}}/cache) + - [Collections](/docs/{{version}}/collections) + - [Command Bus](/docs/{{version}}/bus) + - [Core Extension](/docs/{{version}}/extending) + - [Elixir](/docs/{{version}}/elixir) + - [Encryption](/docs/{{version}}/encryption) + - [Envoy](/docs/{{version}}/envoy) + - [Errors & Logging](/docs/{{version}}/errors) + - [Events](/docs/{{version}}/events) + - [Filesystem / Cloud Storage](/docs/{{version}}/filesystem) + - [Hashing](/docs/{{version}}/hashing) + - [Helpers](/docs/{{version}}/helpers) + - [Localization](/docs/{{version}}/localization) + - [Mail](/docs/{{version}}/mail) + - [Package Development](/docs/{{version}}/packages) + - [Pagination](/docs/{{version}}/pagination) + - [Queues](/docs/{{version}}/queues) + - [Session](/docs/{{version}}/session) + - [Templates](/docs/{{version}}/templates) + - [Unit Testing](/docs/{{version}}/testing) + - [Validation](/docs/{{version}}/validation) - Database - - [Basic Usage](/docs/5.0/database) - - [Query Builder](/docs/5.0/queries) - - [Eloquent ORM](/docs/5.0/eloquent) - - [Schema Builder](/docs/5.0/schema) - - [Migrations & Seeding](/docs/5.0/migrations) - - [Redis](/docs/5.0/redis) + - [Basic Usage](/docs/{{version}}/database) + - [Query Builder](/docs/{{version}}/queries) + - [Eloquent ORM](/docs/{{version}}/eloquent) + - [Schema Builder](/docs/{{version}}/schema) + - [Migrations & Seeding](/docs/{{version}}/migrations) + - [Redis](/docs/{{version}}/redis) - Artisan CLI - - [Overview](/docs/5.0/artisan) - - [Development](/docs/5.0/commands) + - [Overview](/docs/{{version}}/artisan) + - [Development](/docs/{{version}}/commands) diff --git a/eloquent.md b/eloquent.md index 95552c8f041..1a55e5e1804 100644 --- a/eloquent.md +++ b/eloquent.md @@ -132,7 +132,7 @@ You may also specify which database connection should be used when running an El $user = User::on('connection-name')->find(1); -If you are using [read / write connections](/docs/5.0/database#read-write-connections), you may force the query to use the "write" connection with the following method: +If you are using [read / write connections](/docs/{{version}}/database#read-write-connections), you may force the query to use the "write" connection with the following method: $user = User::onWriteConnection()->find(1); diff --git a/events.md b/events.md index ea09626a4af..1dc85d1d8b2 100644 --- a/events.md +++ b/events.md @@ -71,7 +71,7 @@ Sometimes, you may wish to stop the propagation of an event to other listeners. ## Queued Event Handlers -Need to [queue](/docs/5.0/queues) an event handler? It couldn't be any easier. When generating the handler, simply use the `--queued` flag: +Need to [queue](/docs/{{version}}/queues) an event handler? It couldn't be any easier. When generating the handler, simply use the `--queued` flag: php artisan handler:event SendPurchaseConfirmation --event=PodcastWasPurchased --queued @@ -137,7 +137,7 @@ Once the subscriber has been defined, it may be registered with the `Event` clas Event::subscribe($subscriber); -You may also use the [service container](/docs/5.0/container) to resolve your subscriber. To do so, simply pass the name of your subscriber to the `subscribe` method: +You may also use the [service container](/docs/{{version}}/container) to resolve your subscriber. To do so, simply pass the name of your subscriber to the `subscribe` method: Event::subscribe('UserEventHandler'); diff --git a/facades.md b/facades.md index d5cb7743d52..bb224ade187 100644 --- a/facades.md +++ b/facades.md @@ -10,11 +10,11 @@ ## Introduction -Facades provide a "static" interface to classes that are available in the application's [service container](/docs/5.0/container). Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods. +Facades provide a "static" interface to classes that are available in the application's [service container](/docs/{{version}}/container). Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods. Occasionally, you may wish to create your own facades for your application's and packages, so let's explore the concept, development and usage of these classes. -> **Note:** Before digging into facades, it is strongly recommended that you become very familiar with the Laravel [service container](/docs/5.0/container). +> **Note:** Before digging into facades, it is strongly recommended that you become very familiar with the Laravel [service container](/docs/{{version}}/container). ## Explanation @@ -106,7 +106,7 @@ We need to be able to resolve this class from the service container. So, let's a return new \PaymentGateway\Payment; }); -A great place to register this binding would be to create a new [service provider](/docs/5.0/container#service-providers) named `PaymentServiceProvider`, and add this binding to the `register` method. You can then configure Laravel to load your service provider from the `config/app.php` configuration file. +A great place to register this binding would be to create a new [service provider](/docs/{{version}}/container#service-providers) named `PaymentServiceProvider`, and add this binding to the `register` method. You can then configure Laravel to load your service provider from the `config/app.php` configuration file. Next, we can create our own facade class: @@ -134,44 +134,44 @@ Unit testing is an important aspect of why facades work the way that they do. In ## Facade Class Reference -Below you will find every facade and its underlying class. This is a useful tool for quickly digging into the API documentation for a given facade root. The [service container binding](/docs/5.0/container) key is also included where applicable. +Below you will find every facade and its underlying class. This is a useful tool for quickly digging into the API documentation for a given facade root. The [service container binding](/docs/{{version}}/container) key is also included where applicable. Facade | Class | Service Container Binding ------------- | ------------- | ------------- -App | [Illuminate\Foundation\Application](http://laravel.com/api/5.0/Illuminate/Foundation/Application.html) | `app` -Artisan | [Illuminate\Console\Application](http://laravel.com/api/5.0/Illuminate/Console/Application.html) | `artisan` -Auth | [Illuminate\Auth\AuthManager](http://laravel.com/api/5.0/Illuminate/Auth/AuthManager.html) | `auth` -Auth (Instance) | [Illuminate\Auth\Guard](http://laravel.com/api/5.0/Illuminate/Auth/Guard.html) | -Blade | [Illuminate\View\Compilers\BladeCompiler](http://laravel.com/api/5.0/Illuminate/View/Compilers/BladeCompiler.html) | `blade.compiler` -Bus | [Illuminate\Contracts\Bus\Dispatcher](http://laravel.com/api/5.0/Illuminate/Contracts/Bus/Dispatcher.html) | -Cache | [Illuminate\Cache\Repository](http://laravel.com/api/5.0/Illuminate/Cache/Repository.html) | `cache` -Config | [Illuminate\Config\Repository](http://laravel.com/api/5.0/Illuminate/Config/Repository.html) | `config` -Cookie | [Illuminate\Cookie\CookieJar](http://laravel.com/api/5.0/Illuminate/Cookie/CookieJar.html) | `cookie` -Crypt | [Illuminate\Encryption\Encrypter](http://laravel.com/api/5.0/Illuminate/Encryption/Encrypter.html) | `encrypter` -DB | [Illuminate\Database\DatabaseManager](http://laravel.com/api/5.0/Illuminate/Database/DatabaseManager.html) | `db` -DB (Instance) | [Illuminate\Database\Connection](http://laravel.com/api/5.0/Illuminate/Database/Connection.html) | -Event | [Illuminate\Events\Dispatcher](http://laravel.com/api/5.0/Illuminate/Events/Dispatcher.html) | `events` -File | [Illuminate\Filesystem\Filesystem](http://laravel.com/api/5.0/Illuminate/Filesystem/Filesystem.html) | `files` -Hash | [Illuminate\Contracts\Hashing\Hasher](http://laravel.com/api/5.0/Illuminate/Contracts/Hashing/Hasher.html) | `hash` -Input | [Illuminate\Http\Request](http://laravel.com/api/5.0/Illuminate/Http/Request.html) | `request` -Lang | [Illuminate\Translation\Translator](http://laravel.com/api/5.0/Illuminate/Translation/Translator.html) | `translator` -Log | [Illuminate\Log\Writer](http://laravel.com/api/5.0/Illuminate/Log/Writer.html) | `log` -Mail | [Illuminate\Mail\Mailer](http://laravel.com/api/5.0/Illuminate/Mail/Mailer.html) | `mailer` -Password | [Illuminate\Auth\Passwords\PasswordBroker](http://laravel.com/api/5.0/Illuminate/Auth/Passwords/PasswordBroker.html) | `auth.password` -Queue | [Illuminate\Queue\QueueManager](http://laravel.com/api/5.0/Illuminate/Queue/QueueManager.html) | `queue` -Queue (Instance) | [Illuminate\Queue\QueueInterface](http://laravel.com/api/5.0/Illuminate/Queue/QueueInterface.html) | -Queue (Base Class) | [Illuminate\Queue\Queue](http://laravel.com/api/5.0/Illuminate/Queue/Queue.html) | -Redirect | [Illuminate\Routing\Redirector](http://laravel.com/api/5.0/Illuminate/Routing/Redirector.html) | `redirect` -Redis | [Illuminate\Redis\Database](http://laravel.com/api/5.0/Illuminate/Redis/Database.html) | `redis` -Request | [Illuminate\Http\Request](http://laravel.com/api/5.0/Illuminate/Http/Request.html) | `request` -Response | [Illuminate\Contracts\Routing\ResponseFactory](http://laravel.com/api/5.0/Illuminate/Contracts/Routing/ResponseFactory.html) | -Route | [Illuminate\Routing\Router](http://laravel.com/api/5.0/Illuminate/Routing/Router.html) | `router` -Schema | [Illuminate\Database\Schema\Blueprint](http://laravel.com/api/5.0/Illuminate/Database/Schema/Blueprint.html) | -Session | [Illuminate\Session\SessionManager](http://laravel.com/api/5.0/Illuminate/Session/SessionManager.html) | `session` -Session (Instance) | [Illuminate\Session\Store](http://laravel.com/api/5.0/Illuminate/Session/Store.html) | -Storage | [Illuminate\Contracts\Filesystem\Factory](http://laravel.com/api/5.0/Illuminate/Contracts/Filesystem/Factory.html) | `filesystem` -URL | [Illuminate\Routing\UrlGenerator](http://laravel.com/api/5.0/Illuminate/Routing/UrlGenerator.html) | `url` -Validator | [Illuminate\Validation\Factory](http://laravel.com/api/5.0/Illuminate/Validation/Factory.html) | `validator` -Validator (Instance) | [Illuminate\Validation\Validator](http://laravel.com/api/5.0/Illuminate/Validation/Validator.html) | -View | [Illuminate\View\Factory](http://laravel.com/api/5.0/Illuminate/View/Factory.html) | `view` -View (Instance) | [Illuminate\View\View](http://laravel.com/api/5.0/Illuminate/View/View.html) | +App | [Illuminate\Foundation\Application](http://laravel.com/api/{{version}}/Illuminate/Foundation/Application.html) | `app` +Artisan | [Illuminate\Console\Application](http://laravel.com/api/{{version}}/Illuminate/Console/Application.html) | `artisan` +Auth | [Illuminate\Auth\AuthManager](http://laravel.com/api/{{version}}/Illuminate/Auth/AuthManager.html) | `auth` +Auth (Instance) | [Illuminate\Auth\Guard](http://laravel.com/api/{{version}}/Illuminate/Auth/Guard.html) | +Blade | [Illuminate\View\Compilers\BladeCompiler](http://laravel.com/api/{{version}}/Illuminate/View/Compilers/BladeCompiler.html) | `blade.compiler` +Bus | [Illuminate\Contracts\Bus\Dispatcher](http://laravel.com/api/{{version}}/Illuminate/Contracts/Bus/Dispatcher.html) | +Cache | [Illuminate\Cache\Repository](http://laravel.com/api/{{version}}/Illuminate/Cache/Repository.html) | `cache` +Config | [Illuminate\Config\Repository](http://laravel.com/api/{{version}}/Illuminate/Config/Repository.html) | `config` +Cookie | [Illuminate\Cookie\CookieJar](http://laravel.com/api/{{version}}/Illuminate/Cookie/CookieJar.html) | `cookie` +Crypt | [Illuminate\Encryption\Encrypter](http://laravel.com/api/{{version}}/Illuminate/Encryption/Encrypter.html) | `encrypter` +DB | [Illuminate\Database\DatabaseManager](http://laravel.com/api/{{version}}/Illuminate/Database/DatabaseManager.html) | `db` +DB (Instance) | [Illuminate\Database\Connection](http://laravel.com/api/{{version}}/Illuminate/Database/Connection.html) | +Event | [Illuminate\Events\Dispatcher](http://laravel.com/api/{{version}}/Illuminate/Events/Dispatcher.html) | `events` +File | [Illuminate\Filesystem\Filesystem](http://laravel.com/api/{{version}}/Illuminate/Filesystem/Filesystem.html) | `files` +Hash | [Illuminate\Contracts\Hashing\Hasher](http://laravel.com/api/{{version}}/Illuminate/Contracts/Hashing/Hasher.html) | `hash` +Input | [Illuminate\Http\Request](http://laravel.com/api/{{version}}/Illuminate/Http/Request.html) | `request` +Lang | [Illuminate\Translation\Translator](http://laravel.com/api/{{version}}/Illuminate/Translation/Translator.html) | `translator` +Log | [Illuminate\Log\Writer](http://laravel.com/api/{{version}}/Illuminate/Log/Writer.html) | `log` +Mail | [Illuminate\Mail\Mailer](http://laravel.com/api/{{version}}/Illuminate/Mail/Mailer.html) | `mailer` +Password | [Illuminate\Auth\Passwords\PasswordBroker](http://laravel.com/api/{{version}}/Illuminate/Auth/Passwords/PasswordBroker.html) | `auth.password` +Queue | [Illuminate\Queue\QueueManager](http://laravel.com/api/{{version}}/Illuminate/Queue/QueueManager.html) | `queue` +Queue (Instance) | [Illuminate\Queue\QueueInterface](http://laravel.com/api/{{version}}/Illuminate/Queue/QueueInterface.html) | +Queue (Base Class) | [Illuminate\Queue\Queue](http://laravel.com/api/{{version}}/Illuminate/Queue/Queue.html) | +Redirect | [Illuminate\Routing\Redirector](http://laravel.com/api/{{version}}/Illuminate/Routing/Redirector.html) | `redirect` +Redis | [Illuminate\Redis\Database](http://laravel.com/api/{{version}}/Illuminate/Redis/Database.html) | `redis` +Request | [Illuminate\Http\Request](http://laravel.com/api/{{version}}/Illuminate/Http/Request.html) | `request` +Response | [Illuminate\Contracts\Routing\ResponseFactory](http://laravel.com/api/{{version}}/Illuminate/Contracts/Routing/ResponseFactory.html) | +Route | [Illuminate\Routing\Router](http://laravel.com/api/{{version}}/Illuminate/Routing/Router.html) | `router` +Schema | [Illuminate\Database\Schema\Blueprint](http://laravel.com/api/{{version}}/Illuminate/Database/Schema/Blueprint.html) | +Session | [Illuminate\Session\SessionManager](http://laravel.com/api/{{version}}/Illuminate/Session/SessionManager.html) | `session` +Session (Instance) | [Illuminate\Session\Store](http://laravel.com/api/{{version}}/Illuminate/Session/Store.html) | +Storage | [Illuminate\Contracts\Filesystem\Factory](http://laravel.com/api/{{version}}/Illuminate/Contracts/Filesystem/Factory.html) | `filesystem` +URL | [Illuminate\Routing\UrlGenerator](http://laravel.com/api/{{version}}/Illuminate/Routing/UrlGenerator.html) | `url` +Validator | [Illuminate\Validation\Factory](http://laravel.com/api/{{version}}/Illuminate/Validation/Factory.html) | `validator` +Validator (Instance) | [Illuminate\Validation\Validator](http://laravel.com/api/{{version}}/Illuminate/Validation/Validator.html) | +View | [Illuminate\View\Factory](http://laravel.com/api/{{version}}/Illuminate/View/Factory.html) | `view` +View (Instance) | [Illuminate\View\View](http://laravel.com/api/{{version}}/Illuminate/View/View.html) | diff --git a/filesystem.md b/filesystem.md index 537a010a6dd..03c8a28be61 100644 --- a/filesystem.md +++ b/filesystem.md @@ -29,7 +29,7 @@ When using the `local` driver, note that all file operations are relative to the ## Basic Usage -The `Storage` facade may be used to interact with any of your configured disks. Alternatively, you may type-hint the `Illuminate\Contracts\Filesystem\Factory` contract on any class that is resolved via the Laravel [service container](/docs/5.0/container). +The `Storage` facade may be used to interact with any of your configured disks. Alternatively, you may type-hint the `Illuminate\Contracts\Filesystem\Factory` contract on any class that is resolved via the Laravel [service container](/docs/{{version}}/container). #### Retrieving A Particular Disk diff --git a/homestead.md b/homestead.md index c1e121e8639..9e79e7df3ce 100644 --- a/homestead.md +++ b/homestead.md @@ -33,7 +33,7 @@ Homestead is currently built and tested using Vagrant 1.7. - Redis - Memcached - Beanstalkd -- [Laravel Envoy](/docs/5.0/envoy) +- [Laravel Envoy](/docs/{{version}}/envoy) - [Blackfire Profiler](#blackfire-profiler) diff --git a/installation.md b/installation.md index 451394ff5be..ada3c3f5cf9 100644 --- a/installation.md +++ b/installation.md @@ -58,7 +58,7 @@ Typically, this string should be 32 characters long. The key can be set in the ` Laravel needs almost no other configuration out of the box. You are free to get started developing! However, you may wish to review the `config/app.php` file and its documentation. It contains several options such as `timezone` and `locale` that you may wish to change according to your application. -Once Laravel is installed, you should also [configure your local environment](/docs/5.0/configuration#environment-configuration). +Once Laravel is installed, you should also [configure your local environment](/docs/{{version}}/configuration#environment-configuration). > **Note:** You should never have the `app.debug` configuration option set to `true` for a production application. @@ -91,4 +91,4 @@ On Nginx, the following directive in your site configuration will allow "pretty" try_files $uri $uri/ /index.php?$query_string; } -Of course, when using [Homestead](/docs/5.0/homestead), pretty URLs will be configured automatically. +Of course, when using [Homestead](/docs/{{version}}/homestead), pretty URLs will be configured automatically. diff --git a/lifecycle.md b/lifecycle.md index fac198aedfc..2d977963866 100644 --- a/lifecycle.md +++ b/lifecycle.md @@ -20,7 +20,7 @@ If you don't understand all of the terms right away, don't lose heart! Just try The entry point for all requests to a Laravel application is the `public/index.php` file. All requests are directed to this file by your web server (Apache / Nginx) configuration. The `index.php` file doesn't contain much code. Rather, it is simply a starting point for loading the rest of the framework. -The `index.php` file loads the Composer generated autoloader definition, and then retrieves an instance of the Laravel application from `bootstrap/app.php` script. The first action taken by Laravel itself is to create an instance of the application / [service container](/docs/5.0/container). +The `index.php` file loads the Composer generated autoloader definition, and then retrieves an instance of the Laravel application from `bootstrap/app.php` script. The first action taken by Laravel itself is to create an instance of the application / [service container](/docs/{{version}}/container). #### HTTP / Console Kernels @@ -28,7 +28,7 @@ Next, the incoming request is sent to either the HTTP kernel or the console kern The HTTP kernel extends the `Illuminate\Foundation\Http\Kernel` class, which defines an array of `bootstrappers` that will be run before the request is executed. These bootstrappers configure error handling, configure logging, detect the application environment, and perform other tasks that need to be done before the request is actually handled. -The HTTP kernel also defines a list of HTTP [middleware](/docs/5.0/middleware) that all requests must pass through before being handled by the application. These middleware handle reading and writing the HTTP session, determine if the application is in maintenance mode, verifying the CSRF token, and more. +The HTTP kernel also defines a list of HTTP [middleware](/docs/{{version}}/middleware) that all requests must pass through before being handled by the application. These middleware handle reading and writing the HTTP session, determine if the application is in maintenance mode, verifying the CSRF token, and more. The method signature for the HTTP kernel's `handle` method is quite simple: receive a `Request` and return a `Response`. Think of the Kernel as being a big black box that represents your entire application. Feed it HTTP requests and it will return HTTP responses. diff --git a/localization.md b/localization.md index c64bcca6ed9..f57a6fef889 100644 --- a/localization.md +++ b/localization.md @@ -101,7 +101,7 @@ Since the Laravel translator is powered by the Symfony Translation component, yo ## Validation -For localization for validation errors and messages, take a look at the documentation on Validation. +For localization for validation errors and messages, take a look at the documentation on Validation. ## Overriding Package Language Files diff --git a/mail.md b/mail.md index cd327097b00..98a90ba4a19 100644 --- a/mail.md +++ b/mail.md @@ -114,7 +114,7 @@ Note that the `$message` variable is always passed to e-mail views by the `Mail` #### Queueing A Mail Message -Since sending e-mail messages can drastically lengthen the response time of your application, many developers choose to queue e-mail messages for background sending. Laravel makes this easy using its built-in [unified queue API](/docs/5.0/queues). To queue a mail message, simply use the `queue` method on the `Mail` facade: +Since sending e-mail messages can drastically lengthen the response time of your application, many developers choose to queue e-mail messages for background sending. Laravel makes this easy using its built-in [unified queue API](/docs/{{version}}/queues). To queue a mail message, simply use the `queue` method on the `Mail` facade: Mail::queue('emails.welcome', $data, function($message) { diff --git a/migrations.md b/migrations.md index 49392d35c8e..357e05444f5 100644 --- a/migrations.md +++ b/migrations.md @@ -9,7 +9,7 @@ ## Introduction -Migrations are a type of version control for your database. They allow a team to modify the database schema and stay up to date on the current schema state. Migrations are typically paired with the [Schema Builder](/docs/5.0/schema) to easily manage your application's schema. +Migrations are a type of version control for your database. They allow a team to modify the database schema and stay up to date on the current schema state. Migrations are typically paired with the [Schema Builder](/docs/{{version}}/schema) to easily manage your application's schema. ## Creating Migrations diff --git a/packages.md b/packages.md index bec793fe958..a1aa12b51fa 100644 --- a/packages.md +++ b/packages.md @@ -22,7 +22,7 @@ All Laravel packages are distributed via [Packagist](http://packagist.org) and [ ## Views -Your package's internal structure is entirely up to you; however, typically each package will contain one or more [service providers](/docs/5.0/providers). The service provider contains any [service container](/docs/5.0/container) bindings, as well as instructions as to where package configuration, views, and translation files are located. +Your package's internal structure is entirely up to you; however, typically each package will contain one or more [service providers](/docs/{{version}}/providers). The service provider contains any [service container](/docs/{{version}}/container) bindings, as well as instructions as to where package configuration, views, and translation files are located. ### Views diff --git a/pagination.md b/pagination.md index 20f01ad0cce..dafaa88f441 100644 --- a/pagination.md +++ b/pagination.md @@ -27,7 +27,7 @@ Sometimes you may wish to create a pagination instance manually, passing it an a #### Paginating An Eloquent Model -You may also paginate [Eloquent](/docs/5.0/eloquent) models: +You may also paginate [Eloquent](/docs/{{version}}/eloquent) models: $allUsers = User::paginate(15); diff --git a/providers.md b/providers.md index d78f5a12e7a..3228e8aaa83 100644 --- a/providers.md +++ b/providers.md @@ -19,7 +19,7 @@ In this overview you will learn how to write your own service providers and regi ## Basic Provider Example -All service providers extend the `Illuminate\Support\ServiceProvider` class. This abstract class requires that you define at least one method on your provider: `register`. Within the `register` method, you should **only bind things into the [service container](/docs/5.0/container)**. You should never attempt to register any event listeners, routes, or any other piece of functionality within the `register` method. +All service providers extend the `Illuminate\Support\ServiceProvider` class. This abstract class requires that you define at least one method on your provider: `register`. Within the `register` method, you should **only bind things into the [service container](/docs/{{version}}/container)**. You should never attempt to register any event listeners, routes, or any other piece of functionality within the `register` method. The Artisan CLI can easily generate a new provider via the `make:provider` command: @@ -51,7 +51,7 @@ Now, let's take a look at a basic service provider: } -This service provider only defines a `register` method, and uses that method to define an implementation of `Riak\Contracts\Connection` in the service container. If you don't understand how the service container works, don't worry, [we'll cover that soon](/docs/5.0/container). +This service provider only defines a `register` method, and uses that method to define an implementation of `Riak\Contracts\Connection` in the service container. If you don't understand how the service container works, don't worry, [we'll cover that soon](/docs/{{version}}/container). This class is namespaced under `App\Providers` since that is the default location for service providers in Laravel. However, you are free to change this as you wish. Your service providers may be placed anywhere that Composer can autoload them. @@ -113,7 +113,7 @@ To register your provider, simply add it to the array: ## Deferred Providers -If your provider is **only** registering bindings in the [service container](/docs/5.0/container), you may choose to defer its registration until one of the registered bindings is actually needed. Deferring the loading of such a provider will improve the performance of your application, since it is not loaded from the filesystem on every request. +If your provider is **only** registering bindings in the [service container](/docs/{{version}}/container), you may choose to defer its registration until one of the registered bindings is actually needed. Deferring the loading of such a provider will improve the performance of your application, since it is not loaded from the filesystem on every request. To defer the loading of a provider, set the `defer` property to `true` and define a `provides` method. The `provides` method returns the service container bindings that the provider registers: diff --git a/queues.md b/queues.md index 2a1444a1f73..55ed225f49b 100644 --- a/queues.md +++ b/queues.md @@ -43,9 +43,9 @@ To push a new job onto the queue, use the `Queue::push` method: Queue::push(new SendEmail($message)); -> **Note:** In this example, we are using the `Queue` facade directly; however, typically you would dispatch queued command via the [Command Bus](/docs/5.0/bus). We will continue to use the `Queue` facade throughout this page; however, familiarize with the command bus as well, since it is used to dispatch both queued and synchronous commands for your application. +> **Note:** In this example, we are using the `Queue` facade directly; however, typically you would dispatch queued command via the [Command Bus](/docs/{{version}}/bus). We will continue to use the `Queue` facade throughout this page; however, familiarize with the command bus as well, since it is used to dispatch both queued and synchronous commands for your application. -By default, the `make:command` Artisan command generates a "self-handling" command, meaning a `handle` method is added to the command itself. This method will be called when the job is executed by the queue. You may type-hint any dependencies you need on the `handle` method and the [service container](/docs/5.0/container) will automatically inject them: +By default, the `make:command` Artisan command generates a "self-handling" command, meaning a `handle` method is added to the command itself. This method will be called when the job is executed by the queue. You may type-hint any dependencies you need on the `handle` method and the [service container](/docs/{{version}}/container) will automatically inject them: public function handle(UserRepository $users) { diff --git a/redis.md b/redis.md index 24ba0a8e212..b919688d850 100644 --- a/redis.md +++ b/redis.md @@ -64,7 +64,7 @@ When you are simply executing commands against the default connection, just use $values = Redis::lrange('names', 5, 10); -> **Note:** Redis [cache](/docs/5.0/cache) and [session](/docs/5.0/session) drivers are included with Laravel. +> **Note:** Redis [cache](/docs/{{version}}/cache) and [session](/docs/{{version}}/session) drivers are included with Laravel. ## Pipelining diff --git a/releases.md b/releases.md index ed9643e2073..9495f2438ff 100644 --- a/releases.md +++ b/releases.md @@ -31,7 +31,7 @@ Application language files and views have been moved to the `resources` director All major Laravel components implement interfaces which are located in the `illuminate/contracts` repository. This repository has no external dependencies. Having a convenient, centrally located set of interfaces you may use for decoupling and dependency injection will serve as an easy alternative option to Laravel Facades. -For more information on contracts, consult the [full documentation](/docs/5.0/contracts). +For more information on contracts, consult the [full documentation](/docs/{{version}}/contracts). ### Route Cache @@ -41,11 +41,11 @@ If your application is made up entirely of controller routes, you may utilize th In addition to Laravel 4 style route "filters", Laravel 5 now supports HTTP middleware, and the included authentication and CSRF "filters" have been converted to middleware. Middleware provides a single, consistent interface to replace all types of filters, allowing you to easily inspect, and even reject, requests before they enter your application. -For more information on middleware, check out [the documentation](/docs/5.0/middleware). +For more information on middleware, check out [the documentation](/docs/{{version}}/middleware). ### Controller Method Injection -In addition to the existing constructor injection, you may now type-hint dependencies on controller methods. The [service container](/docs/5.0/container) will automatically inject the dependencies, even if the route contains other parameters: +In addition to the existing constructor injection, you may now type-hint dependencies on controller methods. The [service container](/docs/{{version}}/container) will automatically inject the dependencies, even if the route contains other parameters: public function createPost(Request $request, PostRepository $posts) { @@ -86,7 +86,7 @@ Of course, your event handler will receive the event object instead of a list of } -For more information on working with events, check out the [full documentation](/docs/5.0/events). +For more information on working with events, check out the [full documentation](/docs/{{version}}/events). ### Commands / Queueing @@ -127,7 +127,7 @@ The base Laravel controller utilizes the new `DispatchesCommands` trait, allowin $this->dispatch(new PurchasePodcastCommand($user, $podcast)); -Of course, you may also use commands for tasks that are executed synchronously (are not queued). In fact, using commands is a great way to encapsulate complex tasks your application needs to perform. For more information, check out the [command bus](/docs/5.0/bus) documentation. +Of course, you may also use commands for tasks that are executed synchronously (are not queued). In fact, using commands is a great way to encapsulate complex tasks your application needs to perform. For more information, check out the [command bus](/docs/{{version}}/bus) documentation. ### Database Queue @@ -141,7 +141,7 @@ It looks like this: $schedule->command('artisan:command')->dailyAt('15:00'); -Of course, check out the [full documentation](/docs/5.0/artisan#scheduling-artisan-commands) to learn all about the scheduler! +Of course, check out the [full documentation](/docs/{{version}}/artisan#scheduling-artisan-commands) to learn all about the scheduler! ### Tinker / Psysh @@ -151,13 +151,13 @@ The `php artisan tinker` command now utilizes [Psysh](https://github.com/bobthec ### DotEnv -Instead of a variety of confusing, nested environment configuration directories, Laravel 5 now utilizes [DotEnv](https://github.com/vlucas/phpdotenv) by Vance Lucas. This library provides a super simple way to manage your environment configuration, and makes environment detection in Laravel 5 a breeze. For more details, check out the full [configuration documentation](/docs/5.0/configuration#environment-configuration). +Instead of a variety of confusing, nested environment configuration directories, Laravel 5 now utilizes [DotEnv](https://github.com/vlucas/phpdotenv) by Vance Lucas. This library provides a super simple way to manage your environment configuration, and makes environment detection in Laravel 5 a breeze. For more details, check out the full [configuration documentation](/docs/{{version}}/configuration#environment-configuration). ### Laravel Elixir Laravel Elixir, by Jeffrey Way, provides a fluent, expressive interface to compiling and concatenating your assets. If you've ever been intimidated by learning Grunt or Gulp, fear no more. Elixir makes it a cinch to get started using Gulp to compile your Less, Sass, and CoffeeScript. It can even run your tests for you! -For more information on Elixir, check out the [full documentation](/docs/5.0/elixir). +For more information on Elixir, check out the [full documentation](/docs/{{version}}/elixir). ### Laravel Socialite @@ -173,7 +173,7 @@ Laravel Socialite is an optional, Laravel 5.0+ compatible package that provides $user = Socialize::with('twitter')->user(); } -No more spending hours writing OAuth authentication flows. Get started in minutes! The [full documentation](/docs/5.0/authentication#social-authentication) has all the details. +No more spending hours writing OAuth authentication flows. Get started in minutes! The [full documentation](/docs/{{version}}/authentication#social-authentication) has all the details. ### Flysystem Integration @@ -181,7 +181,7 @@ Laravel now includes the powerful [Flysystem](https://github.com/thephpleague/fl Storage::put('file.txt', 'contents'); -For more information on the Laravel Flysystem integration, consult the [full documentation](/docs/5.0/filesystem). +For more information on the Laravel Flysystem integration, consult the [full documentation](/docs/{{version}}/filesystem). ### Form Requests @@ -213,7 +213,7 @@ Once the class has been defined, we can type-hint it on our controller action: var_dump($request->input()); } -When the Laravel service container identifies that the class it is injecting is a `FormRequest` instance, the request will **automatically be validated**. This means that if your controller action is called, you can safely assume the HTTP request input has been validated according to the rules you specified in your form request class. Even more, if the request is invalid, an HTTP redirect, which you may customize, will automatically be issued, and the error messages will be either flashed to the session or converted to JSON. **Form validation has never been more simple.** For more information on `FormRequest` validation, check out the [documentation](/docs/5.0/validation#form-request-validation). +When the Laravel service container identifies that the class it is injecting is a `FormRequest` instance, the request will **automatically be validated**. This means that if your controller action is called, you can safely assume the HTTP request input has been validated according to the rules you specified in your form request class. Even more, if the request is invalid, an HTTP redirect, which you may customize, will automatically be issued, and the error messages will be either flashed to the session or converted to JSON. **Form validation has never been more simple.** For more information on `FormRequest` validation, check out the [documentation](/docs/{{version}}/validation#form-request-validation). ### Simple Controller Request Validation @@ -229,7 +229,7 @@ The Laravel 5 base controller now includes a `ValidatesRequests` trait. This tra If the validation fails, an exception will be thrown and the proper HTTP response will automatically be sent back to the browser. The validation errors will even be flashed to the session! If the request was an AJAX request, Laravel even takes care of sending a JSON representation of the validation errors back to you. -For more information on this new method, check out [the documentation](/docs/5.0/validation#controller-validation). +For more information on this new method, check out [the documentation](/docs/{{version}}/validation#controller-validation). ### New Generators diff --git a/requests.md b/requests.md index 5dc9686fba5..20301a67953 100644 --- a/requests.md +++ b/requests.md @@ -20,7 +20,7 @@ Remember, if you are in a namespace, you will have to import the `Request` facad ### Via Dependency Injection -To obtain an instance of the current HTTP request via dependency injection, you should type-hint the class on your controller constructor or method. The current request instance will automatically be injected by the [service container](/docs/5.0/container): +To obtain an instance of the current HTTP request via dependency injection, you should type-hint the class on your controller constructor or method. The current request instance will automatically be injected by the [service container](/docs/{{version}}/container): with('message', 'Login Failed'); @@ -101,7 +101,7 @@ If you are redirecting to a route with an "ID" parameter that is being populated #### Returning A Redirect To A Controller Action -Similarly to generating `RedirectResponse` instances to named routes, you may also generate redirects to [controller actions](/docs/5.0/controllers): +Similarly to generating `RedirectResponse` instances to named routes, you may also generate redirects to [controller actions](/docs/{{version}}/controllers): return redirect()->action('App\Http\Controllers\HomeController@index'); @@ -118,7 +118,7 @@ Similarly to generating `RedirectResponse` instances to named routes, you may al ## Other Responses -The `response` helper may be used to conveniently generate other types of response instances. When the `response` helper is called without arguments, an implementation of the `Illuminate\Contracts\Routing\ResponseFactory` [contract](/docs/5.0/contracts) is returned. This contract provides several helpful methods for generating responses. +The `response` helper may be used to conveniently generate other types of response instances. When the `response` helper is called without arguments, an implementation of the `Illuminate\Contracts\Routing\ResponseFactory` [contract](/docs/{{version}}/contracts) is returned. This contract provides several helpful methods for generating responses. #### Creating A JSON Response @@ -146,7 +146,7 @@ The `json` method will automatically set the `Content-Type` header to `applicati If you would like to define a custom response that you can re-use in a variety of your routes and controllers, you may use the `macro` method on an implementation of `Illuminate\Contracts\Routing\ResponseFactory`. -For example, from a [service provider's](/docs/5.0/providers) `boot` method: +For example, from a [service provider's](/docs/{{version}}/providers) `boot` method: "> -Of course, using the Blade [templating engine](/docs/5.0/templates): +Of course, using the Blade [templating engine](/docs/{{version}}/templates): -You do not need to manually verify the CSRF token on POST, PUT, or DELETE requests. The `VerifyCsrfToken` [HTTP middleware](/docs/5.0/middleware) will verify token in the request input matches the token stored in the session. +You do not need to manually verify the CSRF token on POST, PUT, or DELETE requests. The `VerifyCsrfToken` [HTTP middleware](/docs/{{version}}/middleware) will verify token in the request input matches the token stored in the session. #### X-CSRF-TOKEN @@ -366,4 +366,4 @@ The `abort` helper simply throws a `Symfony\Component\HttpFoundation\Exception\H Secondly, you may manually throw an instance of `Symfony\Component\HttpKernel\Exception\NotFoundHttpException`. -More information on handling 404 exceptions and using custom responses for these errors may be found in the [errors](/docs/5.0/errors#http-exceptions) section of the documentation. +More information on handling 404 exceptions and using custom responses for these errors may be found in the [errors](/docs/{{version}}/errors#http-exceptions) section of the documentation. diff --git a/session.md b/session.md index 7b08eac51bf..467aea7cbc2 100644 --- a/session.md +++ b/session.md @@ -125,4 +125,4 @@ The session "driver" defines where session data will be stored for each request. - `memcached` / `redis` - sessions will be stored in one of these fast, cached based stores. - `array` - sessions will be stored in a simple PHP array and will not be persisted across requests. -> **Note:** The array driver is typically used for running [unit tests](/docs/5.0/testing), so no session data will be persisted. +> **Note:** The array driver is typically used for running [unit tests](/docs/{{version}}/testing), so no session data will be persisted. diff --git a/testing.md b/testing.md index 268c857ccbf..43bcc468717 100644 --- a/testing.md +++ b/testing.md @@ -205,4 +205,4 @@ More information on creating seeds may be found in the [migrations and seeding]( ## Refreshing The Application -As you may already know, you can access your Application ([service container](/docs/5.0/container)) via `$this->app` from any test method. This service container instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. +As you may already know, you can access your Application ([service container](/docs/{{version}}/container)) via `$this->app` from any test method. This service container instance is refreshed for each test class. If you wish to manually force the Application to be refreshed for a given method, you may use the `refreshApplication` method from your test method. This will reset any extra bindings, such as mocks, that have been placed in the IoC container since the test case started running. diff --git a/upgrade.md b/upgrade.md index 6ed7c61aee8..3a5818de4df 100644 --- a/upgrade.md +++ b/upgrade.md @@ -21,7 +21,7 @@ In your `bootstrap/autoload.php` file, update the `$compiledPath` variable to: The recommended method of upgrading is to create a new Laravel `5.0` install and then to copy your `4.2` site's unique application files into the new application. This would include controllers, routes, Eloquent models, Artisan commands, assets, and other code specific to your application. -To start, [install a new Laravel 5 application](/docs/5.0/installation) into a fresh directory in your local environment. We'll discuss each piece of the migration process in further detail below. +To start, [install a new Laravel 5 application](/docs/{{version}}/installation) into a fresh directory in your local environment. We'll discuss each piece of the migration process in further detail below. ### Composer Dependencies & Packages @@ -41,7 +41,7 @@ Copy the new `.env.example` file to `.env`, which is the `5.0` equivalent of the Additionally, copy any custom values you had in your old `.env.php` file and place them in both `.env` (the real value for your local environment) and `.env.example` (a sample instructional value for other team members). -For more information on environment configuration, view the [full documentation](/docs/5.0/configuration#environment-configuration). +For more information on environment configuration, view the [full documentation](/docs/{{version}}/configuration#environment-configuration). > **Note:** You will need to place the appropriate `.env` file and values on your production server before deploying your Laravel 5 application. @@ -73,7 +73,7 @@ Filters are not removed in Laravel 5. You can still bind and use your own custom ### Global CSRF -By default, [CSRF protection](/docs/5.0/routing#csrf-protection) is enabled on all routes. If you'd like to disable this, or only manually enable it on certain routes, remove this line from `App\Http\Kernel`'s `middleware` array: +By default, [CSRF protection](/docs/{{version}}/routing#csrf-protection) is enabled on all routes. If you'd like to disable this, or only manually enable it on certain routes, remove this line from `App\Http\Kernel`'s `middleware` array: 'App\Http\Middleware\VerifyCsrfToken', @@ -81,7 +81,7 @@ If you want to use it elsewhere, add this line to `$routeMiddleware`: 'csrf' => 'App\Http\Middleware\VerifyCsrfToken', -Now you can add the middleware to individual routes / controllers using `['middleware' => 'csrf']` on the route. For more information on middleware, consult the [full documentation](/docs/5.0/middleware). +Now you can add the middleware to individual routes / controllers using `['middleware' => 'csrf']` on the route. For more information on middleware, consult the [full documentation](/docs/{{version}}/middleware). ### Eloquent Models @@ -91,7 +91,7 @@ Update any models using `SoftDeletingTrait` to use `Illuminate\Database\Eloquent #### Eloquent Caching -Eloquent no longer provides the `remember` method for caching queries. You now are responsible for caching your queries manually using the `Cache::remember` function. For more information on caching, consult the [full documentation](/docs/5.0/cache). +Eloquent no longer provides the `remember` method for caching queries. You now are responsible for caching your queries manually using the `Cache::remember` function. For more information on caching, consult the [full documentation](/docs/{{version}}/cache). ### User Authentication Model @@ -131,7 +131,7 @@ use Authenticatable, CanResetPassword; ### Cashier User Changes -The name of the trait and interface used by [Laravel Cashier](/docs/5.0/billing) has changed. Instead of using `BillableTrait`, use the `Laravel\Cashier\Billable` trait. And, instead of `Laravel\Cashier\BillableInterface` implement the `Laravel\Cashier\Contracts\Billable` interface instead. No other method changes are required. +The name of the trait and interface used by [Laravel Cashier](/docs/{{version}}/billing) has changed. Instead of using `BillableTrait`, use the `Laravel\Cashier\Billable` trait. And, instead of `Laravel\Cashier\BillableInterface` implement the `Laravel\Cashier\Contracts\Billable` interface instead. No other method changes are required. ### Artisan Commands @@ -147,7 +147,7 @@ Move all of your migration classes from the old `app/database/migrations` direct ### Global IoC Bindings -If you have any [IoC](/docs/5.0/container) bindings in `start/global.php`, move them all to the `register` method of the `app/Providers/AppServiceProvider.php` file. You may need to import the `App` facade. +If you have any [IoC](/docs/{{version}}/container) bindings in `start/global.php`, move them all to the `register` method of the `app/Providers/AppServiceProvider.php` file. You may need to import the `App` facade. Optionally, you may break these bindings up into separate service providers by category. @@ -189,7 +189,7 @@ You may move your Sass, Less, or CoffeeScript to any location you wish. The `res ### Form & HTML Helpers -If you're using Form or HTML helpers, you will see an error stating `class 'Form' not found` or `class 'Html' not found`. The Form and HTML helpers have been deprecated in Laravel 5.0; however, there are community-driven replacements such as those maintained by the [Laravel Collective](http://laravelcollective.com/docs/5.0/html). +If you're using Form or HTML helpers, you will see an error stating `class 'Form' not found` or `class 'Html' not found`. The Form and HTML helpers have been deprecated in Laravel 5.0; however, there are community-driven replacements such as those maintained by the [Laravel Collective](http://laravelcollective.com/docs/{{version}}/html). For example, you may add `"laravelcollective/html": "~5.0"` to your `composer.json` file's `require` section. diff --git a/views.md b/views.md index 8c8eb0e1526..46e636c270a 100644 --- a/views.md +++ b/views.md @@ -49,7 +49,7 @@ When passing information in this manner, `$data` should be an array with key/val #### Sharing Data With All Views -Occasionally, you may need to share a piece of data with all views that are rendered by your application. You have several options: the `view` helper, the `Illuminate\Contracts\View\Factory` [contract](/docs/5.0/contracts), or a wildcard [view composer](#view-composers). +Occasionally, you may need to share a piece of data with all views that are rendered by your application. You have several options: the `view` helper, the `Illuminate\Contracts\View\Factory` [contract](/docs/{{version}}/contracts), or a wildcard [view composer](#view-composers). For example, using the `view` helper: @@ -85,7 +85,7 @@ View composers are callbacks or class methods that are called when a view is ren #### Defining A View Composer -Let's organize our view composers within a [service provider](/docs/5.0/providers). We'll use the `View` facade to access the underlying `Illuminate\Contracts\View\Factory` contract implementation: +Let's organize our view composers within a [service provider](/docs/{{version}}/providers). We'll use the `View` facade to access the underlying `Illuminate\Contracts\View\Factory` contract implementation: **Note:** All view composers are resolved via the [service container](/docs/5.0/container), so you may type-hint any dependencies you need within a composer's constructor. +> **Note:** All view composers are resolved via the [service container](/docs/{{version}}/container), so you may type-hint any dependencies you need within a composer's constructor. #### Wildcard View Composers From bafde93c42986404f1667bd94227a9148feaa452 Mon Sep 17 00:00:00 2001 From: Kaden Lee Date: Tue, 5 May 2015 13:10:40 +0900 Subject: [PATCH 236/276] fixed documentation path --- facades.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facades.md b/facades.md index bb224ade187..0c48a2ca8a4 100644 --- a/facades.md +++ b/facades.md @@ -129,7 +129,7 @@ Classes in the `aliases` array are not available in some instances because [PHP ## Mocking Facades -Unit testing is an important aspect of why facades work the way that they do. In fact, testability is the primary reason for facades to even exist. For more information, check out the [mocking facades](/docs/testing#mocking-facades) section of the documentation. +Unit testing is an important aspect of why facades work the way that they do. In fact, testability is the primary reason for facades to even exist. For more information, check out the [mocking facades](/docs/{{version}}/testing#mocking-facades) section of the documentation. ## Facade Class Reference From 4106e3539b22ecc6b4aa3f71bfc86159e12dedcb Mon Sep 17 00:00:00 2001 From: Kaden Lee Date: Tue, 5 May 2015 16:53:58 +0900 Subject: [PATCH 237/276] fix typo --- helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers.md b/helpers.md index 73342da1174..c82610baea1 100644 --- a/helpers.md +++ b/helpers.md @@ -205,7 +205,7 @@ Get the fully qualified path to the root of the application install. ### config_path -Get the fully qualitifed path to the `config` directory. +Get the fully qualified path to the `config` directory. ### public_path From dfc531432adc6bc9c27a4f1a73fc0e5bc1074a46 Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Tue, 5 May 2015 12:50:03 -0400 Subject: [PATCH 238/276] Update base directory paths --- elixir.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elixir.md b/elixir.md index 0f2f05765cc..f1f5e12d3a3 100644 --- a/elixir.md +++ b/elixir.md @@ -138,7 +138,7 @@ elixir(function(mix) { }); ``` -Paths passed to this method are relative to the `resources/css` directory. +Paths passed to this method are relative to the `resources/assets/css` directory. #### Combine Stylesheets and Save to a Custom Directory @@ -183,7 +183,7 @@ elixir(function(mix) { }); ``` -Again, this assumes all paths are relative to the `resources/js` directory. +Again, this assumes all paths are relative to the `resources/assets/js` directory. #### Combine All Scripts in a Directory @@ -259,7 +259,7 @@ elixir(function(mix) { Want to require modules in the browser? Hoping to use EcmaScript 6 sooner than later? Need a built-in JSX transformer? If so, [Browserify](http://browserify.org/), along with the `browserify` Elixir task, will handle the job nicely. -This task assumes that your scripts are stored in `resources/js`, though you're free to override the default. +This task assumes that your scripts are stored in `resources/assets/js`, though you're free to override the default. #### Method Chaining From 47d731ccaef855efd8b91556fe7abab0becd5fce Mon Sep 17 00:00:00 2001 From: Adrian Rudnik Date: Thu, 7 May 2015 20:42:04 +0200 Subject: [PATCH 239/276] Added information on the provider for VMware Workstation (Windows) --- homestead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homestead.md b/homestead.md index 9e79e7df3ce..f678822f2f4 100644 --- a/homestead.md +++ b/homestead.md @@ -71,7 +71,7 @@ The `Homestead.yaml` file will be placed in your `~/.homestead` directory. ### Configure Your Provider -The `provider` key in your `Homestead.yaml` file indicates which Vagrant provider should be used: `virtualbox` or `vmware_fusion`. You may set this to whichever provider you prefer. +The `provider` key in your `Homestead.yaml` file indicates which Vagrant provider should be used: `virtualbox`, `vmware_fusion` (Mac OS X) or `vmware_workstation` (Windows). You may set this to whichever provider you prefer. provider: virtualbox From fd869742412fd5845d94fbb74f7d3bbc68bef42a Mon Sep 17 00:00:00 2001 From: David Knight Date: Sat, 9 May 2015 22:36:10 +0100 Subject: [PATCH 240/276] Fix incorrect namespace. --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index e82e5da2ad1..b8aaf771672 100644 --- a/routing.md +++ b/routing.md @@ -362,7 +362,7 @@ There are two ways to manually trigger a 404 error from a route. First, you may abort(404); -The `abort` helper simply throws a `Symfony\Component\HttpFoundation\Exception\HttpException` with the specified status code. +The `abort` helper simply throws a `Symfony\Component\HttpKernel\Exception\HttpException` with the specified status code. Secondly, you may manually throw an instance of `Symfony\Component\HttpKernel\Exception\NotFoundHttpException`. From b2628e881b4baa334975a1e976f6b95e6340b876 Mon Sep 17 00:00:00 2001 From: Ammar Alakkad Date: Sun, 10 May 2015 12:05:08 +0300 Subject: [PATCH 241/276] Add Request::ajax() to requests.md Copy the `Request::ajax()` section as is from 4.2 docs. --- requests.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/requests.md b/requests.md index 20301a67953..4a90e3211b5 100644 --- a/requests.md +++ b/requests.md @@ -224,6 +224,14 @@ The `Request` class provides many methods for examining the HTTP request for you #### Retrieving The Request URI $uri = Request::path(); + +#### Determine If The Request Is Using AJAX + + if (Request::ajax()) + { + // + } + #### Retrieving The Request Method From 7b1db3b8082be91b6d97d3daf0213e6806d17c27 Mon Sep 17 00:00:00 2001 From: Olivier B Date: Mon, 11 May 2015 13:54:52 +0200 Subject: [PATCH 242/276] Fix docblock in code sample --- events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events.md b/events.md index 1dc85d1d8b2..c384291dd87 100644 --- a/events.md +++ b/events.md @@ -118,7 +118,7 @@ Event subscribers are classes that may subscribe to multiple events from within * Register the listeners for the subscriber. * * @param Illuminate\Events\Dispatcher $events - * @return array + * @return void */ public function subscribe($events) { From fc596e4305aefb23b1d618e2761064d7a23378f6 Mon Sep 17 00:00:00 2001 From: Ifan Iqbal Date: Tue, 12 May 2015 13:53:03 +0700 Subject: [PATCH 243/276] Add additional information according to Paginator Contract Added: firstItem & lastItem. This is important information as subtitution of getFrom and getTo. --- pagination.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pagination.md b/pagination.md index dafaa88f441..1637ef6d676 100644 --- a/pagination.md +++ b/pagination.md @@ -53,6 +53,8 @@ You may also access additional pagination information via the following methods: - `hasMorePages` - `url` - `nextPageUrl` +- `firstItem` +- `lastItem` - `total` - `count` From 57d8feefbc03e1d398e85f75aa4a0fd390644d7a Mon Sep 17 00:00:00 2001 From: Lukas Geiter Date: Wed, 13 May 2015 00:05:40 +0200 Subject: [PATCH 244/276] Fix string validation rule syntax example --- validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation.md b/validation.md index 8c5d434abdd..9811713ff9e 100644 --- a/validation.md +++ b/validation.md @@ -566,7 +566,7 @@ The given _field_ must match the field under validation. The field under validation must have a size matching the given _value_. For string data, _value_ corresponds to the number of characters. For numeric data, _value_ corresponds to a given integer value. For files, _size_ corresponds to the file size in kilobytes. -#### string:_value_ +#### string The field under validation must be a string type. From 58ff6c935e0e3e197e687420d6ed717506486b07 Mon Sep 17 00:00:00 2001 From: bmitch Date: Thu, 14 May 2015 21:17:25 +0100 Subject: [PATCH 245/276] JavaScript has an upper case 'S' --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index b8aaf771672..1b545781f31 100644 --- a/routing.md +++ b/routing.md @@ -93,7 +93,7 @@ Now all AJAX requests will automatically include the CSRF token: #### X-XSRF-TOKEN -Laravel also stores the CSRF token in a `XSRF-TOKEN` cookie. You can use the cookie value to set the `X-XSRF-TOKEN` request header. Some Javascript frameworks, like Angular, do this automatically for you. +Laravel also stores the CSRF token in a `XSRF-TOKEN` cookie. You can use the cookie value to set the `X-XSRF-TOKEN` request header. Some JavaScript frameworks, like Angular, do this automatically for you. > Note: The difference between the `X-CSRF-TOKEN` and `X-XSRF-TOKEN` is that the first uses a plain text value and the latter uses an encrypted value, because cookies in Laravel are always encrypted. If you use the `csrf_token()` function to supply the token value, you probably want to use the `X-CSRF-TOKEN` header. From 548fff3a2bbf6faa4d2c0291cbc637b202806a8a Mon Sep 17 00:00:00 2001 From: Rachid Laasri Date: Fri, 15 May 2015 21:25:10 +0100 Subject: [PATCH 246/276] Update validation.md Remove "field" duplication under required_if rule. --- validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation.md b/validation.md index 9811713ff9e..f12e1c30c7c 100644 --- a/validation.md +++ b/validation.md @@ -533,7 +533,7 @@ The field under validation must be present in the input data. #### required_if:_field_,_value_,... -The field under validation must be present if the _field_ field is equal to any _value_. +The field under validation must be present if the _field_ is equal to any _value_. #### required_with:_foo_,_bar_,... From 7bbe04d634e8f30e2de2b5999554bb762c03d982 Mon Sep 17 00:00:00 2001 From: "C. T. Lin" Date: Sun, 17 May 2015 21:27:30 +0800 Subject: [PATCH 247/276] Replace `master` to {{version}} placeholder --- responses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/responses.md b/responses.md index 3c311664f21..22d7ab3d04c 100644 --- a/responses.md +++ b/responses.md @@ -31,7 +31,7 @@ For convenience, you may also use the `response` helper: return response($content, $status) ->header('Content-Type', $value); -> **Note:** For a full list of available `Response` methods, check out its [API documentation](http://laravel.com/api/master/Illuminate/Http/Response.html) and the [Symfony API documentation](http://api.symfony.com/2.5/Symfony/Component/HttpFoundation/Response.html). +> **Note:** For a full list of available `Response` methods, check out its [API documentation](http://laravel.com/api/{{version}}/Illuminate/Http/Response.html) and the [Symfony API documentation](http://api.symfony.com/2.5/Symfony/Component/HttpFoundation/Response.html). #### Sending A View In A Response From c28aa60d34f7a2011ba7f45bc3fe00a76df4b5da Mon Sep 17 00:00:00 2001 From: "C. T. Lin" Date: Sun, 17 May 2015 21:31:08 +0800 Subject: [PATCH 248/276] Remove a unnecessary line --- requests.md | 1 - 1 file changed, 1 deletion(-) diff --git a/requests.md b/requests.md index 4a90e3211b5..48eee7a9f3f 100644 --- a/requests.md +++ b/requests.md @@ -232,7 +232,6 @@ The `Request` class provides many methods for examining the HTTP request for you // } - #### Retrieving The Request Method $method = Request::method(); From ed7cd5424af02d7ba4c371d665f4c3e8fd3f5ca5 Mon Sep 17 00:00:00 2001 From: Antony Budianto Date: Tue, 19 May 2015 19:02:04 +0700 Subject: [PATCH 249/276] Add missing use Closure Add missing use Closure or alternatively use \ (backslash) in front of Closure: public function handle($request, \Closure $next) { return $next($request); } or use Closure; public function handle($request, Closure $next) { return $next($request); } --- middleware.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/middleware.md b/middleware.md index 362e1c34137..ded207223ac 100644 --- a/middleware.md +++ b/middleware.md @@ -24,6 +24,8 @@ To create a new middleware, use the `make:middleware` Artisan command: This command will place a new `OldMiddleware` class within your `app/Http/Middleware` directory. In this middleware, we will only allow access to the route if the supplied `age` is greater than 200. Otherwise, we will redirect the users back to the "home" URI. Date: Tue, 19 May 2015 20:40:44 +0700 Subject: [PATCH 250/276] Little fix on PHP doc store and update method have the same php doc --- requests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests.md b/requests.md index 48eee7a9f3f..3c7b85b2272 100644 --- a/requests.md +++ b/requests.md @@ -54,7 +54,7 @@ If your controller method is also expecting input from a route parameter, simply class UserController extends Controller { /** - * Store a new user. + * Update the specified user. * * @param Request $request * @param int $id From 1fdeb0a82e03f9cb60e6e5b19499b476318e5c51 Mon Sep 17 00:00:00 2001 From: Antony Budianto Date: Tue, 19 May 2015 20:45:43 +0700 Subject: [PATCH 251/276] Update BaseController to Controller --- controllers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers.md b/controllers.md index b89891104a2..21f4278be2e 100644 --- a/controllers.md +++ b/controllers.md @@ -11,7 +11,7 @@ ## Introduction -Instead of defining all of your request handling logic in a single `routes.php` file, you may wish to organize this behavior using Controller classes. Controllers can group related HTTP request handling logic into a class. Controllers are typically stored in the `app/Http/Controllers` directory. +Instead of defining all of your request handling logic in a single `routes.php` file, you may wish to organize this behavior using Controller classes. Controllers can group related HTTP request handling logic into a class. Controllers are typically stored in the `app/Http/Controllers` directory.b ## Basic Controllers @@ -110,7 +110,7 @@ Laravel allows you to easily define a single route to handle every action in a c The `controller` method accepts two arguments. The first is the base URI the controller handles, while the second is the class name of the controller. Next, just add methods to your controller, prefixed with the HTTP verb they respond to: - class UserController extends BaseController { + class UserController extends Controller { public function getIndex() { From 915b5d56b787d9ae4c55f34fee465df2f2d96791 Mon Sep 17 00:00:00 2001 From: Antony Budianto Date: Tue, 19 May 2015 20:46:25 +0700 Subject: [PATCH 252/276] Update controllers.md --- controllers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers.md b/controllers.md index 21f4278be2e..815f8ada774 100644 --- a/controllers.md +++ b/controllers.md @@ -11,7 +11,7 @@ ## Introduction -Instead of defining all of your request handling logic in a single `routes.php` file, you may wish to organize this behavior using Controller classes. Controllers can group related HTTP request handling logic into a class. Controllers are typically stored in the `app/Http/Controllers` directory.b +Instead of defining all of your request handling logic in a single `routes.php` file, you may wish to organize this behavior using Controller classes. Controllers can group related HTTP request handling logic into a class. Controllers are typically stored in the `app/Http/Controllers` directory. ## Basic Controllers From 6a7acdfa2fd0b0153f401a6204a982851939a3ce Mon Sep 17 00:00:00 2001 From: Antony Budianto Date: Tue, 19 May 2015 20:49:14 +0700 Subject: [PATCH 253/276] Fix PHP Doc --- controllers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers.md b/controllers.md index 815f8ada774..119153ab697 100644 --- a/controllers.md +++ b/controllers.md @@ -285,7 +285,7 @@ If your controller method is also expecting input from a route parameter, simply class UserController extends Controller { /** - * Store a new user. + * Update the specified user. * * @param Request $request * @param int $id From 8e65e2e1910ea24ece1a8bdebf7f5003a62f32d7 Mon Sep 17 00:00:00 2001 From: Antony Budianto Date: Tue, 19 May 2015 21:01:28 +0700 Subject: [PATCH 254/276] Add missing use Auth --- authentication.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authentication.md b/authentication.md index f16eb1f3906..39df82e84c5 100644 --- a/authentication.md +++ b/authentication.md @@ -150,7 +150,8 @@ Once a user is authenticated, there are several ways to obtain an instance of th First, you may access the user from the `Auth` facade: Date: Tue, 19 May 2015 21:02:16 +0700 Subject: [PATCH 255/276] Update authentication.md --- authentication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentication.md b/authentication.md index 39df82e84c5..e6a30dd06d7 100644 --- a/authentication.md +++ b/authentication.md @@ -151,7 +151,7 @@ First, you may access the user from the `Auth` facade: Date: Sun, 24 May 2015 11:34:31 +0700 Subject: [PATCH 256/276] Add missing PHP doc --- views.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views.md b/views.md index 46e636c270a..92299f687ce 100644 --- a/views.md +++ b/views.md @@ -112,7 +112,7 @@ Let's organize our view composers within a [service provider](/docs/{{version}}/ } /** - * Register + * Register the service provider. * * @return void */ From 34dff1ee60daa3a6ce51990bef3ccfea098a9e06 Mon Sep 17 00:00:00 2001 From: Elf Sundae Date: Mon, 25 May 2015 03:59:50 +0800 Subject: [PATCH 257/276] $data['$key'] to $data['key'] --- views.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views.md b/views.md index 92299f687ce..3ece9aacc38 100644 --- a/views.md +++ b/views.md @@ -45,7 +45,7 @@ If you wish, you may pass an array of data as the second parameter to the `view` $view = view('greetings', $data); -When passing information in this manner, `$data` should be an array with key/value pairs. Inside your view, you can then access each value using it's corresponding key, like `{{ $key }}` (assuming `$data['$key']` exists). +When passing information in this manner, `$data` should be an array with key/value pairs. Inside your view, you can then access each value using it's corresponding key, like `{{ $key }}` (assuming `$data['key']` exists). #### Sharing Data With All Views From 6dc14faabef41f09e7f8077bc7d505306ba0a071 Mon Sep 17 00:00:00 2001 From: Antony Budianto Date: Tue, 26 May 2015 12:39:07 +0700 Subject: [PATCH 258/276] Add missing semicolons --- routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing.md b/routing.md index 1b545781f31..707ef8a3a7b 100644 --- a/routing.md +++ b/routing.md @@ -157,7 +157,7 @@ Of course, you can capture segments of the request URI within your route: { // }) - ->where(['id' => '[0-9]+', 'name' => '[a-z]+']) + ->where(['id' => '[0-9]+', 'name' => '[a-z]+']); #### Defining Global Patterns From e0090c939437b17b70e78b0c809b756f9e527d73 Mon Sep 17 00:00:00 2001 From: Jonas Stendahl Date: Wed, 27 May 2015 13:19:58 +0200 Subject: [PATCH 259/276] Update to correct cache class. --- facades.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facades.md b/facades.md index 0c48a2ca8a4..5d21b64468d 100644 --- a/facades.md +++ b/facades.md @@ -144,7 +144,7 @@ Auth | [Illuminate\Auth\AuthManager](http://laravel.com/api/{{version}}/Illumi Auth (Instance) | [Illuminate\Auth\Guard](http://laravel.com/api/{{version}}/Illuminate/Auth/Guard.html) | Blade | [Illuminate\View\Compilers\BladeCompiler](http://laravel.com/api/{{version}}/Illuminate/View/Compilers/BladeCompiler.html) | `blade.compiler` Bus | [Illuminate\Contracts\Bus\Dispatcher](http://laravel.com/api/{{version}}/Illuminate/Contracts/Bus/Dispatcher.html) | -Cache | [Illuminate\Cache\Repository](http://laravel.com/api/{{version}}/Illuminate/Cache/Repository.html) | `cache` +Cache | [Illuminate\Cache\CacheManager](http://laravel.com/api/{{version}}/Illuminate/Cache/Repository.html) | `cache` Config | [Illuminate\Config\Repository](http://laravel.com/api/{{version}}/Illuminate/Config/Repository.html) | `config` Cookie | [Illuminate\Cookie\CookieJar](http://laravel.com/api/{{version}}/Illuminate/Cookie/CookieJar.html) | `cookie` Crypt | [Illuminate\Encryption\Encrypter](http://laravel.com/api/{{version}}/Illuminate/Encryption/Encrypter.html) | `encrypter` From 4551003ff98a249f03472b84e88b40054af7fd47 Mon Sep 17 00:00:00 2001 From: Jordy Date: Mon, 1 Jun 2015 19:53:13 +0200 Subject: [PATCH 260/276] Update elixir.md fixed typo in compile sass comment block --- elixir.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir.md b/elixir.md index f1f5e12d3a3..198cef2b2a7 100644 --- a/elixir.md +++ b/elixir.md @@ -66,7 +66,7 @@ elixir(function(mix) { ```javascript elixir(function(mix) { - mix.sass("app.sass"); + mix.sass("app.scss"); }); ``` From c4605ef9e455f5439972ffd7ab4af869af17dec2 Mon Sep 17 00:00:00 2001 From: Antony Budianto Date: Sat, 6 Jun 2015 11:28:06 +0700 Subject: [PATCH 261/276] Typo Validation class --- validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation.md b/validation.md index f12e1c30c7c..46d2634fda3 100644 --- a/validation.md +++ b/validation.md @@ -13,7 +13,7 @@ ## Basic Usage -Laravel ships with a simple, convenient facility for validating data and retrieving validation error messages via the `Validation` class. +Laravel ships with a simple, convenient facility for validating data and retrieving validation error messages via the `Validator` class. #### Basic Validation Example From 07ece217c8cb56e7da3138846fe295ce13c64c9d Mon Sep 17 00:00:00 2001 From: Christopher Pecoraro Date: Sun, 28 Jun 2015 12:47:00 +0200 Subject: [PATCH 262/276] Must explicitly specify 5.0 If the installation is run like this, it will install version 5.1. I've updated this to match the format used in the 4.2 docs and it works. --- installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation.md b/installation.md index ada3c3f5cf9..f9d7d30b72a 100644 --- a/installation.md +++ b/installation.md @@ -28,7 +28,7 @@ Once installed, the simple `laravel new` command will create a fresh Laravel ins You may also install Laravel by issuing the Composer `create-project` command in your terminal: - composer create-project laravel/laravel --prefer-dist + composer create-project laravel/laravel {directory} 5.0 --prefer-dist ### Scaffolding From 36dfb4ca672bcc33b6064e76bdc94b8d21334ba9 Mon Sep 17 00:00:00 2001 From: Shkeats Date: Fri, 31 Jul 2015 13:18:59 +0100 Subject: [PATCH 263/276] update queues.md to clarify location for failed() method As per https://github.com/laravel/framework/issues/9799 --- queues.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/queues.md b/queues.md index 55ed225f49b..9d9b5e943a9 100644 --- a/queues.md +++ b/queues.md @@ -255,6 +255,8 @@ You may also define a `failed` method directly on a queue job class, allowing yo { // Called when the job is failing... } + +If your job is not self-handling and has a seperate handler class the `failed` method needs to be defined there instead. ### Retrying Failed Jobs From a151ba088c83a0737749b1f8f1625b57008ef4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Kani=C5=BEar?= Date: Sat, 15 Aug 2015 22:42:48 +0200 Subject: [PATCH 264/276] Help users install the latest version of Laravel 5.0 With the older version of installation procedure (simply telling Composer to install "5.0"), it doesn't actually install the latest version of laravel/laravel (currently 5.0.22), but instead installs 5.0.0. And there's a bunch of differences between those two versions, so it's not ideal. That wouldn't be an issue, if Composer could update laravel/laravel in the current project, but of course it can't, so a developer is stuck with older files. My proposed fix is to tell Composer to install "~5.0.0" version, which installs the latest version, up to (but excluding) 5.1 version. Currently, this means 5.0.22. But since 5.0.22 comes with composer.lock (5.0.0 doesn't), Composer installs older versions of packages, which means we have to upgrade those. But there's another issue - since compiled.php location changed between laravel/framework 5.0.16 (the version that gets installed with laravel/laravel 5.0.22) and laravel/framework 5.0.33 (currently latest), we have to delete compiled.php file before doing the upgrade. Hence a somewhat longer installation procedure. Also, laravel/installer throws errors on PHP 5.4, which is relevant to Laravel 5.0 branch, since it's the last version running on PHP 5.4, which is one of the major reasons for still using 5.0 (for those stuck on PHP 5.4). But that's a separate issue. --- installation.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/installation.md b/installation.md index f9d7d30b72a..7edccf85960 100644 --- a/installation.md +++ b/installation.md @@ -28,7 +28,11 @@ Once installed, the simple `laravel new` command will create a fresh Laravel ins You may also install Laravel by issuing the Composer `create-project` command in your terminal: - composer create-project laravel/laravel {directory} 5.0 --prefer-dist + composer create-project laravel/laravel {directory} "~5.0.0" --prefer-dist + +Once installed, you should upgrade to the latest packages. First, remove `{directory}/vendor/compiled.php` file. + +Then, change your current directory to `{directory}` and issue `composer update` command in your terminal. ### Scaffolding From efe61dc05662f98288272c1885f262e6968c78f5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 15 Aug 2015 20:26:43 -0500 Subject: [PATCH 265/276] fix --- installation.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/installation.md b/installation.md index 7edccf85960..53b82b62ec4 100644 --- a/installation.md +++ b/installation.md @@ -30,9 +30,7 @@ You may also install Laravel by issuing the Composer `create-project` command in composer create-project laravel/laravel {directory} "~5.0.0" --prefer-dist -Once installed, you should upgrade to the latest packages. First, remove `{directory}/vendor/compiled.php` file. - -Then, change your current directory to `{directory}` and issue `composer update` command in your terminal. +Once installed, you should upgrade to the latest packages. First, remove `{directory}/vendor/compiled.php` file then change your current directory to `{directory}` and issue `composer update` command. ### Scaffolding From 24d17b797093ec18bfefd654bc113e03c8559216 Mon Sep 17 00:00:00 2001 From: Ben Speakman Date: Wed, 21 Oct 2015 15:35:24 +0100 Subject: [PATCH 266/276] Prepend slash to the fully qualified class name --- validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation.md b/validation.md index 46d2634fda3..02b940340e4 100644 --- a/validation.md +++ b/validation.md @@ -726,7 +726,7 @@ Instead of using Closure callbacks to extend the Validator, you may also extend Date: Sun, 7 Feb 2016 19:11:21 -0500 Subject: [PATCH 267/276] Adjust install PHP version requirements Adjustment to exclude PHP 7 do to the psy version in 5.0 using libraries that aren't ready for PHP 7. "Cannot use PhpParser\Node\Scalar\String as String because 'String' is a special class name" --- installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation.md b/installation.md index 53b82b62ec4..2d5ba7d1950 100644 --- a/installation.md +++ b/installation.md @@ -43,7 +43,7 @@ Laravel ships with scaffolding for user registration and authentication. If you The Laravel framework has a few system requirements: -- PHP >= 5.4 +- PHP >= 5.4, PHP < 7 - Mcrypt PHP Extension - OpenSSL PHP Extension - Mbstring PHP Extension From 3ab0118be6a701b7246bc75e56364c6c6955dcc9 Mon Sep 17 00:00:00 2001 From: Sajad Robati Date: Sun, 19 Jun 2016 21:09:11 +0430 Subject: [PATCH 268/276] Update installation.md --- installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation.md b/installation.md index 2d5ba7d1950..ae5b1a73dc2 100644 --- a/installation.md +++ b/installation.md @@ -28,7 +28,7 @@ Once installed, the simple `laravel new` command will create a fresh Laravel ins You may also install Laravel by issuing the Composer `create-project` command in your terminal: - composer create-project laravel/laravel {directory} "~5.0.0" --prefer-dist + composer create-project laravel/laravel {directory} "5.0.*" --prefer-dist Once installed, you should upgrade to the latest packages. First, remove `{directory}/vendor/compiled.php` file then change your current directory to `{directory}` and issue `composer update` command. From 55e9db47557a3ffbff34b210d7f2d689503028e2 Mon Sep 17 00:00:00 2001 From: Nat Zimmermann Date: Mon, 8 Aug 2016 10:07:46 +0100 Subject: [PATCH 269/276] [5.0] Move test seeding text below heading --- testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing.md b/testing.md index 43bcc468717..fafd6614d74 100644 --- a/testing.md +++ b/testing.md @@ -192,10 +192,10 @@ You may set the currently authenticated user using the `be` method: $this->be($user); -You may re-seed your database from a test using the `seed` method: - #### Re-Seeding Database From Tests +You may re-seed your database from a test using the `seed` method: + $this->seed(); $this->seed('DatabaseSeeder'); From b30db14eb6e383476a9cca92aab4640c281c3c98 Mon Sep 17 00:00:00 2001 From: Ron Melkhior Date: Sun, 20 Nov 2016 22:19:20 +0200 Subject: [PATCH 270/276] Fixed code formatting in 5.0's authentication page --- authentication.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/authentication.md b/authentication.md index e6a30dd06d7..882d2c3dbd5 100644 --- a/authentication.md +++ b/authentication.md @@ -149,7 +149,9 @@ Once a user is authenticated, there are several ways to obtain an instance of th First, you may access the user from the `Auth` facade: - Date: Thu, 8 Dec 2016 00:51:18 +0200 Subject: [PATCH 271/276] Fixed HTML code blocks --- elixir.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/elixir.md b/elixir.md index 198cef2b2a7..27479ea4a81 100644 --- a/elixir.md +++ b/elixir.md @@ -214,9 +214,7 @@ This will append a unique hash to the filename, allowing for cache-busting. For Within your views, you may use the `elixir()` function to load the appropriately hashed asset. Here's an example: -```html - -``` + Behind the scenes, the `elixir()` function will determine the name of the hashed file that should be included. Don't you feel the weight lifting off your shoulders already? @@ -228,10 +226,8 @@ elixir(function(mix) { }); ``` -```html - - -``` + + #### Copy a File to a New Location From 9aa895363e2f414d45eacd23369983d64462f70d Mon Sep 17 00:00:00 2001 From: Christopher L Bray Date: Thu, 15 Dec 2016 15:27:07 +0000 Subject: [PATCH 272/276] Fix typo --- upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade.md b/upgrade.md index 3a5818de4df..ca19fc37f8f 100644 --- a/upgrade.md +++ b/upgrade.md @@ -137,7 +137,7 @@ The name of the trait and interface used by [Laravel Cashier](/docs/{{version}}/ Move all of your command classes from your old `app/commands` directory to the new `app/Console/Commands` directory. Next, add the `app/Console/Commands` directory to the `classmap` directive of your `composer.json` file. -Then, copy your list of Artisan commands from `start/artisan.php` into the `command` array of the `app/Console/Kernel.php` file. +Then, copy your list of Artisan commands from `start/artisan.php` into the `commands` array of the `app/Console/Kernel.php` file. ### Database Migrations & Seeds From cd876ec484c8903819d1bdb61c6701453123b8c6 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 18 Apr 2017 09:25:11 -0500 Subject: [PATCH 273/276] work on sidebar --- documentation.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation.md b/documentation.md index 37d9d28f7ee..e831b49107c 100644 --- a/documentation.md +++ b/documentation.md @@ -1,26 +1,26 @@ -- Prologue +- ## Prologue - [Release Notes](/docs/{{version}}/releases) - [Upgrade Guide](/docs/{{version}}/upgrade) - [Contribution Guide](/docs/{{version}}/contributions) -- Setup +- ## Setup - [Installation](/docs/{{version}}/installation) - [Configuration](/docs/{{version}}/configuration) - [Homestead](/docs/{{version}}/homestead) -- The Basics +- ## The Basics - [Routing](/docs/{{version}}/routing) - [Middleware](/docs/{{version}}/middleware) - [Controllers](/docs/{{version}}/controllers) - [Requests](/docs/{{version}}/requests) - [Responses](/docs/{{version}}/responses) - [Views](/docs/{{version}}/views) -- Architecture Foundations +- ## Architecture Foundations - [Service Providers](/docs/{{version}}/providers) - [Service Container](/docs/{{version}}/container) - [Contracts](/docs/{{version}}/contracts) - [Facades](/docs/{{version}}/facades) - [Request Lifecycle](/docs/{{version}}/lifecycle) - [Application Structure](/docs/{{version}}/structure) -- Services +- ## Services - [Authentication](/docs/{{version}}/authentication) - [Billing](/docs/{{version}}/billing) - [Cache](/docs/{{version}}/cache) @@ -44,13 +44,13 @@ - [Templates](/docs/{{version}}/templates) - [Unit Testing](/docs/{{version}}/testing) - [Validation](/docs/{{version}}/validation) -- Database +- ## Database - [Basic Usage](/docs/{{version}}/database) - [Query Builder](/docs/{{version}}/queries) - [Eloquent ORM](/docs/{{version}}/eloquent) - [Schema Builder](/docs/{{version}}/schema) - [Migrations & Seeding](/docs/{{version}}/migrations) - [Redis](/docs/{{version}}/redis) -- Artisan CLI +- ## Artisan CLI - [Overview](/docs/{{version}}/artisan) - [Development](/docs/{{version}}/commands) From 9d234074b6d14110840c0bcd70077f7bc3e048ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ferna=CC=81ndez?= Date: Sun, 14 May 2017 19:18:56 +0200 Subject: [PATCH 274/276] Fix links --- releases.md | 6 +++--- upgrade.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/releases.md b/releases.md index 9495f2438ff..f8af2209588 100644 --- a/releases.md +++ b/releases.md @@ -313,9 +313,9 @@ The full change list for this release by running the `php artisan changes` comma ### New SSH Component -An entirely new `SSH` component has been introduced with this release. This feature allows you to easily SSH into remote servers and run commands. To learn more, consult the [SSH component documentation](/docs/ssh). +An entirely new `SSH` component has been introduced with this release. This feature allows you to easily SSH into remote servers and run commands. To learn more, consult the [SSH component documentation](/docs/4.1/ssh). -The new `php artisan tail` command utilizes the new SSH component. For more information, consult the `tail` [command documentation](http://laravel.com/docs/ssh#tailing-remote-logs). +The new `php artisan tail` command utilizes the new SSH component. For more information, consult the `tail` [command documentation](http://laravel.com/docs/4.1/ssh#tailing-remote-logs). ### Boris In Tinker @@ -345,7 +345,7 @@ Cache "sections" have been superseded by "tags". Cache tags allow you to assign ### Flexible Password Reminders -The password reminder engine has been changed to provide greater developer flexibility when validating passwords, flashing status messages to the session, etc. For more information on using the enhanced password reminder engine, [consult the documentation](/docs/security#password-reminders-and-reset). +The password reminder engine has been changed to provide greater developer flexibility when validating passwords, flashing status messages to the session, etc. For more information on using the enhanced password reminder engine, [consult the documentation](/docs/4.1/security#password-reminders-and-reset). ### Improved Routing Engine diff --git a/upgrade.md b/upgrade.md index ca19fc37f8f..0dce57923c2 100644 --- a/upgrade.md +++ b/upgrade.md @@ -363,7 +363,7 @@ If `app/controllers/BaseController.php` has a `use` statement at the top, change ### Password Reminders Updates -Password reminders have been overhauled for greater flexibility. You may examine the new stub controller by running the `php artisan auth:reminders-controller` Artisan command. You may also browse the [updated documentation](/docs/security#password-reminders-and-reset) and update your application accordingly. +Password reminders have been overhauled for greater flexibility. You may examine the new stub controller by running the `php artisan auth:reminders-controller` Artisan command. You may also browse the [updated documentation](/docs/4.1/security#password-reminders-and-reset) and update your application accordingly. Update your `app/lang/en/reminders.php` language file to match [this updated file](https://github.com/laravel/laravel/blob/v4.1.0/app/lang/en/reminders.php). From a7b70b90b5654f2a0b546943f2ddfe6896072d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Fern=C3=A1ndez?= Date: Mon, 15 May 2017 22:47:39 +0200 Subject: [PATCH 275/276] Fix --- queues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queues.md b/queues.md index 9d9b5e943a9..d1850de0ac0 100644 --- a/queues.md +++ b/queues.md @@ -152,7 +152,7 @@ You may pass a comma-delimited list of queue connections to the `listen` command php artisan queue:listen --queue=high,low -In this example, jobs on the `high-connection` will always be processed before moving onto jobs from the `low-connection`. +In this example, jobs on the `high` connection will always be processed before moving onto jobs from the `low` connection. #### Specifying The Job Timeout Parameter From 1b865bd17467f4c657cd58bef7c122a9be2f894a Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Tue, 27 Aug 2024 22:58:35 +1000 Subject: [PATCH 276/276] Header fixes (#9863) --- eloquent.md | 1 - envoy.md | 1 - 2 files changed, 2 deletions(-) diff --git a/eloquent.md b/eloquent.md index 1a55e5e1804..e1f0a913204 100644 --- a/eloquent.md +++ b/eloquent.md @@ -1371,7 +1371,6 @@ Alternatively, you may use the `visible` property to define a white-list: protected $visible = ['first_name', 'last_name']; - Occasionally, you may need to add array attributes that do not have a corresponding column in your database. To do so, simply define an accessor for the value: public function getIsAdminAttribute() diff --git a/envoy.md b/envoy.md index 6bfc424705e..13330d9647a 100644 --- a/envoy.md +++ b/envoy.md @@ -137,7 +137,6 @@ The `deploy` macro can now be run via a single, simple command: envoy run deploy - ## Notifications #### HipChat