Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.15k stars 891 forks source link

Cant install Backpack 4.0 on Laravel 6.0 #2024

Closed rodrigoUriarte closed 5 years ago

rodrigoUriarte commented 5 years ago

Bug report

New project on Laravel6 and following backpack doc, do composer require backpack/crud and composer try to install BP3.6, installation failed. There is a way to install BP4.0 on L6.0, its stable? Or maybe BP3.6 on L6.0? Im starting a new project and want to be updated. Thanks

welcome[bot] commented 5 years ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication mediums:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

tabacitu commented 5 years ago

Hi @rodrigouriarte05 ,

I've just pushed support for Laravel 6 in Backpack 3.6. The v4 branch will get it soon enough (later today).

Cheers!

tomsb commented 5 years ago

I tried to install fresh Backpack 4.0 on Laravel 6.0, it went like this:

1. laravel new test

As per backpack v4 installation docs:

2. cd test
3. composer require backpack/crud:"v4.x-dev as 4.0.0"
4. composer require webfactor/laravel-generators --dev

Error:

OK, let's skip it for now, next:

5. composer require backpack/generators --dev
6. composer require laracasts/generators --dev
7. php artisan backpack:install

Next, as per CRUD Tutorial:

8. php artisan make:migration:schema create_tags_table --model=0 --schema="name:string:unique"
9. php artisan migrate
10. php artisan backpack:crud tag
11. php artisan backpack:add-custom-route "Route::crud('tag', 'TagCrudController');"
12. php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-link' href='{{ backpack_url('tag') }}'><i class='nav-icon fa fa-tag'></i> Tags</a></li>"

OK, now let's open our "test" website in browser: http://test.test/admin/login UI is broken - errors found in browser console (many 404 erros for script & css files, jQuery not found etc - it's trying to load from vendor/adminlte/...)

OK, let's register a new account and login. UI is broken (as expected). Let's open "Tags" menu item: http://test.test/admin/tag Response: 404 page not found.

tabacitu commented 5 years ago

OMG @tomsb - such a horrible experience for you installing v4beta :-)) I'm sorry.

Indeed, the generators are NOT ready for v4 yet (neither webfactor's, nor backpack's). Can't even install them right now. I've updated the v4beta docs to say this. So you can't do php artisan backpack:crud tag either. I'll try to push a generators v4 update later today - tomorrow the latest.


What I don't understand is why the views look broken for you, though. Did the php artisan backpack:install process fail, or go smoothly? I suspect that might be the problem - the CSS&JS assets not being published for some reason. Do you have anything in your public/packages folder? It should look like this:

Screenshot 2019-09-12 at 14 18 41

I've just tried installing it with the same steps you performed, and (ignoring the fact that the generators can't be installed) everything went smoothly... pages look crisp and work as expected...

ikkebra commented 5 years ago

I am having similar issues when installing the v4 beta on a clean install of laravel 6 running php 7.2. My packages folder looks like the one above.

The source code shows there are still css files and javascript files trying to be pulled from vendor/adminlte This is what my page looks like:

Screen Shot 2019-09-12 at 5 26 37 AM Screen Shot 2019-09-12 at 5 34 36 AM
tomsb commented 5 years ago

php artisan backpack:install - went smoothly. public/packages looks just like in your screenshot. I found view files containing vendor/adminlte: image

tabacitu commented 5 years ago

I've just pushed v4 support for backpack/generators. So you can now generate CRUDs like before. It will also add a sidebar item and route now. One command: php artisan backpack:crud product

Thanks for joining @ikkebra . Seems like the same issue @tomsb is having. This is definitely not normal, something got messed up, but I don't understand what got messed up. It looks like you're using some old views from v3 - maybe layout.blade.php or inc/head.blade.php but it really doesn't make sense if it's a fresh install... I've just tried it again - it installs v4 well for me.

1) Can you please give me a screenshot of what's in your resources/views/vendor/backpack folder? Not just folders, files also. 2) If you run php artisan backpack:version what do you get?

Thanks!

tabacitu commented 5 years ago
  1. AdminLTE should not be installed at all. Please confirm the folder vendor/almasaeed2010/adminlte does not exist in your projects.
tomsb commented 5 years ago

Just tried again with fresh install. Everything went smoothly and UI is OK. No errors.

  1. resources/views/vendor/backpack - It's as it should be.

  2. vendor/almasaeed2010/adminlte does not exist.

  3. php artisan backpack:version

    PHP VERSION:

    PHP 7.2.11 (cli) (built: Oct 10 2018 02:04:07) ( ZTS MSVC15 (Visual C++ 2017) x64 )

    LARAVEL VERSION:

    laravel/framework v6.0.3 The Laravel Framework.

    BACKPACK VERSION:

    backpack/crud v4.x-dev 0703c0d Quickly build an admin interfaces using Laravel 6, CoreUI, Boostrap 4 and jQuery. backpack/generators 2.0.0 Generate files for laravel projects

tabacitu commented 5 years ago

Pfiew :-) Thank you @tomsb . Are the answers 1-3 from the WORKING install, or from the NON-WORKING one?

tomsb commented 5 years ago

From working install. Shift-deleted non-working install before saw your previous comment.

tomsb commented 5 years ago

BTW, UI is work in progress? It will look like this in the end: https://coreui.io/demo ?

tabacitu commented 5 years ago

Ok got it. @ikkebra maybe you can help with the 1-3 answers then? On the non-working app? To see what went wrong?

--

No, actually I consider the design pretty much done. It could use some more polish, but overall was happy with how it looks - before you said that 😆 . It's a customized CoreUI - I thought their design was a bit dated for 2019, so I put my designer gloves on, took some inspiration from Tabler, Dropbox, Stripe and... this is where I got. I call the theme/design "Backstrap" - demo here.

