Have frontend and backend in original folder structure so one project.
Separate frontend and backend.
I have tried 2 in the past but I think it has to be deployed at the same time to avoid mishap. Therefore I am considering option 1, but I want to know if that is too naive. I want to learn from you all. I think with Laravel Vapor deploying assets to S3/CDN, 1 sounds very appealing to me now, so my entire app is deployed instantly without me having to maintain API codebase and Client codebase in separate project folders.
Routing needs modifications to work like that. Check RouteServiceProvider.php to configure it like this if you need separate routing for each end.
The reason I went this way was that I needed the separation. That's the only reason behind my decision.
But otherwise, all Laravel built-in functionality can work out-of-the-box with this structure. All sub-folders within App can be separated into their own "namespace"
Haven't testet this approach myself, but I like the concept of using Vue, Laravel and Passport in one project. I guess you could switch Vue with Nuxtjs also. Take a look at this GitHub project: Laravel-Vue-Passport
As always depends on current patterns, size, and deployment strategy. No one app is like another.
The size I mean more of a physical scale. 300 models? 10 models?
Using a pattern can dictate that too
Using TDD may dictate too.
A strategy is where is the backend is in relation to front end? Many time using Vue, devs keep completely separate for apps and other API stuff. I do, and use just an api.
Also what feels good? I personally rather click a bit into folders then scroll huge file.
I have decided now that with Laravel Vapor up and running, I will be keeping my backend and frontend in the same folder. API will be still stateless, frontend will still be consuming JWT auth. All same stuff but same folder, utilising the power of atomic deployments with S3/CDN assets working out of the box.
If my project scales and I bring more team members, I will seperate it to api.project.com (api) and app.project.com (client). There's nothing wrong with this approach given ChipperCI has also rolled out.