search

Home  >  Q&A  >  body text

laravel-php How to create a class in the vendor directory by yourself to achieve automatic loading

phpcn_u1582phpcn_u15822740 days ago472

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-05-16 13:07:55

    Add: Cart.php的头部声明namespace Mypack;
    然后在composer.json文件的autoload/psr-4 inside the

    node
    "Mypack\":"vendor/mypack"

    In addition: It is not recommended to place customized class files in the vendor directory. You can create a directory with other names such as the same level library yourself.

    reply
    0
  • Cancelreply