Trying to install backpack one folder above admin #864
-
I'm attempting to install Backpack on a somewhat fresh laravel project (only installed Breeze). I am very new to laravel, php and backpack. I want to have the leftbar navigation option, which i believe is Tabler. I don't need everything under an admin subfolder. I want to use backpack right when a user logs in, and have the "admin" dashboard be the regular dashboard. I will have an admin section, but I want to just have one sidebar item that says "Admin" that will still use the same leftbar navigation. I'd implement user controls into the leftbar and also in the admin pages themselves. Basically, i want to have the user login to the dashboard, and then each item on my leftbar will have its own subfolder within the application. So one subfolder for "queue", one for "user profile", one for "admin", one for "approvals" etc that will key off of user roles inside of the users table. I feel that putting everything under the Admin folder just makes everything more cluttered, as i will need an "admin" folder under the default admin folder created by backpack. Is this possible? On discord I was told to just route_prefix to '' and that should do the trick, but does this happen before or after I install the packages? Knowing this, is backpack + tabler the right tool for the job? I already have Breeze installed and working. Assuming I can get backpack to work at the user level dashboard, I am wondering if I should just restart with a fresh laravel project and just use backpack for both the login functions and the dashboard, and skip Breeze entirely. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @benlron I think I am identifying you from your intro. Hey there 👍 I am the same as in discord hehe :) I replied to you shortly on discord, but I will try to come up here with a better answer. From what I understood from your question there, you are only using breeze because it was suggested, and it's in Laravel docs. You can look at Backpack as "other starter kit", but we didn't stop on the "start" and you are able to take Backpack from start to finish a project. Backpack will provide you the same thing that breeze provides plus the "backpack-ecosystem" for you to build your panels. I think you are doing some "mental confusion" with the folders, let me try to rephrase what I am trying to say:
And I think here is when the confusion starts. We usually look at admin panels the following way:
So anything that someone can do while logged in should be inside the In your case I would just have like: app/Http/Controllers/Admin
- DashboardController.php
app/Http/Controllers/Admin/Approvals
- ApprovalsController.php
- SomeCustomOperationYouCreated.php
app/Http/Controllers/Admin/Queues
- QueueController.php I wouldn't spend much time organizing this now, you are just starting with everything (php, laravel, your project ..), so do "some" organization so that you know where your stuff is, but you can always change things from place later when you start having let's say, 10+ controllers under I will give you my unsolicited advice for starters, this is my own view and does not reflect the views of anyone else I work with. For example, I advocate for "slim controllers" they should just get the request, give it to some service for processing and return the results, but it's totally fine for you that are just testing how stuff works etc to have validation in a controller and move to your next problem. You can refactor that later. Don't stop the questions, we are a small, but beginner friendly community. We all have been in your shoes before and we identify the struggles 👍 Cheers |
Beta Was this translation helpful? Give feedback.
-
I will close because there is an answer. Cheers. |
Beta Was this translation helpful? Give feedback.
Hey @benlron I think I am identifying you from your intro. Hey there 👍 I am the same as in discord hehe :)
I replied to you shortly on discord, but I will try to come up here with a better answer.
From what I understood from your question there, you are only using breeze because it was suggested, and it's in Laravel docs.
Breeze is a "Starter Kit", basically it gives you authentication, a dashboard etc and you build upon it.
You can look at Backpack as "other starter kit", but we didn't stop on the "start" and you are able to take Backpack from start to finish a project.
Backpack will provide you the same thing that breeze provides plus the "backpack-ecosystem" for you to build your panels.