Laravel v5.4.18 is now released
Published on by Eric L. Barnes
Laravel V5.4.18 is now released and available. This is a maintenance release but it does include a few new features to the TestResponse, Validator, Artisan, and Mailer.
Test Response
The TestResponse received a few new methods:
assertSeeText()assertDontSeeText()assertJsonMissing()assertSuccessful()
The assertSeeText()
and assertDontSeeText()
look for text within HTML responses, but run a strip_tags over the results so the match is less strict. Here is an example:
// <h1>My <span>Title</span></h1>$response->assertSeeText('My Title');
The assertJsonMissing()
can be used to test that a response does not contain a given fragment, and the assertSuccessful()
tests that the status code is 2xx.
Nested Model Controllers
Now you can pass a parent flag to make:controller
which will create a parent model:
$ php artisan make:controller ClientDocumentController --parent=App/Client --resource A App\Client model does not exist. Do you want to generate it? (yes/no) [yes]:> yes Model created successfully.Controller created successfully.
For a complete list of changes in this release see the changelog below:
v5.4.18 Changelog
Added
- Added
assertSuccessful()
andassertRedirect()
toTestResponse
(#18629) - Added
assertSeeText()
andassertDontSeeText()
toTestResponse
(#18690) - Added
assertJsonMissing()
toTestResponse
(#18721, 786b782) - Added support for attaching an image to Slack attachments
$attachment->image($url)
(#18664) - Added
Validator::extendDependent()
to allow adding custom rules that depend on other fields (#18654) - Added support for
--parent
option onmake:controller
(#18606) - Added
MessageSent
event toMailer
(#18744, 6c5f3a4)
Changed
- Don’t trim leading slashes on local filesystem base URLs (acd66fe)
- Accept variable on
@empty()
directive (#18738) - Added
string
validation rules toAuthenticatesUsers
(#18746)
Fixed
Eric is the creator of Laravel News and has been covering Laravel since 2012.