Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lay's avatar
Level 1

I have a small question. Regarding laravel 12.21.0 and 12.30.0, there are some changes.

Previously, I created a project on 12.21.0 and used React as the frontend. The route name was defined as route('api.user.name'). However, in 12.30.0, it changed to api.user.name().url. Here are my questions:

  1. Why did this change?
  2. How is this change better than the previous version?
  3. Besides actions, routes, wayfinder, are there any folders I shouldn't edit?
  4. Can I not install an older version of Laravel? I tried composer create-project laravel/laravel="12.21.0" my-app, but it didn't create the project.
PS C:\lay\php\laravel> composer create-project laravel/laravel="12.21.0" my-app
Creating a "laravel/laravel=12.21.0" project at "./my-app"

In CreateProjectCommand.php line 430:
                                                                
  Could not find package laravel/laravel with version 12.21.0.  
                                                                

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--ask] [--] [<package> [<directory> [<version>]]]
  1. How does this new form work?
  1. And finally, where can I track changes and documents? (Latest update)
1 like
11 replies
lay's avatar
Level 1

Thanks for the tip, I never knew laravel had a github, and yes I mean laravel as a framework. Don't get me wrong, I'm new to laravel lol.

1 like
jlrdw's avatar

Can you give the reference to api.user.name().url

1 like
lay's avatar
Level 1
Route::middleware('auth')->prefix('dashboard')->name('dash.')->group(function () {
    Route::get('wallet', function () {
        return Inertia::render('dashboard/wallet');
    })->name('wallet');
});
import dash from '@/routes/dash';
const mainNavItems: NavItem[] = [
    {
        title: 'Wallet',
        href: dash.wallet().url,
        icon: LayoutGrid,
    },
];


Route::middleware('auth')->prefix('api')->name('api.')->group(function () {
    Route::prefix('dashboard')->name('dash.')->group(function () {
        Route::controller(WalletApiController::class)->group(function(){
            Route::prefix('wallet')->name('wallet.')->group(function(){
                Route::get('history', 'showHistory')->name('history');
            });
        });
        //  Other API routes can be added here
    });
});
1 like
vincent15000's avatar

@lay So it's really not a problem with the new version of Laravel, but rather a problem with React.

Can you show the content of the @/routes/api file ?

lay's avatar
Level 1

I'm not sure what you want to see, but if I write a route in routes/api.php, @/routes/api will be regenerated. I just want to know how it's better than the old one. Or am I the first to try it? Haha

// app-1\resources\js\routes\api\index.ts
import post from './post'
import match from './match'
import dash from './dash'
const api = {
    post: Object.assign(post, post),
match: Object.assign(match, match),
dash: Object.assign(dash, dash),
}

export default api

// It contains all the routes folders defined in `app-1/routes/api.php`.
// app-1\resources\js\routes\*

vincent15000's avatar

I just upgraded a personal project from v12.28 to v12.30 and I have nothing to change to use the named routes. All works fine as before the upgrade.

The route name was defined as route('api.user.name'). However, in 12.30.0, it changed to api.user.name().url.

the route name is define with ->name('api.user.name') and then used with route('api.user.name').

Are you using the route name from React ? With Ziggy ? How ?

1 like
lay's avatar
Level 1

I created a new project and used the react starter kit. I noticed that the change is that laravel changed the route definition. I know it was originally route('api.user.name') but now it is api.user.name().url and imports the route like import api from "@/routes/api";. I checked my code and I don't see Ziggy on my package.json. So I guess it is not using Ziggy.

AlannaContreras's avatar

It looks like Laravel has made some updates in 12.30.0 to make route handling more consistent and clear, especially when working with frontends like React. The new api.user.name().url syntax helps avoid ambiguity and makes it easier to generate URLs dynamically. Regarding editing folders, it’s usually safe to avoid touching core folders like vendor or internal Laravel config files—stick to your controllers, routes, and resources.

Also, if you are in the real estate industry and building apps for property listings, having a reliable frontend-backend setup is key. Companies like real estate web design company use Laravel with React to create smooth, user-friendly property portals. It’s a good example of how proper routing and structure make large applications easier to manage.

Composer may not allow older versions if they aren’t available in Packagist; you might need to check the exact tags or use LTS versions instead.

1 like
Snapey's avatar

nice AI piece. Mostly fluff.

2 likes
jlrdw's avatar

LaryAI is going to be jealous.

1 like

Please or to participate in this conversation.