The essential news about content management systems and mobile technology. Powered by Perfect Publisher and XT Search for Algolia.
The News Site publishes posts to the following channels: Facebook, Instagram, Twitter, Telegram, Web Push, Bluesky, and Blogger.
Last week the Laravel team released v11.37, which includes new
Eloquent relation methods, an option to ignore case with
Str::is()
, adding the Dumpable trait to a Uri instance, and more.
Adrian Nürnberger added the Dumpable
trait to the Uri class, which allows you to call
dump()
and dd()
on a Uri
instance. This allows you to dump at a certain point in the chain
of your Uri instance, or dump and exit using dd()
:
Steve Bauman contributed the ability to ignore case
using the Str::is()
method as well as a
Stringable
instance. This allows developers to remove
strict-case comparison, similar to how Str::contains()
works:
Andrey Helldar contributed
whereDoesntHaveRelation
and
whereDoesntHaveMorph
relation method, which are the
opposite of the existing relation existence queries.
whereDoesntHaveRelation examples:
// Before
User::whereDoesntHave('comments', function ($query) {
$query->where('created_at', '>', now()->subDay());
})->get();
// After
User::whereDoesntHaveRelation(
'comments', 'created_at', '>', now()->subDay()
)->get();
// Another example
User::whereDoesntHaveRelation(
'comments', 'is_approved', false
)->get();
whereMorphDoesntHaveRelation examples:
// Before
User::whereDoesntHaveMorph('comments', [Post::class, Video::class], function ($query) {
$query->where('created_at', '>', now()->subDay());
})->get();
// After
User::whereMorphDoesntHaveRelation(
'comments', [Post::class, Video::class], 'created_at', '>', now()->subDay()
)->get();
User::whereMorphDoesntHaveRelation(
'comments', [Post::class, Video::class], 'is_approved', false
)->get();
assertFailedWith
to
InteractsWithQueue
TraitTeddy Francfort contributed an
assertFailedWith
method to the
InteractsWithQueue
trait, which allows you to check a
failure exception in a test:
use App\Jobs\ProcessPodcast;
use App\Exceptions\MyException;
$job = new ProcessPodcast()->withFakeQueueInteractions();
$job->assertFailedWith('whoops');
$job->assertFailedWith(MyException::class);
$job->assertFailedWith(new MyException);
$job->assertFailedWith(new MyException(message: 'whoops'));
$job->assertFailedWith(new MyException(message: 'whoops', code: 123));
You can see the complete list of new features and updates below and the diff between 11.36.0 and 11.37.0 on GitHub. The following release notes are directly from the changelog:
Dumpable
trait to Uri
by
@nuernbergerA in https://github.com/laravel/framework/pull/53960$ignoreCase
option to
Str::is
by @stevebauman
in https://github.com/laravel/framework/pull/53981withoutQuery
method to accept
string or array input by @1weiho in https://github.com/laravel/framework/pull/53973Illuminate\Http\Response
to output
empty string if $content
is set to null
by @crynobone in https://github.com/laravel/framework/pull/53872whereDoesntHaveRelation
,
whereMorphDoesntHaveRelation
and their variants with
OR
by @andrey-helldar in https://github.com/laravel/framework/pull/53996RefreshDatabase
transaction was committed by @SjorsO in https://github.com/laravel/framework/pull/53997Illuminate\Support\Uri
on
testing HTTP Requests by @crynobone in
https://github.com/laravel/framework/pull/54038null
& *
key
given in data_get
by @jwjenkin in
https://github.com/laravel/framework/pull/54059The post New Eloquent Relation Existence Methods in Laravel 11.37 appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/laravel-11-37-0
Let’s celebrate! The Joomla! Project is pleased to announce the release of Joomla 5.2.3 and Joomla 4.4.10. This is a security and bug fix release for the 5.x and 4.x series of Joomla....
Read more https://www.joomla.org/announcements/release-news/5919-joomla-5-2-3-security-bugfix-release.html
Studio, our free and open source local WordPress development app on MacOS and Windows, is now seamlessly integrated with WordPress.com.
Our new Studio Sync feature provides Studio users with a fast, simple way to:
With Studio Sync, taking your WordPress site from local development to production has never been more streamlined.
Download Studio for freeStudio Sync makes it simple to publish your local WordPress site with powerful WordPress.com hosting. Here are a few of our favorite use cases:
You can connect any of your WordPress.com sites on a Business plan or higher. Use built-in search to locate your site and quickly see if the site has a staging environment available.
Pull to synchronize your WordPress.com site changes with your local Studio site, or push to deploy your local Studio site changes to your WordPress.com site.
Ready to publish your local Studio site for all the world to see?
Simply click Connect site on the Sync tab, and then you’ll see an option to purchase a new hosting plan for your Studio site at WordPress.com.
You can start taking advantage of this new Studio Sync feature in just a few steps:
We’d love to hear how you think this new Studio Sync feature will speed up your local development work.
As a reminder, Studio is a free, open source tool, so we welcome any and all feedback in GitHub. Explore other Issues and create your own here.
You can also explore the documentation for more tips on using this new Sync feature.
Download Studio for freeRead more https://wordpress.com/blog/2025/01/06/studio-sync/
Laravel provides several approaches to control how dates are formatted when models are serialized to arrays or JSON. From global formats to attribute-specific customization, you can ensure consistent date presentation across your application.
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use DateTimeInterface;
class BaseModel extends Model
{
protected function serializeDate(DateTimeInterface $date)
{
return $date->format('Y-m-d H:i:s');
}
}
Let's explore a practical example of managing different date formats in a booking system:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Casts\Attribute;
use DateTimeInterface;
class Booking extends Model
{
protected $casts = [
'check_in' => 'datetime:Y-m-d',
'check_out' => 'datetime:Y-m-d',
'created_at' => 'datetime:Y-m-d H:i:s',
];
protected function serializeDate(DateTimeInterface $date)
{
return $date->format('Y-m-d H:i:s');
}
protected function checkInFormatted(): Attribute
{
return Attribute::make(
get: fn () => $this->check_in->format('l, F j, Y')
);
}
protected function duration(): Attribute
{
return Attribute::make(
get: fn () => $this->check_in->diffInDays($this->check_out)
);
}
public function toArray()
{
return array_merge(parent::toArray(), [
'check_in_formatted' => $this->checkInFormatted,
'duration_nights' => $this->duration,
'human_readable' => sprintf(
'%s for %d nights',
$this->check_in->format('M j'),
$this->duration
)
]);
}
}
Laravel's date serialization features ensure consistent date formatting throughout your application while providing flexibility for specific use cases.
The post Customizing Model Date Formats in Laravel appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/date-formats
If you’ve been hearing “Can I log into your product with my Okta account?” from you customers lately (or the scarier “Do you support ADFS?“), it may be time to add Enterprise SSO to your product.
It can seem daunting, but don’t worry - with PropelAuth, you can easily:
➡ Check out the full guide now
The post Add Enterprise SSO/SAML to your product today appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/add-enterprise-ssosaml-to-your-product-today
Page 10 of 1400