feat!: upgrade to Laravel 13 compatibility

- Update laravel/framework to ^13.0, tinker to ^3.0, query-builder to ^7.0
- Migrate User model to #[Fillable] and #[Hidden] attributes (Laravel 13 pattern)
- Add LARAVEL_130 ruleset to Rector configuration
- Add PHP 8.4 to CI test matrix
- Update README badges and description for Laravel 13

BREAKING CHANGE: requires Laravel 13.x, drops Laravel 12 support
This commit is contained in:
Jean-Marc Strauven
2026-03-30 17:59:00 +02:00
parent c72b740749
commit f2dcd0059a
6 changed files with 673 additions and 786 deletions

View File

@@ -12,6 +12,10 @@ jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -19,7 +23,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: xdebug

View File

@@ -1,9 +1,9 @@
# Laravel API Kit
A production-ready, API-only Laravel 12 starter kit following the 2024-2025 REST API ecosystem best practices. No frontend dependencies - purely headless API for mobile apps, SPAs, or microservices.
A production-ready, API-only Laravel 13 starter kit following the 2025-2026 REST API ecosystem best practices. No frontend dependencies - purely headless API for mobile apps, SPAs, or microservices.
[![PHP Version](https://img.shields.io/badge/PHP-8.3%2B-blue)](https://php.net)
[![Laravel Version](https://img.shields.io/badge/Laravel-12.x-red)](https://laravel.com)
[![Laravel Version](https://img.shields.io/badge/Laravel-13.x-red)](https://laravel.com)
[![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
## Features

View File

@@ -6,6 +6,8 @@ namespace App\Models;
use Database\Factories\UserFactory;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Hidden;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
@@ -21,6 +23,15 @@ use Laravel\Sanctum\HasApiTokens;
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*/
#[Fillable([
'name',
'email',
'password',
])]
#[Hidden([
'password',
'remember_token',
])]
final class User extends Authenticatable implements MustVerifyEmail
{
use HasApiTokens;
@@ -30,27 +41,6 @@ final class User extends Authenticatable implements MustVerifyEmail
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*

View File

@@ -7,13 +7,13 @@
"license": "MIT",
"require": {
"php": "^8.3",
"dedoc/scramble": "^0.12",
"dedoc/scramble": "^0.12|^0.13",
"grazulex/laravel-apiroute": "^2.0",
"laravel/framework": "^12.0",
"laravel/framework": "^13.0",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.10.1",
"laravel/tinker": "^3.0",
"spatie/laravel-data": "^4.0",
"spatie/laravel-query-builder": "^6.0"
"spatie/laravel-query-builder": "^7.0"
},
"require-dev": {
"driftingly/rector-laravel": "^2.0",
@@ -94,7 +94,7 @@
"php-http/discovery": true
},
"platform": {
"php": "8.3.30"
"php": "8.4.5"
}
},
"minimum-stability": "stable",

1406
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -21,6 +21,7 @@ return RectorConfig::configure()
LaravelSetList::LARAVEL_FACTORIES,
LaravelSetList::LARAVEL_IF_HELPERS,
LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES,
LaravelSetList::LARAVEL_130,
])
->withImportNames(
removeUnusedImports: true,