reziamini / laravel-easypanel

A beautiful and flexible admin panel creator based on Livewire for Laravel
https://easypanel.netlify.app/getting-started
MIT License
615 stars 104 forks source link

Files are not being generated properly #7

Closed mgrWetales closed 3 years ago

mgrWetales commented 3 years ago

After crud generation files are not being generated properly. Controllers are showing on the root with names like below.

"App\\Http\\Livewire\\Admin\\Article\\Create.php"
"App\\Http\\Livewire\\Admin\\Article\\Read.php"
"App\\Http\\Livewire\\Admin\\Article\\Single.php"
"App\\Http\\Livewire\\Admin\\Article\\Update.php"
"App\\Http\\Livewire\\Admin\\User\\Create.php"
"App\\Http\\Livewire\\Admin\\User\\Read.php"
"App\\Http\\Livewire\\Admin\\User\\Single.php"
"App\\Http\\Livewire\\Admin\\User\\Update.php"

Screenshot from 2021-02-18 14-40-29

I am using EasyPanel with Laravel Framework 8.27.0 and installed Jetstream with livewire as well.

reziamini commented 3 years ago

Could you please give me a screenshot of your directory structure?

mgrWetales commented 3 years ago

I am using a docker container. Screenshot from 2021-02-18 15-07-28 directory-structure.txt

reziamini commented 3 years ago

I guess it's because of your coding production and Directory separator. I pushed a force release with 1.3.3 tag. Reinstall package with --no-cache flag in composer then remove files and try this version out .

mgrWetales commented 3 years ago

It worked but only the controller got generated, views, routes, and other things didn't happen.

Also, the user is not being converted to admin with the flag is_superuser in the user's table. Command-line showing it's done.

Screenshot from 2021-02-18 15-33-31 Screenshot from 2021-02-18 15-30-29

reziamini commented 3 years ago

There two directories, "app" and "App" right? please tell me about the information and structure of "App" directory, I think your OS care about capitalizied word

mgrWetales commented 3 years ago

Yes, right, I am using Ubuntu and it strictly case sensitive. See screenshot: Screenshot from 2021-02-19 10-36-07

reziamini commented 3 years ago

You can update with --no-cache flag in the composer this problem has been fixed.

mgrWetales commented 3 years ago

Yes, this problem has been fixed.

Other issues are still there:

  1. sail artisan panel:add [user_id] this command is not working, the is_superuser DB value is not changing to 1

  2. When I made it manually and ran http://192.168.1.47/admin, got below error: image

  3. I didn't run command for article but article views got generated: Screenshot from 2021-02-19 15-40-43

reziamini commented 3 years ago

About is_superuser I have been working on this. Because of article crud example, other 2 problems will be made. I will remove this example in new version. Do these steps: 1 - Remove resources/cruds/article.php 2 - Remove article key in config/easy_panel.php in actions key. 3 - Run sail artisan panel:crud -f

mgrWetales commented 3 years ago

Wow, good job done bro, it worked. Thank you :)

Few more things I noticed:

  1. My todo feature is false in the easy_panel.php but still todo directory got created under resources/views/vendor/admin/livewire/todo Screenshot from 2021-02-19 16-03-38 Screenshot from 2021-02-19 16-03-19

  2. Article views are still there under resources/views/livewire/admin/article Screenshot from 2021-02-19 16-08-07

  3. Admin user should be redirected to the admin panel by default, for now, I am changing the URL and navigating to the admin panel.

reziamini commented 3 years ago

TODOs file should be generated anyway because you can run migrations and set TODOfeature as true and todo should be shown just with a refresh. In the new release, we don't have article examples anymore. Redirect automatically isn't a good choice, sometimes you don't want to see the admin panel and it's not a good action to redirect. In the future, we will create new commands to delete actions and manage them better.

Thank you for your time that spends.

mgrWetales commented 3 years ago

Cool, I will be waiting for the update to make the user a superuser.

One more question :) resources/views/vendor/admin/livewire/todo/ resources/views/livewire/admin/user/

Why todo view files are at a different location?

Can't we use one directory "admin" under the views folder to place layouts and other module views to make it simple? livewire & vendor/livewire folders are really required?

reziamini commented 3 years ago

Both of them are required. Because of conflict with other packages, we put base files in different directories.