Laravel Tables Schema

Laravel Schema

This is a simple package to generate schema files for your database tables.

For an example, the standard users table in a new laravel application will generate a file named users.schema.json that contains the contents below.

{ "name": "users", "schema": { "id": "bigint", "name": "string", "email": "string", "email_verified_at": "datetime", "password": "string", "remember_token": "string", "created_at": "datetime", "updated_at": "datetime" } }

Installation

composer require wyattcast44/laravelschema

Usage

  1. Schema files will be regenerated anytime you run migrations

  2. You can manually trigger a build by running the command below

php artisan schema:generate

Config

You can publish the config file using the command below

php artisan vendor:publish --provider="WyattCast44\LaravelSchema\LaravelSchemaServiceProvider"

Once you have published the config file you can customize:

  • where the files will be generated, the default location is in database\schemas
  • the file extension, the default is .schema.json
  • you add any tables you would like to ignore

Why

Have you ever needed to know what fields a certain table contains… so you open up the create migration for that table? The problem is the more migrations you have the better chance that the schema for that table has changed.

You are left with two options, go through every migration file (🤮), or open up a database GUI (🙄).

I wanted a quick way to see the current table columns and data-types in my code editor, this is how this package was born. I hope you might find it useful as well 🙂

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.

via Laravel News Links
Laravel Tables Schema

Key & Peele: The World’s Worst Liar

Key & Peele: The World’s Worst Liar

Link

In this classic sketch from Key & Peele, the duo poke fun at crime dramas. Peele potrays a suspect who attempts to use his calm demeanor and lying skills like Verbal Kint in The Usual Suspects. But he’s not quite as effective at making up his answers off of stuff he sees on the cop’s wall.

via The Awesomer
Key & Peele: The World’s Worst Liar

The Top Traits of Highly Effective Leaders

What is leadership?

There are plenty of people in the business world who think that leadership is declaring yourself in charge and then verbally abusing and cutting down anyone who doesn’t fall in line. Fortunately, most people know that’s not how leadership works and a lot of them are able to recognize the difference between a boss and a leader.

If you are in a position of management over others, how can you be sure you are creating a working environment that is not toxic? How sure are you that you are leading instead of bossing everyone around? Are you aware of the traits of highly effective leaders?

Why Is Leadership Important?

trait of highly effective leaders

We’ve all had jobs we dread going to every day.

When you have a bad boss, it just drains the life right out of you and everyone around you. Working in an environment like that is oppressive and can eventually take a toll on your health.

Only 59% of people working for a bad boss feel passionate about their job while 94% of those with great bosses say they feel passionate about work. What’s more, 14% of engagement at work has to do with how employees rate their boss. Being a bad boss doesn’t just make people unhappy, but it also affects performance on the job.

Bad leadership also drives away good employees.

Two in three people have left a job or plan to leave their current job because of poor leadership. Of those who plan to leave their job over the next year, 77% say they have a bad boss while just 18% say they have a good boss.

People with bad managers report their behavior as self-absorbed, rude, selfish, lazy, arrogant, and untrustworthy. It’s not difficult to imagine why so many people would want to get away from such bosses.

Meanwhile, those with good bosses report their behavior as honest, supportive, trustworthy, respectful, and communicative. It’s easy to see why working in that type of environment would be preferable.

How To Be A Leader, Not A Boss

traits of highly effective leader

If you are in a position of management, it’s worth taking stock of your leadership traits to see whether there are any areas where you can make an improvement.

The most important traits of highly effective leaders include:

  • Clear purpose – Know your goals and have a plan to achieve them.
  • Contagious passion – If your job isn’t getting you out of bed in the morning, it’s not getting your employees out of bed, either.
  • Self-accountability – Own up to your mistakes and create an environment where others feel free to do the same without fear of punishment.
  • Flexible determination – Be willing to change courses when needed.
  • Sustainable outlook – Ensure your goals are achievable.
  • Dual focus – Keep your eyes on the prize, but don’t forget the little stuff along the way.

These are the traits of highly effective leaders and they can be learned. If you truly want to be a good leader, all you have to do is take stock of your leadership qualities from time to time and make adjustments.

If you find yourself casting blame and being punitive, look at your goals and plans. They might not be realistic anymore and they could be in need of an update to make them work again.

