pyaesoneaung / laravel-starter-kit-vue
Laravel 12 Vue starter kit with built-in strict typing, enhanced code quality tools, and safety features.
Package info
github.com/PyaeSoneAungRgn/laravel-starter-kit-vue
Language:Vue
Type:project
pkg:composer/pyaesoneaung/laravel-starter-kit-vue
Requires
- php: ^8.3
- inertiajs/inertia-laravel: ^2.0
- internachi/modular: ^3.0
- laravel/framework: ^13.0
- laravel/tinker: ^3.0
- tightenco/ziggy: ^2.4
Requires (Dev)
- driftingly/rector-laravel: ^2.0
- fakerphp/faker: ^1.23
- larastan/larastan: ^3.0
- laravel/boost: ^2.4
- laravel/pail: ^1.2.2
- laravel/pint: ^1.18
- laravel/sail: ^1.41
- mockery/mockery: ^1.6
- nunomaduro/collision: ^8.6
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- rector/rector: ^2.0
- tightenco/duster: ^3.2
README
Laravel 12 Vue starter kit with built-in strict typing, enhanced code quality tools, and safety features.
Installation
laravel new --using pyaesoneaung/laravel-starter-kit-vue --git
Setup Git Hooks
npm install
Features
✅ Strict Models
Model::shouldBeStrict();
This does three things:
- Prevents lazy loading
- It prevents silently discarding attributes.
- It prevents accessing missing attributes.
✋ Prevent Destructive Commands
Preventing the execution of destructive commands in production environments.
DB::prohibitDestructiveCommands(app()->isProduction());
⚡️ Automatic Relation Loading
Laravel can automatically eager load the relationships you access.
Model::automaticallyEagerLoadRelationships();
🪝 Git Commit Hook
Run duster lint for PHPStan, duster fix for refactor with Rector, and format with Laravel Pint before every commit.
Default Laravel Rector Rules
The following Rector rules are applied via LaravelSetList::LARAVEL_CODE_QUALITY, LARAVEL_COLLECTION, and LARAVEL_TYPE_DECLARATIONS sets, targeting app/, config/, routes/, and all module source directories.
// rector.php return RectorConfig::configure() ->withPaths([ __DIR__.'/app', __DIR__.'/config', __DIR__.'/routes', __DIR__.'/app-modules/*/src', ]) ->withSetProviders(LaravelSetProvider::class) ->withComposerBased(laravel: true) ->withSets([ LaravelSetList::LARAVEL_CODE_QUALITY, LaravelSetList::LARAVEL_COLLECTION, LaravelSetList::LARAVEL_TYPE_DECLARATIONS, ]) ->withPhpSets();
EloquentMagicMethodToQueryBuilderRector
use App\Models\User; -$user = User::find(1); +$user = User::query()->find(1);
EloquentWhereRelationTypeHintingParameterRector
-User::whereHas('posts', function ($query) { +User::whereHas('posts', function (Builder $query) { $query->where('is_published', true); }); -$query->whereHas('posts', function ($query) { +$query->whereHas('posts', function (Builder $query) { $query->where('is_published', true); });
EloquentWhereTypeHintClosureParameterRector
/** @var \Illuminate\Contracts\Database\Query\Builder $query */ -$query->where(function ($query) { +$query->where(function (Builder $query) { $query->where('id', 1); });
ModelCastsPropertyToCastsMethodRector
use Illuminate\Database\Eloquent\Model;
class Person extends Model
{
- protected $casts = [
- 'age' => 'integer',
- ];
+ protected function casts(): array
+ {
+ return [
+ 'age' => 'integer',
+ ];
+ }
}
ScopeNamedClassMethodToScopeAttributedClassMethodRector
class User extends Model
{
- public function scopeActive($query)
+ #[\Illuminate\Database\Eloquent\Attributes\Scope]
+ protected function active($query)
{
return $query->where('active', 1);
}
}
WhereToWhereLikeRector
-$query->where('name', 'like', 'Rector'); -$query->orWhere('name', 'like', 'Rector'); -$query->where('name', 'like binary', 'Rector'); +$query->whereLike('name', 'Rector'); +$query->orWhereLike('name', 'Rector'); +$query->whereLike('name', 'Rector', true);
🧩 Modular
This starter kit uses internachi/modular for domain modules under app-modules/.
php artisan make:module {name}
php artisan make:model {Name} --module={module}
php artisan modules:list
php artisan modules:sync
php artisan test app-modules/{module-name}/tests
😺 GitHub Actions
Automated workflows for continuous integration, running Laravel Pint and PHPStan on every push and pull request.