WATCH: Columbus PD Shoots 16-Year-Old Girl Trying to Stab Another Girl

https://cdn.athlonoutdoors.com/wp-content/uploads/sites/8/2014/12/riverside-police-know-your-limit-breathalyzer.jpg

Tragedy struck Columbus, Ohio, yesterday, again involving police and the death of a Black suspect. In this case, a Columbus Police officer shot and killed 16-year-old Ma’Khia Bryant Tuesday. However, body cam footage clearly shows Bryant wielding a knife, attempting to cut another girl.

Riverside Police Know Your Limit program breathalyzer

RELATED STORY

Riverside Police’s ‘Know Your Limit’ Program Allows For Free Breathalyzers

16-Year-Old Ma’Khia Bryant Wielded Knife Before Fatal Shooting

The fatal incident occurred just before the reading of the Derek Chauvin guilty verdict in Minnesota. Locally, the shooting comes two months after another officer faced indictment for the fatal shooting of 47-year-old Andre Hill, also Black. The connections caused immediate reaction across the country, criticizing law enforcement.

“As we breathed a collective sigh of relief today, a community in Columbus felt the sting of another police shooting,” Tweeted Ben Crump, George Floyd’s family attorney.

But this incident appears different from others. It began when police arrived, finding a group of teens in a driveway. Footage shows one teen move on another, threatening with a knife. An officer clearly yells several commands, but the suspect lunges anyway. He then fires several shots, ultimately killing Bryant.

“We know based on this footage, the officer took action to protect another young girl in our community,” Columbus Mayor Andrew Ginther said at the news conference, reported CNN. “But a family is grieving tonight and this young (16)-year-old girl will never be coming home.”

Snapping Back at Critics

But former law enforcement officer and conservative media personality Brandon Tatum went further, calling the shooting “justified.” Tatum posted a video where he provides expert analysis. He immediately points out how this large crowd of people fail to disperse upon police arrival. He illustrates one man kicking a female in the head. Tatum then shows slow-motion proof of the suspect lunging at another female with a knife.

“She pulls out a knife in front of the cops,” Tatum said. “She pulls out a knife. Look at what she does with the knife! Look at what she does with the knife! She’s going for this girl’s throat, with the knife. She’s trying to stab her in the head, with this knife. And the officer shot her.”

But Tatum makes an even greater point, hitting the very message critics drive home. A 16-year-old girl dead; some critics of law enforcement simply won’t accept she should be shot by police. It’s just too horrific for some to comprehend. But in this instance, Tatum says one life taken, however tragic, saved another.

“An officer has an obligation to preserve the life of other people, not just the police officer,” Tatum said. “So if you see a person going to kill another person, which is what she’s doing with this knife, when you see a person attempting to kill another person, you have to use deadly force to save this person’s life.”

The post WATCH: Columbus PD Shoots 16-Year-Old Girl Trying to Stab Another Girl appeared first on Tactical Life Gun Magazine: Gun News and Gun Reviews.

Tactical Life Gun Magazine: Gun News and Gun Reviews

Can Velveeta Cheese Stop a Bullet?

https://theawesomer.com/photos/2021/04/velveeta_vs_bullets_t.jpg

Can Velveeta Cheese Stop a Bullet?

Link

We’re pretty sure you can stop a bullet with enough layers of any substance. DemolitionRanch took a bunch of Kraft’s processed cheese bricks and fired into them to see how much it would take to stop various ammunition in its tracks. Spoiler alert: it’s possible he needs a lot more cheese.

The Awesomer

Site of Harriet Tubman’s Family Home Uncovered in Maryland

https://i.kinja-img.com/gawker-media/image/upload/c_fill,f_auto,fl_progressive,g_center,h_675,pg_1,q_80,w_1200/wf4n0sfm51goszguzbmz.jpg

Harriet Tubman, in a photo dating back to between 1860-75.
Image: Library of Congress (AP)

