VIDEO: High School Wrestling Champ Slams, Pins New Mexico Kidnapper

VIDEO: High School Wrestling Champ Slams, Pins New Mexico Kidnapper

https://ift.tt/3aLhfy4

A 16-year-old high school wrestler that just won a district title; well, that’s already a big man on campus. When that same teen saves the lives of three little kids, overpowering a grown man to do so? Now he just became legend. Such is the latest podium for Canaan Bower, who took on and pinned a kidnapper in Las Cruces, N.M. recently. The athlete slammed the thug to the ground, then held him until police arrived.

Coronavirus Home Defense, Home Defense Checklist, COVID-19 checklist

RELATED STORY

5 Things to Keep in Mind for Your Coronavirus Home Defense Checklist

Canaan Bower Pins  New Mexico Kidnapper

It turned out a very good thing the wrestler appeared on the scene. The attacker, 22-year-old Daniel Arroyo Beltran, allegedly assaulted a woman and her three young children. Closed circuit security footage captured the man repeatedly attempt to kidnap the three kids. When a bystander attempted to hold the door, keeping Beltran out of a convenience store where the woman and kids took refuge, Beltran forced his way in and attacked. He punched the man several times, with blood spurting to the floor.

That’s when the champion wrestler, pumping gas outside, saw the commotion and leapt into action. He ran into the store, confronted Beltran, and put his wrestling skills to work.

“So my son – who just won the wrestling district championship weeks ago – just came up behind this guy and body-slammed him and got him in a chokehold and waited for the police to show up,” Troy Bower, Canaan’s father, told lcsun-news.com.

The Dona Ana County Sheriff’s Office thanked Bower for “stepping up to save the lives of two children and potentially many others.”

Even UFC President Dan White took notice of the wrestling champ and his bravery. Noting the current coronavirus and social distancing requirements, White said he’d love to meet Bower, who he called “AWESOME!!!,” in the future.

For a wrestler, at any age, it doesn’t get much better than that.

The post VIDEO: High School Wrestling Champ Slams, Pins New Mexico Kidnapper appeared first on Personal Defense World.

guns

via Personal Defense World https://ift.tt/2Arq2GB

April 1, 2020 at 06:08AM

Introducing Metabase, a Simple and Powerful Analytics Tool

Introducing Metabase, a Simple and Powerful Analytics Tool

https://ift.tt/2X0JAfP

metabase

metabaseRecently I was looking for some simple way to analyze and create graphs from data stored in MySQL tables. I know Grafana can also plot graphs from MySQL tables, but somehow it felt like overkill and you are not using the traditional SQL syntax there. So I was searching for another solution, and it actually took me a while to find it. I might have used the wrong keywords when searching, or the SEO is not the best for this site/project, but in the end, I found Metabase.

In this blog post, I would like to highlight this open source project because I found it very simple and it does the job perfectly for what I wanted it for.

What Is Metabase?

I would describe Metabase as a tool that can provide you a graphical interface to create business intelligence and analytics graphs in minutes. It does not require any previous SQL knowledge, and it has a nice interface where you can simply make analytics with just a few clicks.

Is It Only for MySQL?

It supports a lot of backend databases:

  • MySQL
  • Postgres
  • Druid
  • SQL Server
  • Redshift
  • MongoDB
  • Google BigQuery
  • SQLite
  • H2
  • Oracle
  • Vertica
  • Presto
  • Snowflake
  • SparkSQL

Installation

It is very simple; you can just call the JAR file or run a docker container and it is done. You can run on AWS Elastic Beanstalk, or on Heroku, or even on Kubernetes.

After installation, you only have to add your datasource and you are good to go.

Creating a Graph

Using a test IMDB database, we simply graph how many movies were created per year. It takes only a few seconds and a few clicks. Of course, we can write a query by ourselves as well, and it is able to plot the result without any problems.

It Has a Lot of Features

Metabase has a lot of features and settings, but here I will just mention a few:

  • Work with large databases and configure when and how they should scan the data.
  • It can handle multiple users.
  • It can handle permissions.
  • It works with Slack and you can create questions/graphs from Slack.
  • You can create dashboards where you can add your graphs.
  • You can share dashboards and graphs.
  • Activity log
  • Alerts

Conclusion

If you are looking for a very simple data visualization or business analytics tool, I would definitely recommend taking a look at Metabase. Please let us know what you think if you are already using it!

technology

via MySQL Performance Blog https://ift.tt/1znEN8i

April 1, 2020 at 03:25PM

Take a Virtual Trip to Disney World

Take a Virtual Trip to Disney World

https://ift.tt/2R2qLVL

If, a few weeks ago, you’d told your kids that you were all going to TAKE A TRIP TO DISNEY WORLD and then added the caveat, “from the comfort of our own home,” chances are there would have been a mutiny. But, as we all know, things have changed. Standards have been lowered. Now, riding Splash Mountain from the living room couch might not seem like such a bad idea.

We’ve written before about how you can use YouTube videos to prepare kids for potentially anxiety-producing events—such as riding a rollercoaster. But you can also use those same videos to make your way across Magic Kingdom without ever needing to take a step, complain about the length of a line or manage a meltdown.

As Christina Marfice reminds us on Scary Mommy, there are entire channels on YouTube that provide videos taken by riders on Disney parks attractions:

That means anyone with a device and an internet connection can relive the magic. And it’s even better if you have a virtual reality headset or smartphone mount. Then, the videos become fully immersive experiences, basically like being back at Disneyland before the world almost totally shut down.

Is it the same as actually being on the ride? As someone who has been to Disney World a handful of times, I can categorically state that it is not. But are some of the ride videos surprisingly satisfying? They are—especially now, when the thought of being in such a germy place, among tight crowds of people, seems like such a quaint concept from a more innocent era.

So where to start? You don’t have to plan your day around your FastPass times and you can bounce back and forth across the park in mere seconds. Since I’m the one writing this and Pirates of the Caribbean is my favorite ride, let’s start there.

All those people! Touching all the surfaces! And then touching their faces with abandon! 2019 really was a simpler time. That was fun, but I’ve got Splash Mountain on the brain; let’s go there next.

If your kids like a bit of a thrill (but not too much!), the Barnstormer roller coaster is a good option. I chose this particular video because it’s a gloomy, rainy day at Disney, the park is basically deserted and it just feels … right:

If you prefer more people and more sunshine, try the Slinky Dog Dash roller coaster. Yes, I know, this ride is in an entirely different park (Hollywood Studios). Does it matter? No, it does not—there are no rules here!

Is it time for the Frozen ride, yet? Yes, I thought so. Come on, let’s head to Epcot; it’s right over here:

Okay, I wasn’t even going to click on the video for the Avatar ride (Animal Kingdom) because it’s such an incredible in-person experience that I was sure I would be disappointed. I was not. If I can’t be physically on this ride right now, at least I’ve got this:

If you haven’t had enough, the LMG Vids YouTube Channel has playlists of rides from a variety of theme parks, including all the Disney parks in Orlando and California, Legoland California, Knott’s Berry Farm, and the Tokyo and Hong Kong Disneylands.


Meet the smartest parents on Earth! Join our parenting Facebook group.

geeky,Tech,Database

via Lifehacker https://lifehacker.com

April 1, 2020 at 02:03PM

The Best String Trimmers

The Best String Trimmers

https://ift.tt/2p0nDLT

The Best String Trimmers

After using 10 string trimmers to level 12,598 square feet of an overgrown field and trimming over 6,000 linear feet along walls and fences, we’re convinced the best string trimmer (also known as a weed wacker or a weed eater) is the Ego ST1502-SF Power+ 15" String Trimmer.

technology

via Wirecutter: Reviews for the Real World https://ift.tt/2gcK1uO

March 31, 2020 at 04:22PM

5 Powerful Tools for Digital Marketing Success

5 Powerful Tools for Digital Marketing Success

https://ift.tt/2UTwaj1

Photo by Lukas Blazek on Unsplash

Today, the role of digital in your overall marketing strategy is unquestionable. Moreover, the rapid growth of digital marketing has brought with it a range of methods and solutions for making the most of what the Internet has to offer. From SEO to PPC to social, video, email, and beyond, there are more options for digital marketing now than ever before. However, utilizing them for real digital marketing success is becoming increasingly complex.

RELATED ARTICLE: DON’T LOSE YOUR STARTUP TO CHAOS

Digital Marketing Success Will Keep You Ahead of the Pack

Staying ahead of the competition is no longer something you can do alone. There’s simply too much work to do. For example, your success with digital marketing will take planning, implementing, analyzing, and improving the elements that make up your digital strategy. Therefore, to maintain a steady pace, consider utilizing these five powerful tools for digital marketing success.

Proof

The aptly named Proof uses the power of social proof messaging to boost your website’s conversion rates.

For example, Proof will send notifications, reviews, and videos to targeted customers after they leave your site. Proof works to enhance the perception of your brand. Their experts will also optimize your website design for better conversion rates. So give them a chance to help you enjoy more digital marketing success.

HubSpot

HubSpot is designed to serve as the central platform for managing your digital marketing efforts. Its tools can lead to more success online.

It offers numerous free tools for new businesses to get started with. For example, you’ll find web forms and live chat software for capturing leads. You can also make use of their basic analytics and customer relations management features without spending any money. Just imagine! More digital marketing success, for free.

However, if you want even more digital marketing success, you can have it. For example, expect some impressive marketing automation features when moving into the paid tiers. This includes integration with other software in the category. It will also help you develop a powerful tool for growing traffic, converting leads, and increasing ROI on marketing campaigns.

Plus, you’ll get help with improving close rates for deals with their effective sales tools.

SendGrid

When it comes to digital success with email marketing, a dedicated tool for creating, executing, and managing campaigns is a must. SendGrid is one of them. Its multiple features include promotional emails, automation, and design tools.

That said, its popularization has spawned a number of SendGrid alternatives that are worth looking into. This is because some of these alternatives have lower pricing tiers or longer lists of features.

So be sure to check them out before settling on a specific solution. Any one of them could lead you into more digital marketing success.

Survey Anyplace

Are you looking to improve user experience? Do you want to design a better product or learn more about your market? Or are you simply interested in having more digital marketing success overall?

Customer surveys are a great way to achieve any of these objectives. This is because Survey Anyplace aims to reduce the chances of participants abandoning your survey. They do this by helping you build simple, well-designed forms that are mobile compatible.

Yoast

This popular WordPress plugin is a handy tool for optimizing your website content search engines. Regularly updated to reflect the latest algorithms, Yoast helps you identify the best content, focus keywords, and internal links.

These optimizations will improve your rankings and give you more digital marketing success. Yoast also evaluates the readability of your pages for an additional boost.

The Right Tools Will Bring Greater Digital Marketing Success

You can build a comprehensive and successful digital marketing strategy. However, you cannot do it without the right tools.

But whether you’re looking to reduce your team’s workload with automation, gain greater insights into the effectiveness of your endeavors, or explore new avenues for marketing your business online, there’s a digital tool that can help you make it happen.

The post 5 Powerful Tools for Digital Marketing Success appeared first on Business Opportunities.

business

via Business Opportunities Weblog https://ift.tt/2CJxLjg

March 31, 2020 at 11:09AM

Apple acquires Dark Sky weather app, and that’s bad news for Android users

Apple acquires Dark Sky weather app, and that’s bad news for Android users

https://ift.tt/2WYoMG3

  • An example of Dark Sky’s maps from the desktop Web version.

  • Here’s a precipitation heatmap from the iOS version.

  • This is the main view in the iOS app.

    Dark Sky

  • And here’s the multi-day forecast in the app.

    Dark Sky

  • This push notification went out to iOS users today.

Popular weather app and data-collection service Dark Sky has been acquired by Apple for an undisclosed sum, a blog post from the Dark Sky team announced. The post claims that Dark Sky will now “reach far more people, with far more impact, than we ever could alone.”

The iOS app will not see any changes “at this time,” and it will continue to be listed on the App Store. Android and Wear OS are a different story, though. The Android app will no longer be available for download, and “service to existing users and subscribers will continue until July 1, 2020, at which point the app will be shut down.” Active subscribers will get a refund.

As for the website, which is also popular:

Weather forecasts, maps, and embeds will continue until July 1, 2020. The website will remain active beyond that time in support of API and iOS App customers.

A lot seems to be up in the air about where this will go in the long term, though. Dark Sky is notable in part for its big data-driven Dark Sky Forecast API, which provides customers with hyper-local weather data for use in their own apps or services. That API will no longer accept new signups, though “service for existing customers is not changing today.” The API will function for existing customers through the end of 2021.

That API and the related data operation may be the main reason Apple was interested in Dark Sky; the service is known for providing smart notifications and highly localized data about precipitation, among other things, in much more detail than Apple’s own Weather app.

The blog post also notes that Dark Sky will now be subject to Apple’s privacy policy, and the app’s developer is already listed as “Apple” in the App Store.

Listing image by Dark Sky

geeky

via Ars Technica https://arstechnica.com

March 31, 2020 at 03:37PM

The Best External Optical Drives for DVDs and Blu-rays

The Best External Optical Drives for DVDs and Blu-rays

https://ift.tt/2xOwBSg

The Best External Optical Drives for DVDs and Blu-rays

Modern laptops rarely include optical drives for CDs, DVDs, or Blu-rays, and music and video streaming services make it so you never need to play a disc if you don’t want to. But if you have decades’ worth of CDs, DVDs, or Blu-rays to watch, or home movies to archive, the Asus ZenDrive U9M is the best USB DVD burner, and LG’s BP60NB10 is the best Blu-ray burner. Both drives are quick to rip data from discs to your computer or to burn new discs with your own data, and both work with PCs and Macs and are reasonably priced.

technology

via Wirecutter: Reviews for the Real World https://ift.tt/2gcK1uO

March 31, 2020 at 03:38PM

Laravel Validation 101, Controllers, Form Requests, and Rules

Laravel Validation 101, Controllers, Form Requests, and Rules

https://ift.tt/3bCoetp

Laravel Validation 101, Controllers, Form Requests, and Rules

A core part of any project is understanding how to validate the incoming request from your users and in this tutorial let’s look at how we can setup validation with our controllers, form requests, and rules.

Working with Controllers

By default, all Laravel controllers that extend from the Base Controller inherit the ValidatesRequests trait.

The ValidatesRequests trait gives you access to the validate method in your controller methods.

For example, say the user is creating an Article:

They may be entering a name, and some content for this article, along with a date to publish. Your controller validation may look like one of these, which are all valid:

public function store(Request $request) { $this->validate($request, [ 'name' => 'required|string', 'body' => 'required|string', 'publish_at' => 'required|date_format:Y-m-d H:i:s' ]); // The request validated and this code will get run ... } public function store(Request $request) { // Note: the array syntax is also available $request->validate([ 'name' => ['required', 'string'], 'body' => ['required', 'string'], 'publish_at' => ['required', 'date_format:Y-m-d H:i:s'], ]); // The request validated and this code will get run ... } public function store() { request()->validate([ // Validation Rules... ]); // The request validated and this code will get run ... } public function store() { $this->validate(request(), [ // Validation Rules... ]); // The request validated and this code will get run ... } 

It should also be noted, that the response to the validate method will be the data that was validated:

public function store(Request $request) { $validatedData = $request->validate([ 'name' => ['required', 'string'], 'body' => ['required', 'string'], 'publish_at' => ['required', 'date_format:Y-m-d H:i:s'], ]); // I know that the only keys in validated data are the ones that were successfully validated, i.e.: name, body, published_at $this->articleService->store($validatedData); } 

Alternatively, you can do this too:

public function store(Request $request) { $request->validate([ 'name' => ['required', 'string'], 'body' => ['required', 'string'], 'publish_at' => ['required', 'date_format:Y-m-d H:i:s'], ]); // I know that the only keys in validated data are the ones that were successfully validated, i.e.: name, body, published_at $this->articleService->store($request->only('name', 'body', 'published_at')); } 

A list of the available validation rules can be found here.

Working with Form Requests

If you would like to extract your validation logic away from your controllers, or you would like to do authorization and validation at the same time, Laravel makes the Form Request class available to you.

You can make a form request class using one of the many built-in Laravel generators:

php artisan make:request StoreArticleRequest 

This will make you the following class in app/Http/Requests by default:

class StoreArticleRequest extends FormRequest { public function authorize() { return true; } public function rules() { return [ // ]; } } 

Form request classes comes with 2 methods, authorize and rules.

Authorize

Authorize lets you prevent the controller code from running if this method returns false. Laravel will throw a 401 unauthorized exception.

An example usage might be:

public function authorize() { return $this->user()->can('create articles'); } 

Rules

The rules method will return our array of rules that was in our controller validate method;

public function rules() { return [ 'name' => ['required', 'string'], 'body' => ['required', 'string'], 'publish_at' => ['required', 'date_format:Y-m-d H:i:s'], ]; } 

Note: You can type-hint any dependencies needed into the rules method.

So, how do we use this class? We type-hint it right into our controller method:

public function store(StoreArticleRequest $request) { // Validation and Rules passed } 

If the validation fails, the user will be redirected back with the errors flashed to the session. If it is an AJAX call, it will be a 422 Unprocessable Entity response.

You may get the validated data just like before:

public function store(StoreArticleRequest $request) { $validatedData = $request->validated(); // Insert into database ... } 

Working with Custom Rule Classes

If there is a validation rule that does not exist as part of the available built-in validation rules, you can create a custom one:

Again, using one of Laravel’s make commands:

php artisan make:rule IsValidStateInUSA 

This will make you the following class in app/Rules by default:

class IsValidStateInUSA implements Rule { public function passes($attribute, $value) { // } public function message() { return 'The validation error message.'; } } 

Your passes method holds the logic for allowing this validation method through. The message method is the message that gets returned if it fails.

Using the example of Is a valid State in the USA, we would need the item passed in to be one of 50 different state codes. It could look like this:

class IsValidStateInUSA implements Rule { public function passes($attribute, $value) { return in_array(strtoupper($value), [ 'AL', 'AK', 'AZ', ... ]); } public function message() { return 'This is not a valid state code in the USA.'; } } 

Then, to use this in your controller or form request, you just add it to the list of validation rules for that key:

public function store(Request $request) { $request->validate([ 'state' => ['required', new IsValidStateInUSA], ]); ... } 

Handling Validation Errors

When validation fails, Laravel will automatically redirect back, with an $errors variables flashed in the session.

You can easily create a file called messages.blade.php and include in your master layout file like this:

@if($errors->any()) <div class="alert alert-danger" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> @foreach($errors->all() as $error) <br/> @endforeach </div> @endif 

Which will display all errors flashed to the session, or if you prefer to handle them one by one on a per blade file basis, you can use the blade @error helper:

@error('title') <div class="alert alert-danger"></div> @enderror 

The $message variable will be provided to you inside the @error tag.

Customizing Error Messages

When working with the validate method, you can override the messages with the third parameter:

public function store(Request $request) { $this->validate($request, [ 'name' => 'required|string', 'body' => 'required|string', 'publish_at' => 'required|date_format:Y-m-d H:i:s' ], [ 'name.required' => 'A article name is required', 'body.required' => 'A article body is required', 'publish_at.date_format' => 'The publish at date is not in the correct format.' ]); // The request validated and this code will get run ... } 

When working with a form request class, a messages function can also be implemented to customize the error message for each specific rule:

public function messages() { return [ 'name.required' => 'A article name is required', 'body.required' => 'A article body is required', 'publish_at.date_format' => 'The publish at date is not in the correct format.' ]; } 

For the most up to date documentation and a much more in-depth look at validation, visit the Laravel Documentation.

Filed in: News

programming

via Laravel News https://ift.tt/14pzU0d

March 31, 2020 at 09:02AM

6 Laravel Eloquent Secrets to improve your code

6 Laravel Eloquent Secrets to improve your code

https://ift.tt/2QWPjzu

6 Laravel Eloquent Secrets to improve your code

Eloquent is the default ORM that ships with Laravel. It implements the Active-Record pattern and provides an easy way to interact with your database. Every single model represents a table in your database with which you can work. In this post, we’ll show you more or less hidden secrets, methods, and properties you might not know to improve your code.

Snake Attributes

Snake Attributes are an interesting one. Let’s take a look at what the code says:

/** * Indicates whether attributes are snake cased on arrays. * * @var bool */ public static $snakeAttributes = true; 

Very often, people make a mistake to use this property to change the way how to access properties. Many people believe that if they change this property, they can easily access the attributes using camel-case annotation. That’s not the case. We strongly advise against using it. It is merely there to define whether attributes are camel or snake-cased when the model is output as an array.

If you want to work camel-case based, we recommend you take a look at the package Eloquence by Kirk Bushell.

Pagination

If you use Laravel’s Eloquent ORM, you’re in luck. It provides an easy way to paginate results out of the box. You might be familiar with something like this:

$comments = Comment::paginate(20); 

With this method, you can paginate the comment model with 20 items per page. Changing that value gives you the possibility to define how many items are displayed per page. If you do not specify anything, the default gets applied, which is 15.

Assume that you want to display comments in several places on your website. Always 30 comments per page. Then it would be bothersome if you have to pass the parameter 30 at every place. Therefore you can set a new default value directly on the model.

protected $perPage = 30; 

Appending custom values to models

Eloquent has a great feature called “Accessors”. The feature allows you to add custom fields to models that don’t exist on the model or in the table. It doesn’t matter if you use existing values or define completely new ones. You can return anything. Here is an example of how Accessors work. Given there is a model called User where we put the code below.

function getFullNameAttribute() { return sprintf('%s %s', $this->first_name, $this->last_name); } 

Now you have access to a full_name attribute on the post model, like this:

User::latest()->first()->full_name; 

The problem is now if you return objects, like a collection, this attribute doesn’t get appended to the user model. Add the protected $appends attribute to your model. It accepts an array with one or multiple fields that should automatically be appended from now. This is how it looks like:

protected $appends = ['full_name']; 

Mutators for non-existing columns

Mutators are the opposite of Accessors. You can use them for really cool stuff. For example, to convert different inputs. Let’s show you something. Imagine you want to save a kind of time period. Usually, you always save the smallest possible unit. In our case seconds. For UX reasons, the user doesn’t want to enter seconds, but for example, minutes in one place, or hours in another place. It can all be solved very quickly.

class Video extends Model { public function setDurationInMinutes($value) { $this->attributes['duration_in_seconds'] = $value * 60; } public function setDurationInHours($value) { $this->attributes['duration_in_seconds'] = $value * 60 * 60; } } 

What does it mean? It means that you can use the non-existent column duration_in_minutes on the model, but in the background, the column duration_in_seconds is updated. The same applies to the non-existent column duration_in_hours. This results in the following logic, for example:

class AnyController { public function store() { $video->update([ 'title' => request('title'), 'duration_in_minutes' => request('duration_in_minutes'), ]); } } 

This saves you the calculation in the controller, and you can simply use a non-existent column and use a mutator to map it correctly to the correct column while performing some calculations.

Eager loading with $with

Let’s talk a little about relations. By default, Laravel uses lazy loading. What does that mean in terms of relations? The good thing is that lazy loading saves memory because not all data has to be kept, and we load the data when we need it. Consider this code sample:

$comments = Comment::all(); foreach ($comments as $comment) { echo $comment->user->name; } 

In the example above, we get all comments. Then we loop through the comments and display the username for each comment. The code works, but we run into a problem. Lazy loading now makes sure that the query to get the user is only executed when we want to output the username.

Welcome to your first N+1 problem. Why N+1? N is always the number of comments, and 1 is the query to get the comments at all. For example, if we have 500 comments, then the query to get all comments is fired once and then one query to get the corresponding user – per comment. So 500 + 1 queries. This means that as the number of comments increases, the number of queries increases as well.

To prevent it there is something called eager loading.

$comments = Comment::with('user')->get(); foreach ($comments as $comment) { echo $comment->user->name; } 

That ends in two queries. The first query fetches all comments, and the second query immediately fetches all associated users. In the background, the following happens (simplified):

SELECT id, user_id, body FROM comments; SELECT name FROM users WHERE user_id IN (1,2,3,4,5...); 

Whether 10, 500 or 10000 comments are fetched at the end is not essential. Two queries remain.

You have now seen how you can use eager loading. But only how to use it manually. You can also automate the whole thing so that certain relations are always loaded automatically by eager loading. For this there is a property on the model.

protected $with = []; 

So we can simply set the property protected $with = ['user']; on our Comment model, and from now, the user is automatically loaded at any time.

There are many more possibilities with eager loading. Loading of specific columns only, nested eager loading, multiple eager loadings, and much more. Head over to the Laravel documentation or deep dive into the core.

Model keys

From time to time, there is the need to fetch all IDs of a specific query. It does not matter whether this is a complex query or not. Most people would probably do the following:

User::all()->pluck('id'); 

This works great. But now you get a collection back. To get an array, you would have to pass it to the toArray() method again.

User::all()->pluck('id')->toArray(); 

In most cases, however, this can be shortened. Like this:

User::all()->modelKeys(); 

This method returns an array. In our case, the IDs. It is important to understand that this method does not always necessarily return IDs. It returns, as the name says, all primary keys as an array. The primary keys can be defined in the model. The default is id.

protected $primaryKey = 'id'; 

Filed in: News

programming

via Laravel News https://ift.tt/14pzU0d

March 30, 2020 at 09:22AM

The year of Mario: A ton of classic 3D games reportedly coming to Switch in 2020

The year of Mario: A ton of classic 3D games reportedly coming to Switch in 2020

https://ift.tt/3dFIHPI

Photoshopped image of a video game playing on a incompatible device.
Enlarge /

Our own approximation of

Super Mario Galaxy

on a Switch. Nintendo has yet to confirm a slew of rumors that emerged on Monday morning.

Nintendo / Sam Machkovech

According to a flurry of Monday morning reports, Super Mario is coming back in 2020 in a huge way. And it’s mostly about reliving the Nintendo mascot’s 3D era on Nintendo Switch.

The first rumor domino to fall came from VGC, which pushed forward with a report suggesting “most of Super Mario’s 35-year back catalog” would arrive on Nintendo Switch by the end of 2020, according to “multiple sources.” Nintendo had originally planned to make a physical event out of the announcement during this summer’s E3, VGC reported, but E3 2020 was canceled earlier this month in the wake of organizational woes and coronavirus concerns.

VGC was able to report on one specific game coming to Nintendo Switch, but it wasn’t a remaster. Instead, VGC suggested that the Paper Mario action-RPG series would receive a new entry in 2020.

Soon after, Eurogamer and Gematsu pushed their own reports and named games, also citing “multiple sources.” Eurogamer came forward suggesting Super Mario Galaxy and Super Mario 3D World would receive proper re-releases, while Gematsu added Super Mario 64 and Super Mario Sunshine to the list of expected re-releases. Most classic 3D Mario games have never received a retail or Virtual Console re-release treatment, with Super Mario 64 and its DS remake as exceptions, while the majority of Mario’s 2D exploits are currently available on Switch’s NES and SNES archives, available to paying Nintendo Switch Online subscribers.

Due to the limited nature of these rumors, we’re left wondering exactly what shape these classic Mario games will arrive in. Eurogamer alleges that Super Mario 3D World will launch with “an array of new levels,” but these could either be brand-new or adapted from the similar, 3DS-only entry Super Mario 3D Land (or both). Meanwhile, both Gematsu and Eurogamer mention “high-definition remasters” for older games in the list, but it’s unclear whether these will simply up-res existing assets or include any wholly new content (textures, character models, visual effects).

We’ve already seen what

Super Mario Galaxy

could look like on Nintendo Switch thanks to

a 2018 China-only port of the game for the Nvidia Shield platform

; that system’s hardware is nearly identical to Nintendo Switch. That classic game’s newer version mostly looks identical to its Wii predecessor, save a resolution bump, but it also benefits from a complete 

controller

revision—meaning, no more Wii-mote waggle. We hope Nintendo considers the same control tweak for a Switch port.

All of this news makes a certain corporate-synergy sense in 2020, as VGC points to Nintendo’s interest in promoting its relationship with Universal Studios. A series of Super Mario World attractions are set to open at various Universal Studios theme parks (exactly when is unclear, however), while the Super Mario feature-length, CGI film has remained under a veil of secrecy since its 2017 reveal. (Its last release estimate was “2022.”) A huge summer 2020 announcement slew of Switch games would be a great moment for Nintendo and Universal to show more of those properties off. (By then, we hope Lego’s Super Mario series will have launched, as well.)

When asked to comment on Monday’s reports, a Nintendo representative replied via email: “We have nothing to announce on that topic.”

geeky

via Ars Technica https://arstechnica.com

March 30, 2020 at 02:31PM