DEV Community

Cover image for Kickstart Your Next Project with Confidence
Nasrul Hazim Bin Mohamad
Nasrul Hazim Bin Mohamad

Posted on

Kickstart Your Next Project with Confidence

When starting a new Laravel project, I always found myself repeating the same steps: installing essential packages, publishing configs and migrations, setting up a proper project structure, writing helpers, configuring QA tools, and adding CI/CD workflows.

I also have the Project Template, pre-configured with all common setup.

But then, I'm thinking back, if I want to use the same or similar setup for new Laravel project, that would be nice, without maintaining Project Template and It will be useful for other people to use same approach as mine.

Thatโ€™s why I created Laravel Starter โ€” a template repository with a script that handles all the heavy lifting for you.

The script will automate the setup to follow configurations based on my Project Template and some practices I use in my articles.


โœจ Why Laravel Starter?

Instead of spending the first hour of a new project setting things up, you can bootstrap your Laravel app in a few minutes:

  • ๐Ÿ“ฆ Installs essential packages (Permissions, Media Library, Auditing, Debugging, etc.)
  • โš™๏ธ Configures QA tools like PHPStan, Rector, Pest, and Pint
  • ๐Ÿ›  Sets up a clean project structure
  • โœ… Generates an architecture test suite to enforce coding standards
  • ๐Ÿ“ Creates documentation templates (Changelog, Contributing, Security, Support, License)
  • โšก Adds GitHub Actions workflows for linting, testing, static analysis, and changelog updates
  • ๐Ÿ”ง Runs migrations & artisan tasks automatically

๐Ÿ“‚ Project Structure Highlights

After running the setup script, youโ€™ll notice a few key improvements:

support/helpers.php

A central place for reusable helper functions, auto-loaded via Composer.

Organised Routes

Routes are split into:

  • routes/web/
  • routes/api/
  • routes/console/

Each main file (web.php, api.php, console.php) auto-loads all files in its directory.

tinker/ Directory

A scratchpad for experiments, ignored by Git.

docs/README.md

Kickstarts your documentation with a default TOC.

Architecture Test

Pest-powered tests to enforce conventions (e.g., no dd() or raw DB queries in App).


๐Ÿ“ฆ Included Packages

Core

Developer Tools


๐Ÿ› ๏ธ Usage

This script is meant for new Laravel projects only.

In your fresh Laravel project root, run:

curl -s https://raw.githubusercontent.com/cleaniquecoders/laravel-starter/main/setup.php | php
Enter fullscreen mode Exit fullscreen mode

The script will:

  1. Install all required packages.
  2. Update composer.json with QA scripts and helper autoloading.
  3. Create support/, routes/, tinker/, and docs/ directories.
  4. Publish vendor configs and migrations.
  5. Generate documentation templates and CI workflows.
  6. Run artisan tasks like migrations and storage linking.

๐Ÿงช Example: Architecture Test

Out of the box, youโ€™ll have tests/Feature/ArchitectureTest.php with useful rules, like:

arch()
    ->expect(['dd', 'dump', 'ray'])
    ->not
    ->toBeUsedIn([
        'app',
        'config',
        'database',
        'routes',
        'support',
    ]);

arch()
    ->expect('App\Http\Controllers')
    ->toHaveSuffix('Controller');
Enter fullscreen mode Exit fullscreen mode

This ensures your project stays clean and consistent as it grows.


๐Ÿ“Œ Next Steps

  • Update .env with your projectโ€™s database and mail settings.
  • Commit and push to GitHub.
  • Watch the included GitHub Actions workflows automatically lint, analyse, and test your code.

๐ŸŒฑ Conclusion

With Laravel Starter, you donโ€™t need to waste time reinventing your base setup. Youโ€™ll have a ready-to-go Laravel project with industry best practices baked in โ€” so you can focus on what matters: building features.

I'm planning to add more related setup in the future. For start, this is good enough.

Top comments (0)