The site of a 19th-century cabin belonging to the family of Harriet Tubman has been uncovered in Maryland. It’s a significant find, as the location of the site, along with the discovery of numerous artifacts, could offer fresh insights into the abolitionist hero’s formative years.

Archaeologists working for the Maryland Department of Transportation, State Highway Administration, uncovered the site near Church Creek, which is close to the state’s eastern shore. Found next to a marsh, the site once hosted a cabin owned by Ben Ross, the father of renowned abolitionist Harriet Tubman, born Araminta Ross. Tubman escaped slavery and later lead many others to freedom via the Underground Railroad.

“The significance of the discovery of the homesite of my great-great-great-grandfather Ben Ross, and of a spellbinding assortment of artifacts that were once held in the hands of the man himself, but have since been long-inhumed in the soggy Dorchester County soil, is truly inestimable,” Douglas Mitchell, a descendant of Ben Ross, said in a press release.

Various artifacts found at the site.
Image: Maryland Department of Transportation

The finding is significant, he said, because it holds the “promise of both deepening and broadening our understanding of the remarkable life not only of the patriarch and his beloved wife, but also, of course, that of his legendary daughter and heroine, Harriet Tubman.”

G/O Media may get a commission

The remnants of this former home were discovered on property recently acquired by the U.S. Fish and Wildlife Service and added to the Blackwater National Wildlife Refuge in Dorchester County, Maryland. Ross acquired the 10 acres of property in a will in the early 1840s.

The team working at the site.
Image: Maryland Department of Transportation

Historical documents, including wills and deeds, led the archaeologists, headed by Julie Schablitsky, to the general area of the former cabin. Searches with metal detectors began last November, resulting in the discovery of a coin dating back to 1808, as The Guardian reports. A return visit in March yielded a trove of 19th-century artifacts, including nails, bricks, glass, dish fragments, and a button. A subsequent analysis of these artifacts tied them to the Ross home, and an official announcement about the discovery was made on April 19 at the Harriet Tubman Underground Railroad Visitor Center.

“The importance of discovering Ben Ross’ cabin here is the connection to Harriet Tubman. She would’ve spent time here as a child, but also she would’ve come back and been living here with her father in her teenage years, working alongside him,” explained Schablitsky in the press release. “This was the opportunity she had to learn about how to navigate and survive in the wetlands and the woods. We believe this experience was able to benefit her when she began to move people to freedom.”

Much of the Ross home is either gone or buried, but the surroundings still provide a glimpse of how it looked during Tubman’s time. The newly discovered site will now be added to the Harriet Tubman Underground Railroad Byway—a 125-mile (200-km) self-guided scenic drive highlighting more than 30 sites associated with Harriet Tubman. Artifacts found at the site will eventually go on display at the nearby Harriet Tubman Underground Railroad Visitor Center.

More: Three African skeletons found in Mexico show the horrors of early slavery in the New World.

Gizmodo

A lightweight Laravel package to track changes over time


I’m proud to announce that our team has released a new package called spatie/laravel-stats. This package is a lightweight solution for summarizing changes in your database over time.

Tracking changes #

Here’s a quick example where we will track the number of subscriptions and cancellations over time.

First, you should create a stats class.

use Spatie\Stats\BaseStats;

class SubscriptionStats extends BaseStats {}

Next, you can call increase when somebody subscribes and decrease when somebody cancels their plan.

SubscriptionStats::increase(); 
SubscriptionStats::decrease() 

With this in place, you can query the stats. Here’s how you can get the subscription stats for the past two months,
grouped by week.

use Spatie\Stats\StatsQuery;

$stats = StatsQuery::for(SubscriptionStats::class)
    ->start(now()->subMonths(2))
    ->end(now()->subSecond())
    ->groupByWeek()
    ->get();

This will return an array like this one:

[
    [
        'start' => '2020-01-01',
        'end' => '2020-01-08',
        'value' => 102,
        'increments' => 32,
        'decrements' => 20,
        'difference' => 12,
    ],
    [
        'start' => '2020-01-08',
        'end' => '2020-01-15',
        'value' => 114,
        'increments' => 63,
        'decrements' => 30,
        'difference' => 33,
    ],
]

