Automate App Setup with Laravel Initializer

Automate App Setup with Laravel Initializer

https://ift.tt/2s0oZLe

Automate App Setup with Laravel Initializer

Have you ever found yourself writing multiple manual steps to set up a Laravel application in a new environment? Laravel Initializer is a convenient way to automate installing and updating a Laravel application:

Laravel Initializer gives you the ability to declare multiple processes and run them with app:install and app:update artisan commands, which run predefined actions chain depending on the current environment.

The app:install and app:update commands use two distinct classes that run commands based on a given environment. First, the install command uses the App\Install class:

namespace App; use MadWeb\Initializer\Contracts\Runner; class Install { public function production(Runner $run) { return $run ->external('composer', 'install', '--no-dev', '--prefer-dist', '--optimize-autoloader') ->artisan('key:generate') ->artisan('migrate', ['--force' => true]) ->artisan('storage:link') ->external('npm', 'install', '--production') ->external('npm', 'run', 'production') ->artisan('route:cache') ->artisan('config:cache') ->artisan('event:cache'); } public function local(Runner $run) { return $run ->external('composer', 'install') ->artisan('key:generate') ->artisan('migrate') ->artisan('storage:link') ->external('npm', 'install') ->external('npm', 'run', 'development'); } } 

The app:update command looks similar, using an App\Update class:

namespace App; use MadWeb\Initializer\Contracts\Runner; class Update { public function production(Runner $run) { return $run ->external('composer', 'install', '--no-dev', '--prefer-dist', '--optimize-autoloader') ->external('npm', 'install', '--production') ->external('npm', 'run', 'production') ->artisan('route:cache') ->artisan('config:cache') ->artisan('event:cache') ->artisan('migrate', ['--force' => true]) ->artisan('cache:clear') ->artisan('queue:restart'); ->artisan('horizon:terminate'); } public function local(Runner $run) { return $run ->external('composer', 'install') ->external('npm', 'install') ->external('npm', 'run', 'development') ->artisan('migrate') ->artisan('cache:clear'); } } 

You can also inject dependencies from the service container if you need to access services while running commands.

This package contains a variety of runner actions you should check out in the readme. I found the MakeCronTask dispatch interesting:

$run->dispatch(new \MadWeb\Initializer\Jobs\MakeCronTask) 

MakeCronTask adds the following to the server’s crontab list:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1 

You can do other things like creating a supervisord config for a typical queue worker or horizon.

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


Filed in: News / packages


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.

programming

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

November 21, 2019 at 09:11AM

Laravel: CSV Import Validation with Errors on Line X [VIDEO]

Laravel: CSV Import Validation with Errors on Line X [VIDEO]

https://www.youtube.com/watch?v=pshvWCCyCGw

Almost live-coding video where I show you how to make a validator for array imported from CSV.

programming

via Laravel News Links https://ift.tt/2dvygAJ

November 20, 2019 at 08:58AM

Amazon delivery infrastructure strained as COVID-19 outbreak sparks surge in online shopping

Amazon delivery infrastructure strained as COVID-19 outbreak sparks surge in online shopping

https://ift.tt/3b18EXX

Amazon’s fulfillment center in Dupont, Wash. (GeekWire Photo / Kevin Lisota)

With thousands of Americans telecommuting and self-isolating to slow the spread of COVID-19, Amazon’s Prime and Fresh delivery services are grappling with high demand and inventory issues, as warehouse workers report increased order volumes.

Amazon is out of stock on a number of household staples and popular items, according to the company’s COVID-19 response page.

“You will also notice that some of our delivery promises are longer than usual,” the site says. “We are working around the clock with our selling partners to ensure availability on all of our products, and bring on additional capacity to deliver all of your orders.”

The consumer impact: Amazon can no longer guarantee two-day delivery on all Prime orders and some of the program’s 150 million subscribers customers are already experiencing delays. The Amazon Fresh website warns grocery deliveries “may be temporarily unavailable due to increased demand.” Amazon Fresh did not have any delivery windows available in the Seattle area as of Monday morning.

The increased demand comes as Amazon navigates supply chain threats from slowed or shuttered factories in China. Amazon did not immediately respond to questions about the delays.

The worker impact: The Seattle tech giant has asked all employees who can work from home to do so, an option unavailable to warehouse workers and delivery drivers. The company is providing two weeks of paid time off to all employees diagnosed with the virus or placed under quarantine.

Amazon is spending $25 million to help its network of independent delivery drivers, Amazon Flex workers, and seasonal employees deal with disruptions caused by the outbreak. The Amazon Relief Fund will provide grants equal to about two weeks’ pay for workers who have the virus or are quarantined. Grants are also available to workers facing financial or other hardships. Several warehouse worker groups have been circulating blog posts and petitions calling for more comprehensive sick time.

Other changes: Amazon has paused all fulfillment center tours, canceled large events, and shifted to virtual job interviews.

Bottom line: High demand is already causing delays for Amazon Prime and Fresh customers, a phenomenon that could be exacerbated by slowed imports or outbreaks of the virus among warehouse workers, who are already fielding high volumes of orders. Experts predict Amazon’s delivery infrastructure “will falter,” Motherboard reports.

However, some predict that Amazon will be one of the companies least impacted by a potential recession despite the disruptions. Analysts with RBC Capital Markets wrote on March 13 that Amazon “will be only modestly impacted” during a global financial crisis, due to growing reliance on the company for consumer staples, and expectations of continued growth in its Amazon Web Services cloud division.

geeky

via GeekWire https://ift.tt/2pQ6rtD

March 16, 2020 at 01:35PM

Pyro Putty

Pyro Putty

 | Buy

Between wind, cold, and damp conditions, getting fires started in the outdoors can be a challenge. This moldable putty can be stuck to logs, torches, or tinder, and will burn for up to 15 minutes with just a quarter-sized dab, giving your fire a better chance of getting going. Available in summer, winter, and eco blends.

via The Awesomer
Pyro Putty

A guide for startups to prepare for the California Consumer Privacy Act (CCPA)

(BigStock Photo)

This week, Microsoft announced that it will be implementing the upcoming California Consumer Privacy Act (CCPA) for all customers in the U.S.

This is a big deal.

The CCPA has sometimes been referred to as “GDPR-lite”, meaning that it’s a light version of the European Union’s General Data Protection Act.

CCPA is important because it represents the first real, comprehensive privacy legislation in the U.S. And because the CCPA applies to all California residents, any company that works with data from California residents will be subject to it. Finally, because this is both the first comprehensive privacy regulation and it’s in California, the odds are very strong that CCPA will form the foundation for other state privacy regulations in the future, and quite possibly any U.S federal privacy regulation.

Because of these reasons, it’s important for people to be aware of CCPA and start planning and taking action now, since CCPA comes into effect Jan. 1, 2020. Technology startups in particular should be aware of this because so many of them deal with customer data (almost certainly affecting California residents) but often don’t have privacy professionals or experts on staff.

As we know, ignorance of the law is no excuse. You may not know about CCPA but you may well be subject to it.

To help you get started figuring out what you need to do around CCPA, here are four tips.

Read the CCPA

No one enjoys reading legalese. That’s true for your customers with privacy policies. And likely true for you regarding privacy regulations. However, the CCPA is one of, if not the most important piece of privacy legislation in the U.S. There simply is no substitute for actually reading the CCPA yourself. Reading it will help you better understand and evaluate any secondary readings that you do on CCPA.

The full text of the CCPA can be found here.

When you read, you’ll find that CCPAA covers the following critical areas as outlined in the act’s opening:

  1. The right of Californians to know what personal information is being collected about them.
  2. The right of Californians to know whether their personal information is sold or disclosed and to whom.
  3. The right of Californians to say no to the sale of personal information.
  4. The right of Californians to access their personal information.
  5. The right of Californians to equal service and price, even if they exercise their privacy rights.

Also, the act provides for rights for Californians to seek damages in case of the loss or theft of their data. Quoting once again:

Any consumer whose nonencrypted or nonredacted personal information…is subject to an unauthorized access and exfiltration, theft, or disclosure as a result of the business’ violation of the duty to implement and maintain reasonable security procedures and practices appropriate to the nature of the information to protect the personal information may institute a civil action[.].

Put plainly, this means if you are the custodian of data from California citizens and you suffer a data breach or loss, those Californians whose data is lost have the right to take civil action against your company.

This represents the first real GDPR-like set of penalty for data loss or theft. That alone makes understanding this act critical for anyone that holds data.

Know what data you’re collecting and retaining

It may sound obvious, but the reality is that many companies don’t actually fully know what data they collect and retain. This truth was recently shown in the first episode of Season 6 of Silicon Valley when Richard, the CEO of Pied Piper, learns AFTER testifying to Congress that his company doesn’t collect data that in fact they do (and a lot of it).

This is especially true in the world of startups where the focus is on building and business growth. Privacy has a reputation of being a business-slower and so many large and small companies simply haven’t engaged in a program of systematic examination of what data they collect and retain, how they store it and for how long.

This means the absolute first step in getting ready for CCPA is knowing what data you’re collecting and retaining. Even companies that have a handle on their data collection and retention practices should use this opportunity to review and refresh: things move fast and the information that you have around data collection and retention could well be out of date.

Have others in your company read CCPA and start planning how they’ll comply

As you undertake knowing what data you’re collecting and retaining, have others in your company read the CCPA and start planning how they’ll comply. This isn’t an obvious step: after all, the CCPA is privacy legislation and people tend to think these things can and should only be ready by privacy experts and lawyers.

While this is understandable, that’s not the right way to approach this. Understanding privacy requirements and regulations around data is something that everyone that touches data should understand. This helps instill a culture where privacy knowledge is integrated throughout. It also acts as a hedge for the reality that business often can’t get a full and complete view of all the data that they have and where it’s stored.

For example, if someone in marketing mistakenly sends a spreadsheet of customer prospect information to the wrong email address, that can potentially qualify as a data loss subject to CCPA penalties. Your executives, lawyers, and privacy officers may not be aware that happened. But that person’s manager may and if they’re educated on CCPA, they can recognize the risk that mistake poses and take proactive action which can help prevent more significant consequences.

Be like Brad (Smith)

Microsoft President Brad Smith speaking at the 2019 GeekWire Summit. (GeekWire Photo / Dan DeLong)

Microsoft recently announced that they plan to implement CCPA company-wide so that it governs all U.S. customers.

This is consistent with what we’ve seen Microsoft do around privacy with other international regulations. as well as the vision that its president, Brad Smith, has outlined in his comments and his recent book “Tools and Weapons.”

In his book, when Smith writes about what Microsoft did to comply with GDPR, he describes a comprehensive company-wide process to understand what data the company collects and retains. He talks about how this process was ultimately beneficial for Microsoft because it helped them get a better understanding and control over their data collection and retention.

That comment speaks loudly about the business benefit of treating compliance with GDPR or CCPA in a broad and compressive fashion rather than trying to create a one-off system just to comply with the specifics of the law.

In addition to that benefit, following Microsoft’s lead and implementing CCPA for all U.S. customers has an additional benefit: as I noted before, since this is the first comprehensive privacy legislation in the U.S., the odds are strong that other legislation will mirror it. If you take the time to implement CCPA today for all US customers, you will be very well placed to comply with any future privacy legislation from other states. And most importantly, there’s already talk about the likelihood of any eventual federal privacy legislation following the CCPA closely. Once again, if you do this work now, you will save yourself and your company work in the future.

Conclusion

Privacy can seem to be a murky and scary arena for businesses, especially startups. It has a reputation of being very legalistic so that only privacy professionals and lawyers can navigate it.

The reality is that most technology companies, including startups, deal heavily with user data. And as the CCPA comes online in Jan. 2020, anyone that deals with data for Californians is subject to that law, without exception.

Fortunately, the principles of the law aren’t that arcane, and the law itself can be read fairly quickly. You can start to get ready for CCPA by following these four steps that I’ve outlined here. And if you approach this as a comprehensive project for all your U.S. customers, you can be well placed to deal with additional privacy regulations as they develop in the coming years.

via GeekWire
A guide for startups to prepare for the California Consumer Privacy Act (CCPA)

Purchasing Bulk Ammunition Online, The Inside Scoop

9mm-Ammunition-infospeed-iStock-174077869
Purchasing Bulk Ammunition Online, The Inside Scoop iStock-174077869

U.S.A.-(Ammoland.com)- Purchasing bulk ammunition online is highly accessible despite popular belief. Each state has regulations as it pertains to the sales and shipments of purchasing ammunition, however, many websites provide the state by state regulations and honestly it is not nearly as difficult as it seems.  The accessibility to purchasing a wide range of calibers whether you want to buy a few hundred to several thousand rounds in addition to the discounts available as it relates to volume makes purchasing bulk ammunition online a win for shooters everywhere.

Why Purchase Bulk Ammunition?

Purchasing Ammunition in bulk online gives you a cheaper cost per round and greater selection. For the avid shooter, you are always watching costs and working to find a happy medium between quality, volume, and cost. Purchasing in bulk may be the best option for you and your family and friends. The most popular calibers to purchase in bulk are 9mm, .40 S&W as well as 7.62×39 and 5.56 Nato, .357, .22 and .223. Many websites including our affiliate partners are constantly running sales and reducing prices on bulk ammunition.  Staying updated on each of your favorite e-tailers via email is the fastest way to know when a new deal is available. Purchasing bulk ammunition also has the benefit of being shipped quickly to your door. If your local gun shop does not have what you need available immediately, having your trusted online sources can save you from a major headache when it comes to leaving for the range, deer camp, or both.

Where Can You Purchase Bulk Ammo Online?

Last week we talked about the top places to purchase ammunition online, Here are a few of our recommended partners and some of the great deals they have available right now on purchasing bulk ammunition online today.

Sportsman’s Guide

For those looking to purchase bulk ammunition online for both hunting and target shooting, In addition to a daily 5% off guns and ammunition, Sportsman’s Guide offers hosts popular rounds such as 9mm luger in cases of 1000 rounds, 7.62 for the AK enthusiast, .45ACP, .308 ammunition, and shotgun ammunition. The Sportsman’s Guide club membership of $49.99 per year provides ample value for purchasing bulk ammunition online. Not only does Sportsmans Guide give you a variety of options when buying bulk ammo for handguns, shotguns, and both rimfire and centerfire rifles, Club Members never pay a penny for standard shipping on orders of $49. [AmmoLand tracks Sportsman’s Guide ammo bargains here.]

Purchase Bulk Ammunition Online at Sportsman's Guide.
Purchase Bulk Ammunition Online at Sportsman’s Guide.

Palmetto State Armory

For daily deals on purchasing bulk ammunition online, Palmetto State Armory is one of the top e-tailers selling ammunition in bulk in a wide range of popular calibers in centerfire and rimfire options. Available in boxes up to 1,000 rounds, Palmetto State Armoury ships by weight within five business days from the time of your order. Keep a close eye on their daily ammo deals if you plan on buying ammo online [check the AmmoLand’s PSA bargain page] since they will offer free shipping on certain items from time-to-time.

Purchase Bulk Ammunition Online from Palmetto State Armory
Purchase Bulk Ammunition Online from Palmetto State Armory

Natchez Shooting Supplies

Natchez Shooting Supplies has great deals on purchasing bulk ammunition online, especially for those looking for great deals on bulk.22 ammunition and other popular calibers such as 9mm, .223, 5.56 and more. With reliable 1-2 day shipping from the time of order, Natchez Shooters Supplies brings avid ammunition users their savings by buying through them. Natchez Shooters Supplies also hosts the Federal Lake City XM855 Green Tip Centerfire Ammunition in a 50 gallon drum on their website. This overload of 5.56 in 62 gr. comes in a 12,500 for $0.49 per round. Check AmmoLand’s page tracking the best of Natchez Shooters Supplies deals to stay updated when bulk ammunition comes on sale. 

Purchase Bulk Ammunition Online at Natchez Shooting Supplies
Purchase Bulk Ammunition Online at Natchez Shooting Supplies

Purchasing Bulk ammunition online is an element that seems to be shrouded in a cloud of mystery.  Palmetto State Armory has a great page with all the information you need for making your purchase and can be read here at under ammunition shipping restrictions. Some of the basics of purchasing bulk ammunition online are as follows.

  1. You are at least 21 years of age (for handgun ammunition) or 18 years of age (for rifle ammunition).
  2. You have not been convicted of any felony, a misdemeanor of domestic abuse, and you are not chemically dependent.
  3. In my home state of New York, No ammunition Sales to New York City, or its five Burroughs. Starting January 1st, 2014 all ammunition must be sent to a Federal Firearms Licensed dealer.
  4. In California, no online ammunition Sales to the cities of Los Angeles, Oakland, Sacramento, San Francisco, or Avalon.
  5. You have no legal restraint that would prohibit you from possessing, ordering, owning, or transferring ammunition.
  6. You have never been committed to any mental institution, or been adjudicated as mentally defective. You will not sell ammunition to any minor.
  7. You cannot have ammunition shipped to a post office box.

Now, if you do live in a restricted state and cannot purchase bulk ammunition online, Palmetto State Armory will have their orders canceled and a 5% restocking fee will be charged. Be aware of your rules and don’t get yourself in trouble. Other websites host similar policies.

Purchasing bulk ammo on the web is a time-saving cost-effective endeavor for the avid gun owner. The long-term benefits of purchasing several hundred to several thousand rounds at a time for your favorite calibers revolves around controlling the ever-changing costs at retail for ammunition. Lock in your prices and buy in bulk online.

The post Purchasing Bulk Ammunition Online, The Inside Scoop appeared first on AmmoLand.com.

via AmmoLand.com
Purchasing Bulk Ammunition Online, The Inside Scoop