#Updating a Laravel app with Stancl breaks the application
1 messages · Page 1 of 1 (latest)
How did you update the application. Sometimes a quick rebuild is the fastest and cleanest option. Transferring controllers and routes and making a few tweaks where necessary
just "composer update" and everything went to hell, literally
Hahaha. Take it easy. It happens like that. Do you unmatched dependency upgrades. Sometimes the implementation changes. What version are you upgrading from?
I installed the API and it indicated that certain packages needed updating, and to update I ran "composer update" and after that nothing worked, the app is made from laravel 12.
Can you do “composer run dev” paste the error you get here. Let me see
error: Package "dev" listed for update is not locked.
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- maatwebsite/excel is locked to version 3.1.67 and an update of this package was not requested.
- maatwebsite/excel 3.1.67 requires phpoffice/phpspreadsheet ^1.30.0 -> satisfiable by phpoffice/phpspreadsheet[1.30.1].
- phpoffice/phpspreadsheet 1.30.1 requires php >=7.4.0 <8.5.0 -> your php version (8.5.0) does not satisfy that requirement.
Your application needs you to downgrade your php version to to php spreadsheet
You might want delete composer.lock.json if it exists and package.lock.json if it is present. Then do npm install. Then composer install. Intend for your application to get the latest version of php spreadsheet which might be compatible with php 8.5
Do these steps and tell me the results you get
It doesn't work; in fact, even using version 12.44 breaks the URLs
Is your app using php 8.5 in production? If not you can simply tell composer to assume you're using 8.4 by setting it in composer.json https://getcomposer.org/doc/06-config.md#platform
A Dependency Manager for PHP
If you can push the source code to GitHub and drop the url. I would fork it and have a look for you
Beware with options like those, as it can lead to bugs (seen it happen). The option is rather destructive as there's no longer a version check, including for packages. You're enforcing the PHP version and it doesn't matter which version is actually used. We've had that once, bumped versions (so we thought) including the platform option, CI went fine and when we deployed everything broke down. Turned out there were a few things we hadn't changed, mostly the CI. It was partially a QA issue too, but it's easier for those things to slip through that way
I think the problem is in this part:
"Route::middleware([
'web',
InitializeTenancyByDomain::class,
PreventAccessFromCentralDomains::class,
])->group(function () {
Route::get('/', function () {
return view('tenants.welcome');
});
require DIR.'/auth.php';
});
" because when I do "http://tenant.localhost:8080/" it reaches the established welcome page, but the login and register URLs point to the central domain, "InitializeTenancyByDomain::class" isn't initialized, and "require DIR.'/auth.php';" isn't working either
this is the test code https://github.com/sigkydj/laravel-tenancy-register1
in the main branch all is ok , but in tenant-user the links , url they are broken,
You have these routes on your tenants and on your central domains, so you're defining the same routes twice. Then if they'd also use the same name, then it's a "first come first serve" situation (or last, idk exactly), point is, there's just one of those named routes that would work.
So it's probably not an upgrade that caused this, more likely a code change.
No, what happens is that the main branch works since everything indicated on the stancl/tenancy page is done but the register-tenant branch is only the update to access the welcome.php but from the tenant
Not sure what you mean, but those routes don't make sense and do explain the issue you're facing.
The truth is, this doesn't look good at all. Wouldn't it be better to create a tenant from scratch?
Did you even attempt to debug? Like, what I've mentioned?
Because that perfectly describes the issue you're facing; The login route is registered multiple times, so it exists at multiple places.
In the image you publish, they are the two branches that I published,
- In the branch on your left it works without applying tenant routes as they are on the right side of the image