Not a fan of how it looks? 😄

ikkebra commented 5 years ago

1 & 3

Screen Shot 2019-09-12 at 9 29 51 AM

2

PHP VERSION:

PHP 7.2.22-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Sep 2 2019 12:54:33) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.22-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

LARAVEL VERSION:

laravel/framework v6.0.3 The Laravel Framework.

BACKPACK VERSION:

backpack/base 1.1.11 Laravel Backpack's base package, which offers admin authentication and a blank admin panel using AdminLTE backpack/crud v4.x-dev 0703c0d Quickly build an admin interfaces using Laravel 6, CoreUI, Boostrap 4 and jQuery. backpack/generators 1.2.7 Generate files for laravel projects

ikkebra commented 5 years ago

I just did another clean install of everything and it loads just fine now.

ikkebra commented 5 years ago

3 on this new clean install

LARAVEL VERSION:

laravel/framework v6.0.3 The Laravel Framework.

BACKPACK VERSION:

backpack/crud v4.x-dev 0703c0d Quickly build an admin interfaces using Laravel 6, CoreUI, Boostrap 4 and jQuery. backpack/generators 2.0.1 Generate files for laravel projects

tomsb commented 5 years ago

No, actually I consider the design pretty much done. It could use some more polish, but overall was happy with how it looks - before you said that 😆 . It's a customized CoreUI - I thought their design was a bit dated for 2019, so I put my designer gloves on, took some inspiration from Tabler, Dropbox, Stripe and... this is where I got. I call the theme/design "Backstrap" - demo here.

Not a fan of how it looks? 😄

Oh, ok. Was wondering why it looks so different from CoreUI demo 😄 Backstrap is nice but will it be possible to easily switch to default CoreUI template if needed?

tabacitu commented 5 years ago

Haha. Smooth :-)

Yes, you can go back to it looking like CoreUI (sidebar and header) by changing two config values in config/backpack/base.php:

    // Horizontal navbar classes. Helps make the admin panel look similar to your project's design.
-    'header_class' => 'app-header bg-transparent border-0 navbar position-relative',
+    'header_class' => 'app-header border-0 navbar position-relative',

    // Sidebar element classes.
-    'sidebar_class' => 'sidebar sidebar-pills sidebar-bg-transparent',
+    'sidebar_class' => 'sidebar',

    // Footer element classes.
-    'footer_class' => 'app-footer',
+    'footer_class' => 'app-footer d-none',

The success/error/warning/info colors will still be Backstrap, though - we tweaked those a little bit. and how the inputs look. But I don't think those will be the thing people have a problem with, but the transparent sidebar and header. Which is... better in my opinion. Since it helps the design draw attention to the content, not the menus. But it's opinionated nonetheless, so expect plently of people will want to change it :-)

martijnb92 commented 5 years ago

I am having similar issues when installing the v4 beta on a clean install of laravel 6 running php 7.2. My packages folder looks like the one above.

The source code shows there are still css files and javascript files trying to be pulled from vendor/adminlte This is what my page looks like:

Screen Shot 2019-09-12 at 5 26 37 AM Screen Shot 2019-09-12 at 5 34 36 AM

Experiencing the same (looks exactly like this screenshot). Tried upgrading 3.6 to 4 using the upgrade guide. AdminLTE is installed by composer for some reason. HTML looks like a hybrid 3.6/4 and I have no custom views.

tabacitu commented 5 years ago

@martijnb92 that's great! (that we can debug this now; not that you're having problems 😄 )

How about after a php artisan view:clear and php artisan cache:clear ?

martijnb92 commented 5 years ago

Unfortunately that did not change anything. Also tried removing the whole vendor folder. Maybe it has something to do with de base/crud merge? backpack/base is also being installed by composer. Lastly I tried php artisan backpack:install but that didn’t help either, except that I got two new blade topbar left/right files.

tabacitu commented 5 years ago

Hmm.... can I please see your composer.json file?

martijnb92 commented 5 years ago

"backpack/generators": "^1.2" Appears to be causing the trouble! :)

tabacitu commented 5 years ago

Exactly! Thanks a lot this back-and-forth @martijnb92 . I've updated the upgrade guide to mention that you also need "backpack/generators": "^2.0" in require-dev.

Cheers!

tabacitu commented 5 years ago

@tomsb just added more docs for changing the top menu and sidebar colors, for a different look & feel. Ended up documenting a few good examples too, with screenshots.

vesper8 commented 5 years ago

I just stumbled on this issue as well.. I did not realize Backpack 4 was still in Beta since there seems to be no obvious indication of this anywhere. Maybe I'm just blind but the only place I even see 'beta' is as part of these instructions

# Note during v4 beta - this might NOT have v4 support yet
composer require webfactor/laravel-generators --dev

Which lead to an error

@tabacitu Why not remove this line of instructions altogether since it just doesn't work at the moment?

vesper8 commented 5 years ago

Note that using "webfactor/laravel-generators": "dev-master" works as a result of https://github.com/webfactor/laravel-generators/commit/e325b434b8e199539ab1635fabbd85ee632037f3, so the instructions should be changed to

composer require webfactor/laravel-generators:dev-master --dev
tabacitu commented 5 years ago

@vesper8 v4 is not in beta right now - it's stable. Just forgot that notice since it was in beta (the beta docs have become the v4 docs). I've removed them like you suggested, you're right.

As far as I know, webfactor/laravel-generators does provide V4 support on dev-master, but the controllers aren't updated for v4, I'll make sure to spend some time and help the guys upgrade too. I do plan to improve how we generate things A LOT in the coming months.