Biplob Hossain

Develop concrete5 site with valet and make a CLI alias to save development time

July 9, 2017 | by biplob.ice

laravel-valet

[This article is for beginners only.]

Nowadays the Laravel valet is so popular with web developers for its simplicity and ease of use. If you don’t know about valet, please look at valet documentation

Now valet has environmental support for concrete5. You just need to add config files with the prefix valet. For example- you work in a team and your project has a database configuration file in application/config/database.php. But different users have different database names, usernames, and passwords in your team. So, you can make a file in application/config/valet.database.php and add this path to the .gitignore file. Concrete5 is that smart to get this value automatically.

For faster development, you may have to use the concrete5 command line interface frequently. If you don’t know about the concrete5 command line tool please take a look concrete5 command line interface documentation.

In general, you can get concrete5 all commands list using

concrete/bin/concrete5 list

But, if you use valet configuration, you need to use the following command.

concrete/bin/concrete5 --env=valet list

And I think it’s annoying to use this long command every time. So, I like to use it as a shortcut and for this we just need to make an alias. 

Open your terminal and run the following command to open your .bash_profile.

vim ~/.bash_profile

Press $ to go to the end of the file. Then press i to go into insert mode. 
Paste the following line.

alias concrete5='concrete/bin/concrete5 --env=valet'

Now run-

source ~/.bash_profile

You’re ready to go. Go to your concrete5 project root directory and run 

concrete5 c5:list

Tips: Just type conc and press the tab from your keyboard. concrete5 will be automatically filled out.

RELATED POSTS

View all

view all