marekmiklusek / laravel-starter-kit-livewire
A Laravel livewire starter kit with code quality tools pre-configured.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:Blade
Type:project
pkg:composer/marekmiklusek/laravel-starter-kit-livewire
Requires
- php: ^8.4.0
- laravel/fortify: ^1.31.2
- laravel/framework: ^12.37.0
- laravel/tinker: ^2.10.1
- livewire/flux: ^2.6.1
- livewire/volt: ^1.9.0
- nunomaduro/essentials: ^1.0.1
Requires (Dev)
- driftingly/rector-laravel: ^2.1.3
- fakerphp/faker: ^1.24.1
- larastan/larastan: ^3.8.0
- laravel/boost: ^1.7.0
- laravel/pail: ^1.2.3
- laravel/pint: ^1.25.1
- laravel/sail: ^1.47
- mockery/mockery: ^1.6.12
- nunomaduro/collision: ^8.8.2
- pestphp/pest: ^4.1.3
- pestphp/pest-plugin-browser: ^4.1.1
- pestphp/pest-plugin-laravel: ^4.0.0
- pestphp/pest-plugin-type-coverage: ^4.0.3
- rector/rector: ^2.2.7
README
Laravel's official Livewire starter kit enhanced with development workflow tools, code quality standards, and additional developer experience improvements from laravel-starter-kit. โจ
๐ Requirements
- PHP >= 8.4.0
- Composer
- Node.js & NPM
- MySQL (or your preferred database)
๐ Quick Start
๐ฆ Installation
Create a new Laravel Livewire project:
composer create-project marekmiklusek/laravel-starter-kit-livewire --prefer-dist app-name
Run the automated setup script:
composer setup
This command will:
- Install PHP dependencies via Composer
- Create
.envfile from.env.example(if not exists) - Create
.env.productionfile from.env.example(if not exists) - Generate application key
- Run database migrations
- Install NPM dependencies
- Build frontend assets
โ๏ธ Additional Setup
๐ง Environment Configuration
After running composer setup, configure your .env file with your database credentials:
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_username DB_PASSWORD=your_password
๐ Browser Testing Setup (Optional)
If you plan to use Pest's browser testing capabilities, install Playwright:
npm install playwright npx playwright install
This installs the necessary browser binaries for running browser tests.
๐ Production Environment
The setup script automatically creates a .env.production file. Configure it with production-specific settings:
# Edit .env.production with your production settings
Configure production environment variables:
- Set
APP_ENV=production - Set
APP_DEBUG=false - Configure production database credentials
- Set secure
APP_KEY(generated during setup) - Configure mail, cache, queue, and session drivers
- Set proper logging channels
๐ป Development
๐ฅ๏ธ Running the Development Server
Start all development services concurrently:
composer dev
This starts:
- Laravel development server (port 8000) - Your Livewire application
- Queue listener - Background job processing
- Log viewer (Pail) - Real-time log monitoring
- Vite dev server - Hot Module Replacement for CSS/JS
Your Livewire application will be available at http://localhost:8000 ๐
๐ Code Quality
๐งน Linting & Formatting
Fix code style issues:
composer lint
This runs:
- Rector (PHP refactoring)
- Laravel Pint (PHP formatting)
- Prettier (frontend formatting)
๐งช Testing
Run the full test suite:
composer test
This includes:
- Type coverage (100% minimum)
- Unit and feature tests (Pest)
- Code style validation
- Static analysis (PHPStan)
๐ Browser Testing
This starter kit includes Pest 4 with browser testing capabilities. Create browser tests in tests/Browser/:
it('displays the welcome page', function () { $page = visit('/'); $page->assertSee('Laravel') ->assertNoJavascriptErrors(); });
๐งช Testing Livewire Components
Test your Livewire components with Pest's built-in Livewire testing:
use Livewire\Livewire; it('can update user profile', function () { $user = User::factory()->create(); Livewire::actingAs($user) ->test(\App\Livewire\Settings\Profile::class) ->set('name', 'New Name') ->call('save') ->assertHasNoErrors() ->assertDispatched('profile-updated'); expect($user->fresh()->name)->toBe('New Name'); });
๐ Available Scripts
๐ผ Composer Scripts
composer setup- Initial project setupcomposer dev- Run all development servicescomposer lint- Fix code style issuescomposer test- Run full test suitecomposer test:unit- Run Pest tests onlycomposer test:types- Run PHPStan analysiscomposer test:type-coverage- Check type coveragecomposer test:lint- Validate code stylecomposer update:requirements- Update all dependencies
๐ฆ NPM Scripts
npm run dev- Start Vite dev servernpm run build- Build for productionnpm run lint- Format frontend codenpm run test:lint- Check frontend code style
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.