Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User class does not exist #2

Closed
vbezruchkin opened this issue Oct 4, 2017 · 12 comments
Closed

User class does not exist #2

vbezruchkin opened this issue Oct 4, 2017 · 12 comments
Assignees

Comments

@vbezruchkin
Copy link

hi guys,

I tried to install your package. No errors, it went smoothly.

Anyhow, here is what I get when I run it after installation:

 [ErrorException]
  class_implements(): Class App\Models\User does not exist and could not be loaded

Though I have App/Models/User.php

Please advise. Thanks

@palypster
Copy link
Contributor

Hi @vbezruchkin, thanks for your report. Can you be more specific, where do you get this error, when you load the web in browser?

Can you please check, if you accidentaly don't have both app and App folders - we have an issue, that on some platform it creates two directories that differs in first capital letter. Can you confirm this is not the case?

@palypster
Copy link
Contributor

palypster commented Oct 4, 2017

@vbezruchkin we are about to merge this PR BRACKETS-by-TRIAD/admin-generator#2 which should fix problem with app/App folders. I'm not sure if this relates to this issue as well, but I guess that it does relate.

@vbezruchkin
Copy link
Author

Hi,

Yes, it's when I run the server. Exactly - I have both app & App folders. Please advise.

Thanks

@palypster
Copy link
Contributor

@vbezruchkin we have fixed this in BRACKETS-by-TRIAD/admin-generator#2

Easiest solution is to delete whole project and start over again with craftable new [project_name]. Let us know if it works now for you.

@vbezruchkin
Copy link
Author

It worked fine in my MacOS environment. I managed to run it when I followed the instructions.

I will check the issue tomorrow on my Windows (that's where I had this issue) and let you know the results.

Thanks

@vbezruchkin
Copy link
Author

Guys, I still have the same problem on my windows:

 /mnt/d/projects/laravel/craftable  composer global require "brackets/craftable-installer"                                   Changed current directory to /home/vbezruchkin/.composer
Using version ^1.0 for brackets/craftable-installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

I recreated the project using craftable new project_name command, but I still see two folders (app & App) in the project root :((

@palypster
Copy link
Contributor

palypster commented Oct 5, 2017

@vbezruchkin This is really weird. I have thought that on Windows there is not possible to have two folders that differ only in case. Anyway, we have tested this on windows as well and it works for us. So we need really more details. Can you send us version of windows, PHP, composer, craftable-installer and your composer.lock file?

@vbezruchkin
Copy link
Author

Well, I actually use Linux subsystem for windows 10, so I virtually use Ubuntu 16.04 on my windows box. Here is what I have:

 /mnt/d/projects/laravel/craftable  uname -a                                                                                    Linux vbezruchkin 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux

 /mnt/d/projects/laravel/craftable  php --version                                                                               
PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

 /mnt/d/projects/laravel/craftable  composer --version                                                                        
Composer version 1.5.2 2017-09-11 16:59:25

 /mnt/d/projects/laravel/craftable  craftable --version                                                                        
Craftable Installer 1.0.2

Let me know if you need anything else.

Thanks

@palypster
Copy link
Contributor

@vbezruchkin okay I think I know where the problem is. Problem is in your PHP version - for development (includes also for creating a craftable project) PHP 7.1 is required. If you have exiting Craftable project, 7.0 is enough for serving it in production. But 7.1 is required.

What is actually happening here is that your Craftable is using other our package admin-generator of a lower version (v1.0.1), that does not have the fix we have pushed yesterday (v1.0.3). Your composer is choosing a lower version because of a PHP version restriction. Please try to upgrade your PHP and create new project from scratch again. You don't have to update craftable-installer, just create new cratable project craftable new [project_name] and this is going to use latest version of admin-generator once PHP 7.1 is installed.

@vbezruchkin
Copy link
Author

Ah ok thanks for the information. I will give it another chance later on mac.

Cheers

@palypster
Copy link
Contributor

We will consider of simplifying our Documentation and just say you have to have PHP 7.1 (because now it may be confusing).

@jkibiyi
Copy link

jkibiyi commented Feb 15, 2023

I had the same issue. For solution i Created a new folder (App\Models) and dragged User.php into it. everything worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants