Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Michael Dyrynda:
Partial model updates in Laravel
Apr 06, 2017 @ 14:44:05

Michael Dyrynda has written up a post showing the Laravel users out there how to perform partial model updates making use of the "intersect" method.

Many Laravel developers would be familiar with the helpful only method found on the request object, which allows you to specify keys to pluck from the request. Not only does this simplify your workflow, it works quite nicely when completely unguarding your models by setting protected $guarded = [];

[...] For newcomers to Laravel, you might find this suggestion dangerous, but using only means you will only pass the desired input to your model irrespective of what was passed via the request itself. [...] Adam Wathan tweeted about an approach he uncovered whilst helping somebody out when approaching partial model updates.

He shows how the method works by starting with a traditional update method call that reassigns model properties based on input (using "has" checks to ensure the property exists). He then refactors it to use the intersect method and replaces about twenty lines of code with one. He talks about the differences between using only and intersect and offers a caveat to using intersect around preserving null values on properties.

tagged: partial model update intersect only request tutorial refactor

Link: https://dyrynda.com.au/blog/partial-model-updates-in-laravel

PHP Magazine:
Moving to a PDF Only Format
Nov 16, 2005 @ 12:28:57

In a bold move on the part of PHP Magazine today, they have announce that they are going to a strictly PDF format for the magazine.

In taking a holistic stock of the valuable feedback that readers have been sending us, we decided to chart a new course for the magazine, inline with the recommendations from our patrons. Starting this issue, the International PHP Magazine will be published exclusively in digital format (PDF), and available for you to read, on time, month after month. Outside of a long list of hard facts that corroborate our new direction, we believe this shift in delivery format and frequency will ensure you get the magazine on time, and are able to access cutting-edge PHP information more often.

You can check out their FAQ for more information about what this will mean for the magazine and its readers. One benefit, of course, is that it will lower the price of the publication - 4 Euro (about $4.50 US) for individual copies, or 42 Euro (about $50 US) for a year subscription.

tagged: magazine pdf only magazine pdf only

Link:

PHP Magazine:
Moving to a PDF Only Format
Nov 16, 2005 @ 12:28:57

In a bold move on the part of PHP Magazine today, they have announce that they are going to a strictly PDF format for the magazine.

In taking a holistic stock of the valuable feedback that readers have been sending us, we decided to chart a new course for the magazine, inline with the recommendations from our patrons. Starting this issue, the International PHP Magazine will be published exclusively in digital format (PDF), and available for you to read, on time, month after month. Outside of a long list of hard facts that corroborate our new direction, we believe this shift in delivery format and frequency will ensure you get the magazine on time, and are able to access cutting-edge PHP information more often.

You can check out their FAQ for more information about what this will mean for the magazine and its readers. One benefit, of course, is that it will lower the price of the publication - 4 Euro (about $4.50 US) for individual copies, or 42 Euro (about $50 US) for a year subscription.

tagged: magazine pdf only magazine pdf only

Link:


Trending Topics: