Similarities of laravel command and vue/react component props behavior
Vuyani Daweti
Posted on August 29, 2024
As a developer it is key to learn a skill that can be easily transfered to another domain with losing meaning.I think am starting to see how knowledge can truly shared across domains, here's an example.
In react when to pass props on a component we use command=value type of syntax as function arguement,we then take these arguments and process them. If they are boolean types we can just pass the name without value.
REACT/VUE
<Component show/>
SAME AS
<Component show=true/>
LARAVEL Commands
In laravel command do it the samoe way
php artisan commandName {show}
SAME AS
php artisan commandName {show=true}
Both these statement pass value=true by just being stated.The behavior is the same,though they are not declared on a similar manner.
This a good example of transfer behavior across different domains in programming.
Posted on August 29, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.