Skip to content

Instantly share code, notes, and snippets.

View sdavara's full-sized avatar

Shailesh B. Davara sdavara

View GitHub Profile
@sdavara
sdavara / Git-Pre-commit-setup.md
Last active July 25, 2023 16:36
Git-pre-commit-hooks for PHP/Laravel Project

Pre Commit Setup

Setup pre-commit hook in php projects for lint, code standard, test cases etc.

Prerequisites

  • php >= 5.6
  • composer
  • git

Installation

<?php
namespace Tests\Feature\tests\Api;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Models\Appointments;
use App\Models\User;
<?php
namespace Tests\Feature\tests\Api;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Models\Ticket;
use App\Models\TicketHistory;