Answer the question
In order to leave comments, you need to log in
How to set dynamic parameters in Makefile?
Good afternoon.
In laraever, you can run commands through the Makefile if you work with docker.
I already set up some commands, but how to add dynamic commands.
Let's say the command:
docker-container exec php php artisan make:seed UserSeeder -> make seed UserSeeder
up:
sudo docker-compose up -d
down:
sudo docker-compose down
down-orphan:
sudo docker-compose down --remove-orphans
build:
sudo docker-compose build
ps:
sudo docker-compose ps
list:
sudo docker-compose exec php-fpm php artisan route:list -c --name=users
migrate:
docker-compose exec php-fpm php artisan migrate
clear:
docker-compose exec php-fpm php artisan view:clear
docker-compose exec php-fpm php artisan cache:clear
docker-compose exec php-fpm php artisan config:clear
docker-compose exec php-fpm php artisan route:clear
seed:
docker-compose exec php-fpm php artisan db:seed
make-seed:
docker-compose exec php-fpm php artisan make:seeder UsersTableSeeder
tinker:
docker-compose exec php-fpm php artisan tinker
ide-generate:
php artisan ide-helper:generate
install:
docker-compose exec node npm install
prod:
docker-compose exec node npm run prod
dev:
docker-compose exec node npm run dev
watch:
docker-compose exec node npm mix watch
perm:
sudo chown ${USER}:${USER} bootstrap/cache -R
sudo chown ${USER}:${USER} storage -R
Answer the question
In order to leave comments, you need to log in
make takes a list of individual build targets, you can't pass multiple words as an option. You can pass define with -D, for example:
make -DARGS="UserSeeder" seed
In the Makefile:
seed:
docker-container exec php php artisan make:seed $(ARGS)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question