Making periodic checks of your goals and workflow can help prevent you from becoming a scared, punitive, angry boss instead of a leader. Understanding that your employees are your team and everyone shares the same goals creates a much better working environment.

See Also: Top 7 Ways To Achieve Legendary Level of Leadership

Why Leadership Matters

Would it surprise you to learn that 65% of workers say they would choose a better boss over a higher salary?

Your leadership style has a direct impact on your company’s bottom line in the form of quality of work, turnover, and more. Bad bosses drive good workers away and make those who stay less effective at their jobs. Good bosses attract better talent and help people achieve their fullest potential.

Focus on building relationships instead of managing people and let people manage themselves. Take an interest in employees’ lives and make sure they know you care about them. Stay consistent, give feedback consistently, and recognize when someone on your team accomplishes something — little celebrations along the way confirm a job well done.

Are you ready to take your leadership skills to the next level? Learn more about the habits of highly effective leaders below!
The Habits of Effective Leaders
Source: Online PhD Degrees

The post The Top Traits of Highly Effective Leaders appeared first on Dumb Little Man.


via Dumb Little Man – Tips for Life
The Top Traits of Highly Effective Leaders

Here’s The Difference Between Cheap And Expensive Brake Pads

The cost of car maintenance covers a pretty broad range. While it can be tempting to buy the cheapest products—brake pads, for example—to take a little strain off your wallet, there’s always the thought that maybe those more expensive pads might actually hold up better in the long run. But are they actually worth it? And, if they are, do you have to go really expensive to see any benefits to both your vehicle and your budget?

For our answer, we turn to Engineering Explained on YouTube, which purchased five different brake pads at various price points and put them all through similar tests to see which were more durable when faced with high temperatures, corrosion, and general compositional tests.

Each brake pad tested in this video came from different manufacturers, but were made for the front brakes of the same model vehicle. The brake pads chosen are the low-tier, mid-tier, and upper-tier priced pads that you could find at your local parts store, the original pads found on the car from the manufacturer, and pads from NRS (the company sponsoring the video; it’s at the NRS test facility that the video is filmed).

Each set of pads underwent four tests: a performance test to look at brake fade, followed by a corrosion test, a shear test, and, finally, a noise test.

The video gets pretty science-y (it’s well-explained and easily digestible, but I’ll let you watch the video and hear it straight from Engineering Explained) but the results are pretty clear. The cheapest, budget-tier brake pads are often the most unpredictable. If you were to take these pads out to a track day, you’d notice a lot of variability in the pressure needed to slow the car down, especially right at first. The longer you run with the cheaper brake pads, the faster they’ll wear out—which isn’t ideal for the whole “saving money” thing, considering you’ll have to replace them more often.

But what if you live in the terrible, terrible North, where harsh winter conditions (and salt corrosion) wear at your brakes? Interestingly, all the tiered pads you can buy at the store were covered with rust after the corrosion test, while the OEM and NRS pads remained pretty clean. Rust, as you can imagine, is not great; the whole-ass pad can just slowly start falling off when subjected to a lot of use.

The main takeaway here is that of all the tiered options you can buy at the parts store, the mid-tier pads actually proved to be the most durable—even when compared to the most expensive, high-tier brake pads. Those mid-tier pads are worth the extra money you spend, but you don’t have to break the bank to get them. But, if you can, it’s still best to nab yourself some OEM pads if you can.

via Lifehacker
Here’s The Difference Between Cheap And Expensive Brake Pads

How Magnets are Made

How Magnets are Made

Link

Discovery UK digs into the How It’s Made archives for this brief look at the process that goes into creating traditional magnets. After melting a cocktail of various metals in an electrical induction furnace, the fiery metal is poured into sand molds, then cooled, separated, and charged with multiple electromagnetic fields.

via The Awesomer
How Magnets are Made

Which Metal Is Strongest?

Which Metal Is Strongest?

Link

Between steel, aluminum, copper, and brass, which one is strongest? The guys at the Hydraulic Press Channel decided to put each one to the test on their 150-ton press, with some pretty explosive results. We wonder what titanium or tungsten would do under the same forces.

via The Awesomer
Which Metal Is Strongest?

Laravel Multidomain Package

Laravel Multidomain Package

Laravel Multidomain is a package by @gecche that allows a single Laravel Installation to work with multiple HTTP domains:

