https://miro.medium.com/max/2000/1*CsfGKvl5-dSZ4K-tqZP18Q.pngLaravel Spark doesn’t offer a way to load stripe plans from the database, so here is my approach on how I achieved this without updating the source of Laravel Spark.Laravel News Links
How To Automatically Apply the Laravel-PHP Coding Style (For Free)
If you work inside a team, do yourself a favor – decide on a coding style and get the entire team to use it.
Why Stick To a Standard Code Style?
Making all your teammates’ code look the same will make the codebase so much easier to review, merge and maintain:
- it’ll be easier for you to judge only how the code works, without being distracted by how it looks;
- you won’t have PRs bloated by striping spaces, removing spaces, converting tabs to spaces, moving parentheses on the next line… and so on; less to think about during review; fewer conflicts to fix;
- even if you work solo – I’d argue it’s still very a good idea to do it; adopting PSR-12 in particular will make your code look the same as most well-maintained PHP projects; so when you go look at their code, it’ll actually start looking… a little more familiar; so it’ll be a little easier to learn from them;
- plus, I bet you will adopt PSR-12 one day, so if you start now… you’ll thank yourself later on; be kind to your future self!
Which Code Style to Choose?
Fortunately, thanks to PHP-FIG, it’s easy to choose a standard to start from – PSR-12. Digging a little deeper though, the Laravel ecosystem has pretty much decided on a few rules on top of that. Personally I don’t agree with all of them… but… that’s normal. Ask 10 developers what they like and… you’ll get 10 different answers. So in this case, I found it’s better to just… stick to the Laravel standard. You don’t like X in particular, your coworker doesn’t like Y, and so on, but… you each give in a little bit, for the sake of standardization. Everybody compromises, nobody has a reason to make a fuss… it’s the fair way to go, if you ask me. But hey… you do you 😀
How Do I Automatically Enforce It?
There are quite a few ways to do this automatically:
Option 1. Use StyleCI
If you can use StyleCI, use that. This is why it exists, and it does an excellent job. When someone pushes code to the repo, StyleCI comes in and formats it, by changing their PR to match the code style. It’s simple and brilliant. In fact, we use StyleCI for all the public-source Backpack packages and it’s worked wonders. Just follow the prompts to set it up, then you can forget about it.
If your code is open-source, this is such a good option, that you don’t need to read any further!
However… if your code is closed-source (not public)… you might find your particular company/setup can’t use StyleCI. You might develop A LOT of private projects, that are not under continuous development or maintenance… so you don’t want to pay for a maintenance fee for legacy projects… we get it, we got there too. In that case, the StyleCI pricing won’t make sense for you. In that case…
Option 2. Use PHP-CS-Fixer in Your Editor/IDE
Use php-cs-fixer locally, on each developer’s computer. There are plug-ins for every major editor and IDE, so it should be easy to do. You can store a configuration file in your project root, to make sure you all enforce the same rules.
However, this does assume you can tell your developers “do this, we all need to use the same code style“. In most teams, you can. But even if they do, most developers switch editors, forget to install the plugin, so unstyled code does go through, sometimes. For that reason alone, I don’t trust this method alone. So what I prefer is to…
Option 3. Use PHP-CS-Fixer Inside a Github Action
If none of the above float your boat, there’s one super-simple solution that you can implement, then forget about. It has most of the benefits of StyleCI (it’s implemented where the code is stored, on Github) and most of the benefits of PHP-CS-Fixer (it’s free).
You can implement a Github Action. Every time code is pushed or a pull request submitted, you can run php-cs-fixer on that code and fix whatever is needed. That way, no matter what developers submit, the code will be styled according to the standard.
To be honest, this is the entire reason this article exists – so I get to document how I did this 😀 Hopefully it’ll save you some time (and future me too). Here’s how to go about it:
Step 1. Create a configuration file for PHP-CS-Fixer (.php-cs-fixer.dist.php in your root directory). Here’s the content we use for it, after digging quite a bit. Note that if you don’t have a directory mentioned at the end, you should comment them out, otherwise PHP-CS-Fixer will fail. If you have any comments/improvements on the code style, please suggest them in my gist, it’s open for improvements.
Step 2. Add .php-cs-fixer.cache to your .gitignore file.
Step 3. Add a PHP-CS-Fixer as a dev requirement: composer require --dev friendsofphp/php-cs-fixer
Step 4. Add a Github action/workflow for it, by creating a .github/workflows/format_php.yml file:
name: Apply PHP Code Style
on:
push:
branches:
- 'master'
pull_request:
paths:
- '**.php'
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
ref: $
- name: Install
run: composer install
- name: Run php-cs-fixer
run: ./vendor/bin/php-cs-fixer fix
- uses: stefanzweifel/[email protected]
with:
commit_message: Apply php-cs-fixer changes
That should be it. Once you push code to your repo, a new commit should automatically be created, fixing the style. This works particularly well if you work with PRs, because then you squash and merge them and you won’t bloat up your git history.
I hope this will be helpful to you. If you have a better way of doing this, let me know in the comments. I know there are a lot of ways, but this is what I found to be the best for us, in Sep 2021.
Laravel News Links
The 6 Best Open Source Lightroom Alternatives
https://static1.makeuseofimages.com/wordpress/wp-content/uploads/2021/08/Screenshot-(273).png
Adobe Lightroom is a non-destructive photo editing software. It’s part of the Adobe ecosystem and comes with great photo editing features. However, it doesn’t come cheap.
Its price tag is a bit off-putting if you’re looking for affordable editing software, but don’t worry. There are several free, open source alternatives that you can use to edit your images.
1. GIMP
.png)
GIMP is a free and open source bitmap graphics editor that’s excellent for retouching and editing photos, as well as image enhancement.
Developed by the GIMP Development Team, this software contains powerful photo manipulation features suitable for professional creators. It’s also considered one of the best alternatives to Photoshop.
When to Use It: GIMP is best used for basic graphic design needs and image editing. It’s especially great if you don’t have a lot of experience with advanced image editing and manipulation.
Features:
- Free
- Excellent image manipulation tools
- Extensive graphic design toolset
- Comes with color management features
- Supports third-party plugins and customization options
Pros:
- High-quality framework
- Comes with tutorials and guides
- Small learning curve
- Multi-computer language support
- Outstanding color reproduction
- High customization levels
- Has all the essential editing tools
- Supports multiple file formats
Cons:
- The selection tool isn’t precise
- Lack of customer support
- A limited number of layers
Download: GIMP for Windows, Mac, and Linux (Free)
2.DigiKam
.png)
DigiKam is an intuitive, open source photo management software that focuses on image organization and tag editing. The app comes with an editing package designed for importing, exporting, editing, and managing RAW images.
It also has powerful tagging tools and filtering functionality. Photos are also put into albums, allowing you to quickly search for and find items.
When to Use It: DigiKam is best for organizing and comparing photos, or when preparing your pictures for publishing.
Features:
- Supports all primary image file formats (JPEG, PNG, and RAW)
- Add captions and ratings to images
- Filter and sort photos into albums and sub-albums
- Lets you easily export albums to social platforms
- Light Table lets you compare images
- Advanced image editing tools
Pros:
- Free
- Supports a large number of digital camera models
- Supports USB storage devices
- Is great for batch image editing
Cons:
- Software is slow at times
- Sophisticated interface
- Has a complex image export process
Download: DigiKam for Windows, Mac, and Linux (Free)
3. PhotoFlow
.png)
PhotoFlow is an open source and non-destructive photo editing program that supports RAW images. It specializes in image retouching, but also has several tools that let you perform basic edits.
When to Use It: Use PhotoFlow when you want to manipulate RAW images using advanced non-destructive tools, such as HDR tone mapping.
Features:
- Supports all major image formats
- Real-time image previews
- Freehand drawing
- Basic editing tools
- Color-correction features
- Color space conversions
Pros:
- Free
- Non-destructive editing
- Available for Linux, Windows, and macOS
Cons:
- Rugged interface
- Software doesn’t provide descriptions for editing tools
Download: PhotoFlow for Windows, Mac, and Linux (Free)
4. LightZone
LightZone is a free, open source editing software initially developed for commercial editing. However, it is now open to all users. It supports non-destructive editing, which allows you to edit an image without overwriting the original image data.
When to Use It: LightZone is best for editing RAW images, as it produces high-quality JPEGs.
Features:
- Elegant user interface
- Supports both JPEG and RAW image formats
- Non-destructive RAW editor
- Compatible with multiple operating systems
- Great for batch processing
- Advanced image adjustment settings
Pros:
- No-fuss photo editing tools
- Non-destructive editing
- Has a community forum for technical assistance
Cons:
- Lack of documentation
- Difficult to use for beginners
Download: LightZone for Windows, Mac, and Linux (Free)
5. Photivo
Do you want to get the most out of your photos? Photivo is a great open source image editor that comes with a variety of filters and a large library of features.
And if you’re a fan of GIMP, Photivo comes with a button that lets you easily export your images to GIMP for further editing.
When to Use It: It’s best for editing high-quality RAW and bitmap files that require high attention to detail.
Features:
- Supports bitmap images and RAW files
- Elegant and straightforward interface
- Advanced settings and adjustments
- Channel mixer support
- 16-bit internal processing
- Batch mode
- Multi-lingual support
- Allows for cross-processing
Pros:
- Feature-rich
- Powerful internal processing
- Supports multiple image formats
- Batch processing capabilities
Cons:
- Sophisticated
- Requires image editing experience to use
- Needs a powerful computer to run
Download: Photivo for Windows | Mac | Linux (Free)
6. BitMappery
.png)
Don’t want to download image editing software to your computer? Well, with Bitmappery, you can do all the editing from your web browser.
Bitmappery is a free, open source photo editing software that’s also web-based. It integrates with Dropbox, letting your easily import and edit images from the cloud. Bitmappery presents a quick solution for any editing project that needs to be done in a timely manner.
When to Use It: Bitmappery is great for quickly editing photos that are stored in Dropbox.
Features:
- Layer management
- Dropbox integration
- Offline support
- Keyboard shortcuts for faster editing
- Transformation options
Pros:
- Accessible on any device, since it’s web-based
- Non-destructive editing
- Only needs a web browser to run
Cons:
- Limited editing options
- Less refined than other software
Related: The Best Free Photo Editing Software to Try Today
Adobe Lightroom vs. Open Source Photo Editing Software
If you are looking to edit your photos, Adobe Lightroom is a great option. It is a non-destructive photo editor, and all edits are kept in your Lightroom catalog. It’s also much easier to use than Photoshop and has great photo management tools.
Open source photo editing software, on the other hand, can be up to par with the paid options. Most of the software above offer the same features as Adobe Lightroom. Some, like GIMP, have more features than Lightroom.
If you are looking for free-to-use photo editing software, be sure to check out the above. You can even use them to learn about photo editing before committing to a paid photo editing software.
MUO – Feed
The Wheel of Time’s First Trailer Brings Robert Jordan’s Fantasy World to Life
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/c8e1444f6e88a248794826ada5bddbac.jpg
Look what’s rolled into town! Why, it’s the first trailer (finally) for Amazon’s much-anticipated fantasy television series The Wheel of Time. It’s later than we expected, given the show is currently set to premiere on November 19, but was it worth the wait?
Based on Robert Jordan’s massive, best-selling, 15-book fantasy series (the last few of which were co-written by author Brandon Sanderson after Jordan’s death in 2007), The Wheel of Time serves as the “connective tissue between Lord of the Rings and Game of Thrones,” as showrunner Rafe Judkins put it at San Diego Comic-Con. We have been anxiously anticipating the trailer after a few very tiny teases and the first images being released just earlier this month. Well, what are you waiting for? Give it a watch!
The trailer delves into the bare bones of The Wheel of Time’s giant, sprawling tale: In a fantasy world where only women called Aes Sedai are allowed to use magic, the powerful sorcerer Moiraine (played by Rosamund Pike) comes across three boys and two girls—Rand al’Thor (Josha Stradowski), Mat Cauthon (Barney Harris), Perrin Aybara (Marcus Rutherfort), Nynaeve al’Meara (Zoë Robins), Egwene al’Vere (Madeleine Madden)—one of whom she suspects might be the reincarnation of the legendary Dragon, an entity so powerful he could destroy the world.
If you’re a lover of the books, you’ve likely immediately noted a discrepancy in the show. Originally, only the three male characters were seen as candidates to be the magic-wielding Dragon Reborn, as a sort of yin to the Aes Sedai’s yang. But the official synopsis makes it sound like Nyneave and Egwene are contenders as well: “Set in a sprawling, epic world where magic exists and only certain women are allowed to access it, the story follows Moiraine (Rosamund Pike), a member of the incredibly powerful all-female organization called the Aes Sedai, as she arrives in the small town of Two Rivers. There, she embarks on a dangerous, world-spanning journey with five young men and women, one of whom is prophesied to be the Dragon Reborn, who will either save or destroy humanity.”
The trailer also leans heavily into the Aes Sedai as wholly virtuous protectors of the world. In the books, while the Aes Sedai certainly saw themselves as protectors of the world, in reality, they were callous, supercilious, and often misandric. I’m not saying they need to be perfect angels in the TV series, but let’s just say Jordan’s portrayal of female characters left plenty of room for improvement, of which hopefully the show has taken advantage. As for the look of the show, the clips are so brief it’s hard to get a good read on it. The vivid colors are wonderful and the CG looks great, but some of the sets…well, they look very much like studio sets to me, as opposed to the beautiful, on-location scenes of Game of Thrones. Still, it’s worth remembering Amazon has liked what it’s seen of The Wheel of Time so much that it’s already filming a second season.
That’s good news for the rest of the show’s giant cast, which includes (takes a deep breath): Daniel Henney as al’Lan Mandragoran, Michael McElhatton as Tam al’Thor, Álvaro Morte as Logain Ablar, Priyanka Bose as Alanna Mosvani, Jennifer Cheon Garcia as Leane Sharif, Kate Fleetwood as Liandrin Guirale, Sophie Okonedo as Siuan Sanche, Kae Alexander as Min Farshaw, Clare Perkins as Kerene Nagashi, Orphan Black’s Maria Doyle Kennedy as Illa, and so, so, so many more. Please offer your effusive praise/constructive criticism/infuriated rants about the trailer in the comments. And, uh, don’t forget there’s a separate Wheel of Time movie trilogy also in the works now…
Wondering where our RSS feed went? You can pick the new up one here.
Gizmodo
Watch: After gutting Biden with an attack ad last week, Trump just went in for round 2 with an even more savage beat down
https://media.notthebee.com/articles/6130e58de46076130e58de4608.jpg
So Trump decided to blast Biden last week with an ad over the hot mess in Afghanistan and it was brutal.
Not the Bee
This heavy-metal cover of a guy ranting about Covid restrictions is one of the scariest and most amazing things I’ve ever seen
https://media.notthebee.com/articles/6130edde5f4ad6130edde5f4ae.jpg
Our favorite metal enthusiast is back, this time with a video set to a crazy guy who spoke at the San Diego Board of Supervisors meeting a few weeks back.
Not the Bee
There’s a group of Orthodox Jews in NY that go around fixing people’s cars when they break down on the side of the road and yes it’s as heartwarming as it sounds
https://media.notthebee.com/articles/612fc39e3c8a3612fc39e3c8a4.jpg
Sometimes even a flat tire on the side of a Long Island highway can turn out to be a blessing.
Not the Bee
It appears a fake high school tricked ESPN into airing one of their football games 🧐
https://media.notthebee.com/articles/612e6cf697926612e6cf697927.jpg
Okay ESPN, what the heck is going on here?
Not the Bee
Watch: This guy’s metaphor about Covid and abusive husbands is disturbingly accurate
https://media.notthebee.com/articles/612cee9ab39be612cee9ab39bf.jpg
If this doesn’t open your eyes, I’m not sure what will.
Not the Bee
I can almost hear Bob saying this!
https://lh6.ggpht.com/_kIWY2DV0KnE/S_y6U-E6WXI/AAAAAAAAG0I/7AiMxWqhRUY/s72-c/Tongue-out%20emoticon.gif
Readers will recall that in January, Miss D. and I went up to Colorado for the funeral of a good friend, Bob, who’d been our host at our Blogorado gatherings for more than a decade. He was a no-nonsense, down-to-earth, plain-spoken man, who said what he meant and meant what he said.
I couldn’t help thinking of Bob when I read this piece of folk wisdom at Ace of Spades on Saturday. I can almost hear his voice in my mind. It’s exactly the kind of thing he’d have said to the bureaucrats, too!
The Sierra Club and the U.S. Forest Service were presenting an alternative to the Wyoming ranchers for controlling the coyote population. It seems that after years of the ranchers using the tried-and-true method of shooting or trapping the predators, the Sierra Club had a "more humane" solution to this issue. What they were proposing was for the animals to be captured alive. The males would then be castrated and let loose again.
This was ACTUALLY proposed by the Sierra Club and by the U.S. Forest Service .
All of the ranchers thought about this amazing idea for a couple of minutes.
Finally an old fellow wearing a big cowboy hat in the back of the conference room stood up, tipped his hat back and said:
"Son, I don’t think you understand our problem here… these coyotes ain’t ****in’ our sheep… they’re eatin’ them!"
The meeting never really got back to order.
I reckon, somewhere up there, Bob’s laughing his ass off at that one . . .
Peter
Bayou Renaissance Man