Instead of manually increasing and decreasing the stat, you can directly set it. This is useful when your particular stat does not get calculated by your own app but lives elsewhere. Using the subscription example, let’s imagine that subscriptions live elsewhere and that there’s an API call to get the count.

$count = AnAPi::getSubscriptionCount(); 

SubscriptionStats::set($count);

By default, that increase, decrease and sets methods assume that the event that caused your stats to change happened right now. Optionally, you can pass a date time as a second parameter to these methods. Your stat change will be recorded as if it happened at that moment.

SubscriptionStats::increase(1, $subscription->created_at); 

How it works on under the hood #

The implementation of this package is simple. The basic principles of event sourcing are being used: we don’t store a result, but only the changes.

The package stores all “events” in the stats_event table

screenshot

Inside the StatsQuery class, you’ll find the heart of the package. In its get function, you can see that all events for a given period are retrieved, summarized and mapped to DataPoint classes.

In closing #

We are going to use laravel-stats in Flare, our exception tracker for Laravel/PHP/JavaScript projects, to keep tracker of changes in subscribers and other key metrics. We hope that the package can be helpful in your projects as well.

As mentioned above, the package uses a lightweight event sourcy approach. If you want to know more about event sourcing, check out our upcoming premium course on event sourcing in Laravel.

I’d like to thank my colleague Alex, who did the bulk of the work creating spatie/laravel-stats.

Do also take a look at this list of packages our team has created previously. I’m sure there’s something there for your next project.

Laravel News Links

Hiking Survival: 13 Ways to Stay Alive in the Woods

https://www.pewpewtactical.com/wp-content/uploads/2021/03/Parent-Bug-Out-Bag-12-2048×1536.jpg

If there’s one place you don’t want something bad to happen, it’s when you’re 20 miles into the woods, and there are no signs of civilization anywhere.

The woods aren’t exactly an inherently safe place.

3. Hiking with Kelty MAP
What lurks in these woods?

That’s not to say that you’re walking into a green death trap every time you hit a trail, but it is to say that nature (and people) can be a beast.

As such, it’s best to be prepared to face whatever curveball may get thrown your way.

Unfortunately, I’ve spent enough years in the woods to see people placing themselves in bad situations.

Ralphie Danger

But having a bit of pre-planning in place means the difference between life and death.

Out in the woods, you’re truly on your own, and you need to be able to do what it takes to keep yourself alive.

Thankfully, there are a number of steps that we can take to ensure that we’ve done what we can to stay safe as we enjoy the beauty of the woods.

5. The Woods Wow
I mean, c’mon. You don’t get this in the city.

And guess what – we’ve narrowed down some of this advice for you.

So without further ado (sorry, I’ve been reading Shakespeare lately), here are the top tips to consider before your next hike.

Ways to Stay Alive on Hikes

1. Tell Someone Where You’re Going and When You’ll Be Back

Arguably, this is one of the most important things you can do to stay alive while out in the woods.

If you’ve ever seen 127 Hours — that movie where the guy has to cut his arm off with a dull multitool knife– it was the violation of this principle that caused such a drastic decision and outcome

127 Hours

I really have no problem with people hiking solo.

That’s the whole reason to go out in the woods in the first place, is it not? To get away from people?

But by always telling somebody where you’re going, and an approximate time you’ll be back home, followed by a quick message once you get back home you’ll have maintained a very important lifeline for yourself perchance something should go wrong.

If nobody knows where you’re at, then nobody will come for you.

2. Pack Some Food and Water

This is a pet peeve of mine.

If you’re going to go out in the woods – even for a really quick day trip – at least bring some water and perhaps a granola bar with you out there.

Hiking Safety
PPT’s Jacki on a short saunter in the Las Vegas desert with a backpack style Camelback.