There are many cases in which different customers use the same application in terms of code but not in terms of database, storage, and configuration.

This package gives a very simple way to get a specific env file, a specific storage path, and a specific database for each such customer.

Once you finish the installation and setup outlined in the readme, you can use package commands to manage domains:

# Adding a domain php artisan domain:add site1.com php artisan domain:add site2.com # Removing a domain php artisan domain:remove site2.com 

When you add a domain, the .env configuration file is created for that specific domain:

php artisan domain:add site1.com # Generates the following configuration file .env.site1.com 

You can also list domains with the domain:list command:

php artisan domain:list 

Be sure to check out the full documentation of the package before deciding to use this package. This package provides an extended kernel and requires some buy-in in the methodology of this approach. Just make sure you evaluate the design of this package (and any package for that matter) for your use-case.

You can learn more about this package, get full installation instructions, and view the source code on GitHub at gecche/laravel-multidomain.

This package was submitted to our Laravel News Links section. Links is a place the community can post packages and tutorials around the Laravel ecosystem. Follow along on Twitter @LaravelLinks


Filed in: News


Enjoy this? Get Laravel News delivered straight to your inbox every Sunday.

No Spam, ever. We’ll never share your email address and you can opt out at any time.

via Laravel News
Laravel Multidomain Package

WATCH: Testing Smith & Wesson’s New M&P M2.0 Subcompact Pistol

During the recent Athlon Outdoors Rendezvous, our editors got the chance to get some trigger time on the new Smith & Wesson M&P M2.0 Subcompact Pistol. And S&W’s newest carry gun didn’t disappoint.

Smith & Wesson M&P M2.0 Subcompact pistol, lead

RELATED STORY

Smith & Wesson M&P M2.0 Subcompact: First Look at the New Carry Gun

Smith & Wesson M&P M2.0 Subcompact

Athlon staff members took on steel targets with the pistol, littered at nearly every conceivable distance out to more than 100 yards. Plate racks, static steel, dueling trees – you name it. Regardless of the target presentation, the M&P M2.0 Subcompact Pistol proved up to the task.

“Now this has all the M2.0 enhancements, including interchangeable palm swell grips, and that M2.0 crisp trigger pull,” said Matt Spafford, Media Manager, Smith & Wesson. “Plus, this gun also comes with magazine extenders for both 17-round and 15-round magazines in 9mm, allowing you to use it with a variety of magazine options.”

The M&P M2.0 features an extended stainless steel chassis. It delivers a high grip-to-bore ration, and low bore axis, which aids tremendously in recoil control. Four interchangeable backstraps ship with the gun, which should enable nearly everyone to find that near perfect, custom-like grip. Finally, the grip comes textured, with metal components wearing a tough Armornite finish. There’s just so much to like about the new M2.0 Subcompact.

For more information, visit smith-wesson.com.

Smith & Wesson M&P M2.0 Subcompact Specs

  • Caliber: 9mm
  • Action: Striker Fire
  • Overall Capacity: 12+1 Rounds
  • Overall Barrel Length: 3.6 inches
  • Front Sight: Steel – White Dot
  • Rear Sight: Steel – White Two Dot
  • Frame Width w/Controls: 1.52 inches
  • Max Overall Height: 4.98 inches
  • Overall Length: 6.6 inches
  • Sight Radius: 5.9 inches
  • Grip: Polymer
  • Overall Weight: 25.0 ounces
  • Barrel Material: Stainless Steel – Armornite
  • Slide Material: Stainless Steel – Armornite
  • Frame Material: Polymer

The post WATCH: Testing Smith & Wesson’s New M&P M2.0 Subcompact Pistol appeared first on Personal Defense World.

via Personal Defense World
WATCH: Testing Smith & Wesson’s New M&P M2.0 Subcompact Pistol

Secret Service Finds School Shootings are Preventable, Shooters Show Warning Signs in Advance

File this under least surprising news of the day. The US Secret Service has studied school shooters and found that — shockingly — almost none of them “just snapped.” To the contrary, virtually every one of them exhibited warning signs and, as such, the murders they committed could have been prevented.

The study was conducted by the Secret Service’s National Threat Assessment Center and concluded, in part, that “schools may need to think differently about school discipline.” To which anyone who’s been paying any attention would reply…duh.

The problem comes when the “different approach” to take is something along the lines of what’s being advocated by woooly-headed social justice advocates like Elizabeth Warren who thinks the solution is to remove all armed security personnel from the nation’s schools.

Because leaving America’s schoolchildren completely vulnerable to those who would murder them is the only fair, socially responsible thing to do. Or something.

By Colleen Long, Associated Press

Most students who committed deadly school attacks over the past decade were badly bullied, had a history of disciplinary trouble and their behavior concerned others but was never reported, according to a U.S. Secret Service study released Thursday.

In at least four cases, attackers wanted to emulate other school shootings, including those at Columbine High School in Colorado, Virginia Tech University and Sandy Hook Elementary School in Connecticut.

The study by the Secret Service’s National Threat Assessment Center is one of the most comprehensive reviews of school attacks since the Columbine shootings in 1999. The report looked in depth at 41 school attacks from 2008 through 2017.

The information gleaned through the research will help train school officials and law enforcement on how to better identify students who may be planning an attack and how to stop them before they strike.

“These are not sudden, impulsive acts where a student suddenly gets disgruntled,” Lina Alathari, the center’s head, said in an Associated Press interview. “The majority of these incidents are preventable.”

Nearly 40 training sessions for groups of up to 2,000 are scheduled. Alathari and her team trained about 7,500 people during 2018. The training is free.

The Secret Service is best known for its mission to protect the president. The threat assessment center was developed to study how other kinds of attacks could be prevented. Officials use that knowledge and apply it in other situations such as school shootings or mass attacks.

Since the Columbine attack on April 20, 1999, there have been scores of school shootings. Some, like Sandy Hook in 2012, were committed by nonstudents. There were others where no one was injured. Those were not included in the study.

The report covers 41 school attacks from 2008 through 2017 at K-12 schools and were chosen if the attacker was a current or former student who used a weapon to injure or kill at least one person at the school while targeting others.

“We focus on the target so that we can prevent it in the future,” Alathari said.

Nineteen people were killed and 79 were injured; victims included students, staff and law enforcement. The research was launched following the shooting at Marjory Stoneman Douglas High School in Parkland, Florida, in 2018.

The Secret Service put out a best practices guide based on some of the research last July to 40,000 schools nationwide, but the new report is a comprehensive look at the attacks.

The shootings happened fast and were usually over within a minute or less. Law enforcement rarely arrived before an attack was over. Attacks generally started during school hours and occurred in one location, such as a cafeteria, bathroom or classroom.

Most attackers were male; seven were female. Researchers said 63 percent of the attackers were white, 15 percent were black, 5 percent Hispanic, 2 percent were American Indian or Alaska Native, 10 percent were of two or more races and 5 percent were undetermined.

The weapons used were mostly guns, but knives were also used. One attacker used a World War II-era bayonet. Most of the weapons came from the attackers’ homes, the investigators reported.

Alathari said investigators were able to examine detailed information about attackers, including their home lives, suspension records and past behaviors.

There’s no clear profile of a school attacker, but some details stand out: Many were absent from school before the attack, often through a school suspension; they were treated poorly by their peers in person, not just online; they felt mistreated; some sought fame, while others were suicidal.

The key is knowing what to look for, recognizing the patterns and intervening early to try to stop someone from pursuing violence.

“It really is about a constellation of behaviors and factors,” Alathari said.

The attackers ranged in age but were mostly young adults, seventh-graders to seniors. More than three-quarters initiated their attack after an incident with someone at school.

In one case, a 14-year-old shot a classmate at his middle school after he’d been mocked and called homophobic names. The attacker later reported the victim made comments that made him uncomfortable and they were the final straw in his decision to attack. Seven attackers documented their plans and five researched their targets before the attack.

Thirty-two were criminally charged, with 22 charged as adults. Most took plea deals. More than half are incarcerated. A dozen more were treated as juveniles. Seven committed suicide and two were fatally wounded.

Alathari said the report shows that schools may need to think differently about school discipline and intervention.

The report does not weigh on political topics such as whether guns are too accessible or whether teachers should be armed.

She said their goal is to make schools a safer place where no more attacks occur.

via The Truth About Guns
Secret Service Finds School Shootings are Preventable, Shooters Show Warning Signs in Advance