LaravelTips and TricksTipsTesting

Feb 15, 2024

How to use git hooks to run scripts before the committing code to repo

By Vladimir Nikolic, CEO Coding Wisely

How to use git hooks to run scripts before the committing code to repo

here iw how.

In root, run this:

touch .git/hooks/pre-commit

Then, make it executable:

chmod +x .git/hooks/pre-commit

#!/bin/sh
echo "Running Pint ... "
files=$(git diff --cached --name-only --diff-filter=ACM -- '*.php');
./vendor/bin/pint $files

git add $files

echo "Running Pest ..." ./vendor/bin/pest --parallel --processes=4

and that is all.

Other posts:

One Year of Building Laravel Serbia: From Zero to 100 Artisans
Laravel
One Year of Building Laravel Serbia: From Zero to 100 Artisans

A year ago, there was no active Laravel community in Serbia. Just an idea, a lot of enthusiasm, and the quiet fear that maybe no one would show up. At first, almost no one did. Here’s how we grew from 0 to +100 members, what I learned along the way, and why I keep building.

Vladimir NikolicVladimir Nikolic
Apr 15, 2026
Breaking the Ice at Laracon: A Small Act That Changes Everything
Breaking the Ice at Laracon: A Small Act That Changes Everything

Feeling shy or like an imposter at a big tech conference? You’re not alone. At Laracon US, one kind gesture changed a developer’s whole experience – proving how powerful a simple introduction can be. In this post, I share that story, how we can make conferences more welcoming, and why I’ve started calling myself the Laravel Social API.

Vladimir NikolicVladimir Nikolic
Aug 2, 2025
Laravel.rs Meetup #1: A New Era for the Serbian Laravel Community
Laravel
Laravel.rs Meetup #1: A New Era for the Serbian Laravel Community

On May 10th, 2025, Laravel.rs officially launched its first-ever meetup in Temerin, bringing together developers from across Serbia for a night of lightning talks, community networking, and a shared love for Laravel. With inspiring talks, open discussions, and future plans for workshops and hackathons, this kickoff event marked the beginning of a vibrant new chapter for Laravel in Serbia. 🚀🇷🇸

Vladimir NikolicVladimir Nikolic
May 15, 2025

Are you set to create something extraordinary?

Ready to take the next step? Let's work together to transform your ideas into reality. Contact us today to discuss how we can help you create impactful, user-centered solutions that drive success.

Contact Us