I know that the idea of not having anything to carry seems appealing, but water, in particular, could potentially save your life.

We tend to underestimate Mother Nature when we go outside. And an incredibly hot day of hiking can dehydrate you very quickly.

Sling Bag Water
Bring water!

This, in turn, can lead to some brutal headaches, an inability to make good decisions, and eventually, heat exhaustion or heat stroke.

Going out into the woods for relaxation and then ending up miserable because you couldn’t bring something as simple as a water bottle rather defeats the purpose.

3. No Cotton!

“Cotton kills” goes the famous backpacking adage. And there’s a good reason for that.

Once cotton gets wet, it completely loses any insulative qualities that it had prior. You may as well be walking around naked.

Mens Shorts
These clothes are NOT suitable for hiking.

Aside from the weather often changing very quickly while you’re out in the woods, there’s also always the chance of slipping during a stream crossing or some other similar water accident.

By wearing clothes made of nylon, polyester, or some other water-resistant material, you’ll be much safer while you’re out.

4. Bring a Flashlight

Personally, I enjoy hiking at night. The peace of the woods is incredible in the dark, the stars are like nothing you’ve ever seen, and it’s just fun.

However, a lot of people end up night hiking by accident.

11 Shotgun Lights
A light comes in handy at night.

What I mean by this is that mountains and trails can often be rather deceiving. What we think should only be a 3-hour hike where you will be back home in time for dinner can easily turn into a 5-hour hike where you don’t get home till well after dark.

There’s nothing wrong with this but attempting to hike in the dark without a flashlight is a good way to end up breaking an ankle.

So, make sure that you have a flashlight of some sort with you when you go out in the woods. Better yet, bring a headlamp.

Waterfall Squat 2
Headlamps come in handy when you find cool waterfalls too!

This will leave both of your hands-free for trekking poles or supporting yourself on nearby trees as you climb and descend.

5. Don’t Do Stupid Stuff

Being safe should be a given.

But while out in the woods, I’ve witnessed a girl attempting to catch a baby bear and even somebody hanging off a 300-foot cliff for a photo, to name just a few…

Jump off Cliff
Yeah, don’t do this…

I’ve also rock jumped at an area where a 20-something girl broke her hip and needed a hip replacement (she hit an underwater rock shelf). Then another 20-something ended up paralyzed from the neck down, followed by another 20-something found dead about a year after he’d gone missing.

Needless to say, I quit rock jumping there.

So have fun while you’re out there, but make sure that it’s safe fun as well.

6. Always Carry a Knife

I truly don’t understand people who go out into the woods without a knife on their person.

Perhaps this is just part of being a Southerner – where granddad’s old pocketknife is just a part of our pants.

So, to not have some means of cutting things while out in the woods is foolish to me.

Kershaw Emerson CQC-7
Knives are pretty useful in general.

If you carry one regularly, you understand just how often you end up pulling the thing out daily.

But if you’re in the woods, the benefits of a knife improve substantially.

Perchance you do end up in a survival situation while out in the bush, you’ll greatly improve your odds of making it through the wild in one piece with a quality blade on your person.

17. Gerber Strongarm Bush Wacking
Wacking at bushes with the Gerber Strongarm

Making traps, skinning game, filleting fish, cutting paracord, making bandages, and crafting a shelter are but a few of the benefits derived from carrying a knife out in the woods.

So, make sure that you have one.

Look at my Knife

7. Have a Weapon

You may want to consider your local laws on this one — as everywhere is different — but I highly recommend traveling with a weapon of some sort.

There are weirdos out in the woods, too, and fighting off rabid bobcats with your hands doesn’t sound fun to me.

In case you think I’m fearmongering, just know that within the past 10 years, we’ve witnessed: a man attacking people on the Appalachian Trail with a machete, murders on various trails, clowns in the woods, bobcats attacking people, cougar attacks, and much more.

If you’re looking for more information on the legality of carrying within a National Park, check out our article here.

8. Carry Some Means of Water Purification

