I was studying a way to return the version of an API tag in an endpoint and look how simple it is to do using PHP and Laravel:
You just need to create a "git.php" file inside the project's config folder with the code below:
<?php
return [ 'tag' => exec('git describe --tags --abbrev=0'), ];
Then just access the key using the config('git.tag') helper and you're done. And you can still make it simpler than that lol
#laravel #git
•
Meet Cart — your seamless solution for efficient shopping cart management in Laravel. Simplifying everything from product additions to total calculations, Cart ensures a frictionless user experience for e-commerce applications.
github.com/realrashid/cart
#Php #PhpTip #Laravel #Backend #Database #DevOps #RealRashid #Eloquent #Models #PHPDevelopment #CodingTips #WebDevelopment #RealWorldExample #DataTransformation #DataSecurity #DeveloperSkills #LaravelTricks #Customization #DataSanitization #Git