http://img.youtube.com/vi/_S6ErypDAtk/0.jpgToday I’m answering one question from the comments, with a demo example. In my experience, it’s no big deal to have 10-20 extra fields in the Users table. What is your experience?Laravel News Links
A look at new features and improvements since the original Laravel 8.0 release: Collections
https://protone.media/img/header_social.jpg
Hey! Did you hear about Launcher? 🚀
It’s an easy-to-use deployment tool to deploy your Laravel apps containerized with Docker. Launcher is remarkably easy, and still, you can fully customize it to your needs. Start launching your sites in just minutes using our free 14-day trial.
A look at new features and improvements since the original Laravel 8.0 release: Collections
This year, the Laravel team announced a new release schedule for major Laravel versions. Instead of a major version every six months, we now get a major release every 12 months. This change didn’t stop the team from improving the current release, Laravel 8. Over the last 14 months, it got so many great updates that you might have lost track of it.
I’ll release a series of blog posts to highlight some of the best features and improvements since the release of v8 back in September 2020. In total, I’ve gathered over 100 code examples, so I’ll split this blog post into five or six posts and group them by topic. Let’s start with Collections!
I got most code examples and explanations from the PRs and official documentation.
v8.8.0 Added Illuminate\Collections\Traits\EnumeratesValues::pipeInto() (#34600)
The pipeInto method creates a new instance of the given class and passes the collection into the constructor:
// Before:
Category::get()->pipe(function (Collection $categories) {
return new CategoryCollection($categories);
});
// After:
Category::get()->pipeInto(CategoryCollection::class);
v8.16.0 Added Collections splitIn methods (#35295)
Split a collection into a certain number of groups, and fill the first groups completely.
$array = collect([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
// will return 3 chunks of sizes 4, 3, and 3.
$array->splitIn(3);
v8.30.0 Added isSingle() method to Collections (#36428)
Determine if the collection contains a single element.
collect([])->isSingle(); // false
collect([1])->isSingle(); // true
collect([1, 2])->isSingle(); // false
v8.39.0 Added Illuminate\Collections\Collection::sole() method (#37034)
Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception.
$collection = collect([
['name' => 'foo'],
['name' => 'bar'],
['name' => 'bar'],
]);
// $result will be equal to: ['name' => 'foo']
$result = $collection->where('name', 'foo')->sole();
// $result will be equal to: ['name' => 'foo']
$result = $collection->sole(function ($value) {
return $value['name'] === 'foo';
});
// This will throw an ItemNotFoundException
$collection->where('name', 'INVALID')->sole();
// This will throw a MultipleItemsFoundException
$collection->where('name', 'bar')->sole();
v8.48.0 Added sliding() (#37751)
Create chunks representing a “sliding window” view of the items in the collection.
collect([1, 2, 3, 4, 5])->sliding(2);
// [[1, 2], [2, 3], [3, 4], [4, 5]]
v8.52.0 Allow shift() and pop() to take multiple items from a collection (#38093)
$collection = collect([1, 2, 3, 4, 5]);
$collection->pop(3);
// [5, 4, 3]
$collection->all();
// [1, 2]
$collection = collect([1, 2, 3, 4, 5]);
$collection->shift(3);
// [1, 2, 3]
$collection->all();
// [4, 5]
v8.64.0 Added Illuminate/Collections/Collection::hasAny() (#39155)
Determine if any of the keys exist in the collection.
// This example would return true:
collect(['first' => 'Hello', 'second' => 'World'])->hasAny(['first', 'fourth']);
// While this would return false:
collect(['first' => 'Hello', 'second' => 'World'])->hasAny(['third', 'fourth']);
In the next blog post, I’ll take a look at the Database and Eloquent improvements!
Laravel News Links
VIDEO: TTAG’s All-Star Supreme Court After Action Legal Analysis
https://cdn0.thetruthaboutguns.com/wp-content/uploads/2021/11/Screen-Shot-2021-11-03-at-12.06.43-PM.png
As promised, TTAG assembled a who’s who of Second Amendment legal minds to give their highly educated opinions and analysis of this morning’s arguments in the New York Second Amendment case before the Supreme Court. See below for brief descriptions of the participants.
The discussion lasted about 40 minutes and was ably lead by our own LKB. Here’s video . . .
Joseph Greenlee, Firearms Policy Coalition senior attorney and Director of Constitutional Studies.
Dave Kopel, Research Director of the Independence Institute, Associate Policy Analyst at the Cato Institute, and adjunct Professor of Advanced Constitutional Law at the University of Denver’s Sturm College of Law. Follow him at davekopel.org.
Eugene Volokh, Gary T. Schwartz Distinguished Professor of Law at UCLA and proprietor of the popular Volohk Conspiracy blog at Reason.com.
Cody Wisniewski, Director of the Mountain States Legal Foundation’s Center to Keep and Bear Arms.
The Truth About Guns
MySQL Performance Monitoring Tools and the Most Important Metrics to Monitor
https://blog.devart.com/wp-content/uploads/2021/08/dbforge-studio-for-mysql-download.png
The article covers the key performance metrics available in MySQL that can help users improve and optimize query performance in MySQL databases. In addition, there is a brief overview of some MySQL performance monitoring tools. MySQL is an open-source relational database that a lot of users prefer to utilize in their work and daily operations […]
The post MySQL Performance Monitoring Tools and the Most Important Metrics to Monitor appeared first on Devart Blog.
Planet MySQL
Comic for November 03, 2021
https://assets.amuniversal.com/89f17b901343013a7fd8005056a9545d
Thank you for voting.
Hmm. Something went wrong. We will take a look as soon as we can.
Dilbert Daily Strip
TFB Review: The .22 LR Ruger American Rimfire Rifle
https://www.thefirearmblog.com/blog/wp-content/uploads/2021/10/00-FEATURED-180×180.jpg
We all love a big boom. The thump of a .308 into your shoulder and the smack of a 175-grain chunk of metal on a steel target are thrilling. Sometimes, though, a large caliber is too much for the job. Small, swift, and effective, the .22 LR cartridge is a classic for a reason. Though […]
The post TFB Review: The .22 LR Ruger American Rimfire Rifle appeared first on The Firearm Blog.
The Firearm Blog
Comic for November 02, 2021
https://assets.amuniversal.com/86e742401343013a7fd8005056a9545d
Thank you for voting.
Hmm. Something went wrong. We will take a look as soon as we can.
Dilbert Daily Strip
Larastan v1.0 Released
https://laravelnews.imgix.net/images/larastan.png?ixlib=php-3.3.1
After initially writing about Larastan back in 2018, we are pleased to see the release of Larastan v1.0 this week, a package to help analyze Laravel application code:
Larastan is a development dependency that adds static analysis to Laravel, improving developer productivity and code quality. At the core, it’s a PHPStan wrapper for Laravel and helps you find errors in your code through static analysis. It helps catch bugs before you even write tests for the code:
- Adds static typing to Laravel to improve developer productivity and code quality
- Supports most of Laravel’s beautiful magic
- Discovers bugs in your code without running it
You can use Larastan to analyze application code as well as use it to analyze your Laravel packages.
Getting started in your new or existing Laravel project is as easy as installing the package and configuring PHPStan:
1composer require nunomaduro/larastan --with-dependencies --dev
2
3# after setting up a `phpstan.neon` file in the root
4# of your project, you can analyze your code:
5./vendor/bin/phpstan analyse
If you find this package useful, consider sponsoring the developers Nuno Maduro and Can Vural on GitHub. The Larastan project page has links to all the ways you can sponsor their work.
You can learn more about this package, get full installation instructions, and view the source code on GitHub. I’d recommend checking out the rules specific to Laravel applications, with configurable options.
You can see the complete list of new features and updates below and the diff between v0.7.15 and v1.0.0. Also, the following release notes are directly from the changelog:
v1.0.0
Added
- Dynamic method return type extension for
Enumerable::filterin #981 - New rule to check for relation existence in #985
-
rescueparameter ofrescuefunction now accepts theThrowableby @sebdesign in #989 - New
CheckJobDispatchArgumentTypesCompatibleWithClassConstructorRulerule in #991 - Added
non-empty-stringtypes in stubs. c5b81cf
Fixed
- PHPStan 1.0 compatibility in #968
Laravel News
Kyle bagged himself some real quality people
https://gunfreezone.net/wp-content/uploads/2021/11/FDHKc66UYAErVDI.jpeg
The upside of social media is that the professional media no longer has a monopoly on information.
The media is trying to do its best to George Zimmerman Kyle Rittenhouse.
Social media has done its homework.
This is the skateboarder who Kyle canoed.
None of that expressly justified shooting him, but it makes it harder to believe that Huber was the good guy trying to help people.
This information also has a way of swinging jury opinions.
Good.
I shed no tears over a wife beater who got split in half by a 223.
Speaking of Dune
https://gunfreezone.net/wp-content/uploads/2021/10/tumblr_nz9rdunO6L1rl43cyo1_1280.png
Dune is a great book.
Like Starship Troopers (another favorite) and Atlas Shrugged, the plot is really just a way of making a philosophical and political treatise into something enjoyable to read.
And it’s great.
I highly recommend reading or twice. The first time abridged to get the plot, then again unabridged to focus on the philosophy and not worry about plot points.
But, if you really want the most distilled understanding of Dune, the best is a Tumblr page called Calvin & Muad’Dib.
It’s just Calvin & Hobbes strips with the original text replaced with Dune quotes.
It’s epic.
How very true and how much we see this today.
How valuable the philosophy and how clearly it’s shown in a simple comic strip.
I love it.

