Laravel framework controller gets the model layer error:-php Tutorial

Source: Internet
Author: User
When the controller of laravel framework retrieves the model layer, the following error occurs: the zcbo under the vender directory is a custom package. the following information is saved: the directory structure is as follows: the controller code is as follows: the model-layer code is as follows: add the composer under the zcbo directory. json...

When the laravel framework controller acquires the model layer, the following error occurs:
The directory structure is as follows:
Zcbo under the vender directory is a custom package;

Save the following information:

The directory structure is as follows:

The controller code is as follows:

The model layer code is as follows:

Question added: composer. json under the zcbo Directory

Question added:

Composer update error:

Composer. json file:

Reply content:

When the laravel framework controller acquires the model layer, the following error occurs:
The directory structure is as follows:
Zcbo under the vender directory is a custom package;

Save the following information:

The directory structure is as follows:

The controller code is as follows:

The model layer code is as follows:

Question added: composer. json under the zcbo Directory

Question added:

Composer update error:

Composer. json file:

Paste composer. json under your zcbo directory to see if, should psr-4 part of the error, troubleshoot. You can check other packages under the vendor. the composer. json has an autoload for automatic loading. you can add your corresponding packages. Reference
I have asked you a question before. I don't know if your package has been released to packagist. of course, you need to release it. Also, you need to introduce so many dependencies into the first custom package, you can familiarize yourself with any small function.

Composer under the zcbo directory. json needs to configure the appropriate compliant autoload psr-4 or PSR-1 so that composer update will generate a ING of the namespace-> class directory, you can see this ing file in the vendor/composer/folder.
You can refer to other packages that have been installed.

In addition, according to my visual test, your "BAE \": "src" here, src should be src/

The error of composer update is because your package is in dev state, so you need to put your package under require-dev.

The specified namespace is not quite correct.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.