To go out into the woods without some means of purifying water is just plain stupid.

Water is essential to life, and if you attempt to drink straight out of a stream or creek, you’re virtually guaranteed to end up with a debilitating form of diarrhea.

Water Purification, LifeStraw and Katadyn
LifeStraw and Katadyn

And that makes a bad situation much, much worse.

Besides, who wants to hike out to safety with brown pants?

No, it’s best to have some means of preventing such from ever happening in the first place. There are several convenient, light, and non-expensive means of doing such.

Steri-pen and bottled water
Steri-Pen

I personally prefer a SteriPen to purify my water, but a much more affordable option would be to take a LifeStraw out into the woods with you.

At roughly $25, here’s simply no reason not to have one of these on your person.

Best Personal Water Filter
18

at Amazon

Prices accurate at time of writing

Prices accurate at time of writing

You can read all about hiking and water purification in our article here!

9. Know How to Read a Map

Another requirement for hiking — carrying a high-quality topographic map of the region you’re traveling through.

Not only does this make the hike much more interesting (you’re able to determine just what exactly you’re looking at in the distance), but it also provides an incredible level of safety should you get lost.

Map and Compass
Learning to read a map is an important skill!

However, you first must know how to read a map, which is fast becoming a forgotten skill set.

I consider the best maps on the market to be the National Geographic topo maps. They’re waterproof, beautiful, pretty tough, and pack down really well.

15

at Amazon

Prices accurate at time of writing

Prices accurate at time of writing

Having one of these on your person and having watched a couple of YouTube videos on reading a topo map will serve you well for the rest of your life.

10. Know When It’s Hunting Season

Did you know that a lot of national parks actually allow hunting on them?

There’s nothing quite like being mistaken for a deer during rifle season. On the plus side, getting hit with a rifle round is a great way to lose weight!

Must Have Hunting Gear Rangefinder
Make sure to pack some orange so you stand out!

However, if that’s not your preferred method of weight loss, I highly recommend knowing when hunting season is in your area.

Figure out where people are likely to be hunting and make sure to wear blaze orange, stick to the trail, and make noise as you hike.

11. Avoid Thunderstorms Like the Plague

Lightning is a lot more terrifying when you don’t have a house to run into.

Surprise turns in the weather have suddenly caught me unaware at the peak of a mountain in the middle of a thunderstorm in the past.

Dark Storm Clouds
This doesn’t look good…

If such should happen to you, you need to do everything in your power to descend the mountain and get away from tall objects as fast as possible. Your life truly could depend upon it.

Don’t shelter underneath a tree or in a cave either.

A tree is a natural lightning rod as it is, and if you shelter in a cave, lightning can easily travel through the rock and blow you away.

Tree Lightning
That would be a bad day….

If you have no other options for shelter (e.g., a trail shelter) and you must find some way to ride the storm out while you’re out in it, you should do the following:

  • Find a low-lying area and get in it. Whether this is a hollow, ditch, or root hole doesn’t matter. You just need to not be the tallest thing around.
  • Take off your pack, put it on the ground, and then crouch down on it. You don’t want to lay down on the ground as lightning could easily travel through the wet earth to get to you. By crouching into a little ball while standing on your pack, you help to insulate yourself against ground-traveling electricity as much as possible.

12. Don’t Camp Near Roads

Aside from the noise disturbances, camping near a road brings the possibility for somebody to walk up to your tent in the middle of the night.

Call me paranoid, but I purposefully plan to spend the night as far away from any nearby road as possible when I go backpacking into the woods.

Tent and bug out bag
Pick a place off the road.

We’ve had some murders just off the road in the mountains, and I guess they’ve always stuck with me.

It’s because of this that I make my tent as difficult to find for some serial killer taking an evening stroll.

Part of this is choosing a tent color that blends in with your surroundings. I highly recommend the Snugpack Scorpion 2 in part for this reason — in other part because it straight up rocks.

350

at Amazon

Prices accurate at time of writing

Prices accurate at time of writing

13. Don’t Tell Strangers Your Plans

By this point, you probably don’t post to social media that you’re on vacation at the beach while you’re on vacation at the beach.

Why? Because it tells the whole world that you’re not at home!

In the same vein, you’re going to want to avoid telling strangers your plans while you’re out on the trail.

Stranger Danger

Letting somebody who you’ve never met in on the details of where you plan to sleep – in the middle of the woods with nobody else around – is probably a bad idea. Just sayin’.

Conclusion

I don’t want you to walk away from this article with the idea that hopping onto a trail in the woods is the beginning of a death trap. It’s not.

Instead, I want to help you provide a layer of security while you hike.

As such, it only makes sense to do what we can to mitigate the risk that we’ll face things happen.

6. Nature Hike Cloud UP 1 with Rainfly
Whether you’re going on a day hike or staying the night, stay safe, friends!

Our list truly isn’t difficult to follow and is most certainly not expensive either. You most likely have all of the gear already that you would need, and the rest is just active decision-making.

So, do what you can to take care of yourself and your family while you’re out in the woods.

You’ll enjoy yourself more freely with the knowledge that you have the means to take care of yourself should things go south.

Are there other ways to improve your safety? Let us know in the comments below! Ready to gear up? Check out our guides on the Best Portable Water Filters for Survival & Hiking and Best .410 Revolvers Perfect for Hiking.

The post Hiking Survival: 13 Ways to Stay Alive in the Woods appeared first on Pew Pew Tactical.

Pew Pew Tactical

Watch Mortal Kombat’s Surprisingly Emotional First 7 Minutes

https://i.kinja-img.com/gawker-media/image/upload/s–zSMm0Dj4–/c_fit,fl_progressive,q_80,w_636/hhrvxyfauvbgwuehaw19.jpg

Mortal Kombat begins by seeding its biggest rivalry.
Photo: Warner Bros.

From the very beginning of the new Mortal Kombat, it’s clear the filmmakers are trying something different with this particular video game adaptation. But, instead of us explaining that, why don’t you just watch it for yourself?

Warner Bros. just released seven minutes from the very, very beginning of the new film, which hits theaters and HBO Max on Friday. It reveals the start of arguably Mortal Kombat’s most famous rivalry, between Sub Zero (Joe Taslim) and Scorpion (Hiroyuki Sanada). However, it’s handled with a nice dash of emotion, a sign of how the rest of the film plays out too.

You can watch the footage below. Sort of. Since there’s a a lot of violence in it (Mortal Kombat is a very hard R-rated film) you have to watch it on YouTube. But we hope you’ll come back and discuss after you do.

Without spoiling too much, from the moment this clip cuts off, the fight between the two continues, reaches a conclusion, and the ramifications of that echoes centuries later, when the film picks up in the present day. Then, once that’s all established? Get ready for a massive showdown between Earth Realm and Outworld.

Another thing to notice is the music during the big action beats around five minutes in. If you got a little taste of the unforgettable Mortal Kombat song “Techno Syndrome” by the Immortals in there, you’d be right; the film’s composer, Ben Wallfisch, uses bits and pieces of it throughout.

See more when Mortal Kombat is released April 23.


For more, make sure you’re following us on our Instagram @io9dotcom.

G/O Media may get a commission

Gizmodo

Laravel Migration Generator – Take a database and convert to migrations

https://avatars.githubusercontent.com/u/4967100?s=400&v=4

Laravel Migration Generator

Generate migrations from existing database structures, an alternative to the schema dump provided by Laravel. A primary use case for this package would be a project that has many migrations that alter tables using ->change() from doctrine/dbal that SQLite doesn’t support and need a way to get table structures updated for SQLite to use in tests.
Another use case would be taking a project with a database and no migrations and turning that database into base migrations.

Installation

composer require --dev bennett-treptow/laravel-migration-generator
php artisan vendor:publish --provider="LaravelMigrationGenerator\LaravelMigrationGeneratorProvider"

Usage

Whenever you have database changes or are ready to squash your database structure down to migrations, run:

php artisan generate:migrations

By default, the migrations will be created in tests/database/migrations. You can specify a different path with the --path option:

php artisan generate:migrations --path=database/migrations

You can specify the connection to use as the database with the --connection option:

php artisan generate:migrations --connection=mysql2

You can also clear the directory with the --empty-path option:

php artisan generate:migrations --empty-path

Configuration

Each database driver can have separate configs, as specified in config/laravel-migration-generator.php.

Want to customize the migration stubs? Make sure you’ve published the vendor assets with the artisan command to publish vendor files above.

Stubs

There is a default stub for tables and views, found in resources/stubs/vendor/laravel-migration-generator/.
Each database driver can be assigned a specific migration stub by creating a new stub file in resources/stubs/vendor/laravel-migration-generator/ with a driver-prefix, e.g. mysql-table.stub for a MySQL specific table stub.

Stub Naming

Stubs can be named using the (table|view)_naming_scheme in the config. See below for available tokens that can be replaced.

Table Stubs

Table stubs have the following tokens available for the naming scheme:

  • [TableName] – Table’s name, same as what is defined in the database
  • [TableName:Studly] – Table’s name with Str::studly() applied to it (useful for standardizing table names if they are inconsistent)
  • [TableName:Lowercase] – Table’s name with strtolower applied to it (useful for standardizing table names if they are inconsistent)
  • [Timestamp] – The standard migration timestamp format, at the time of calling the command: Y_m_d_His
  • [Timestamp:{format}] – Specify a format for the timestamp, e.g. [Timestamp:Y_m]

Table schema stubs have the following tokens available:

  • [TableName] – Table’s name, same as what is defined in the database
  • [TableName:Studly] – Table’s name with Str::studly() applied to it, for use with the class name
  • [Schema] – The table’s generated schema

View Stubs

View stubs have the following tokens available for the naming scheme:

  • [ViewName] – View’s name, same as what is defined in the database
  • [ViewName:Studly] – View’s name with Str::studly() applied to it (useful for standardizing view names if they are inconsistent)
  • [ViewName:Lowercase] - View's name with strtolower` applied to it (useful for standardizing view names if they are inconsistent)
  • [Timestamp] – The standard migration timestamp format, at the time of calling the command: Y_m_d_His
  • [Timestamp:{format}] – Specify a format for the timestamp, e.g. [Timestamp:Y_m]

View schema stubs have the following tokens available:

  • [ViewName] – View’s name, same as what is defined in the database
  • [ViewName:Studly] – View’s name with Str::studly() applied to it, for use with the class name
  • [Schema] – The view’s schema

Example Usage

Given a database structure for a users table of:

CREATE TABLE `users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `first_name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `timezone` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'America/New_York',
  `location_id` int(10) unsigned NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `remember_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `users_username_index` (`username`),
  KEY `users_first_name_index` (`first_name`),
  KEY `users_last_name_index` (`last_name`),
  KEY `users_email_index` (`email`),
  KEY `fk_users_location_id_index` (`location_id`)
  CONSTRAINT `users_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

A tests/database/migrations/[TIMESTAMP]_create_users_table.php with the following Blueprint would be created:

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTestActionRemindersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username', 128)->nullable()->index();
            $table->string('email', 255)->index();
            $table->string('password', 255);
            $table->string('first_name', 45)->nullable()->index();
            $table->string('last_name', 45)->index();
            $table->string('timezone', 45)->default('America/New_York');
            $table->unsignedInteger('location_id');
            $table->softDeletes();
            $table->string('remember_token', 255)->nullable();
            $table->timestamps();
            $table->foreign('location_id', 'users_location_id_foreign')->references('id')->on('locations')->onUpdate('cascade')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}

Currently Supported DBMS’s

These DBMS’s are what are currently supported for creating migrations from. Migrations created will, as usual, follow what database drivers Laravel migrations allow for

Laravel News Links