Peter Fox Profile picture
Nov 19 8 tweets 2 min read
As a Laravel Dev who consistently uses Macs, here's a 🧵 of little tips I have for you when using the command line

#macos #laravel #symfony #phpc
1. If you need to find a command you previously used CTRL + R will let you search for old commands in your ~/.zsh_history file.
2. To move quickly left and right on the CLI, hold the ALT key with the arrow keys and it will force the cursor left and right to the next white space in the command.
3. Any commands made with Symfony Console components, like Laravel Console commands or even Composer can be shortened e.g. 'composer dump-autoload' can become 'compuser du' and it will still run as long as there's no name conflicts
4. Do you need to copy some command output to the clipboard? Pipe the output to pbcopy e.g. 'echo "hello world" | pbcopy' and then you can paste it into another app, no more awkward selecting!
5. Likewise you can use pbpaste e.g. 'echo "I love to paste $(pbpaste)"' should you want to take something from the clipboard to use in a command.
6. Any command you need to run with different environment variables for one off, they can be included at the start of a command. e.g. 'APP_ENV=production php artisan migrate' will run the command with that env overriding other values.
7. On every computer I use I always as 'alias art="php artisan"' to my ~/.zshrc file so I only have to type 'art' for my laravel console commands e.g. 'art migrate'

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Peter Fox

Peter Fox Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @SlyFireFox

Nov 14
So for those who wanted to know about my initial experience with @phpstorm and using @github's codespaces. Lets just say it wasn't great. Here's my run-through of the first hour or so.

#php #codespaces #github
@phpstorm @github Installed Jetbrains Gateway, First miss-step was Github CLI was too old a version, the error message for this was not clear at all and vaguely mentioned a socket not being available.
@phpstorm @github A quick ‘brew upgrade gh’ later… okay, I seem to not be able to get Gateway working with an IDE environment running the work on Codespaces.
Read 14 tweets
Nov 13
As a PHP developer, there are a great number of static tools that you can use. Here are four off the top of my head that I regularly go to:

#php #laravel 🧵
@phpstan, this tool is great for finding little oddities in your code you might not even notice yourself. Things like unused variables or impossible scenarios. Larastan extends it for Laravel apps to handle some of the magic involved. github.com/nunomaduro/lar…
@phpstan Laravel Pint is the next one, it's PHP CS Fixer under the hood but a little bit nicer in just it's easy to install and set up with no additional dependencies. laravel.com/docs/9.x/pint
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(