简体   繁体   中英

Loading a composer package into Laravel 5

Solved: I've added the php and illuminate/support packages into my package composer.json file and it started working. I've got no idea why though so if someone could explain, I would really appreciate it.

"require": {
    "php": ">=5.4.0",
    "illuminate/support": "~5.0"
 },

I've created a composer package for Laravel 5 which should generate models based on an existing database schema. However i'm unable to load it in.

I add my Command class into the app/Console/Kernel.php

'Iber\Generator\Commands\MakeModelsCommand'

But then I get the following error:

Class Iber\Generator\Commands\MakeModelsCommand does not exist 

I'm really new to Laravel and I'm not sure why this is happening since composer generates the autoloader file just fine. I've created and added (into config/app.php) a Service Provider but that doesn't get resolved either. Not sure what I'm doing wrong.

Here's the package:

https://github.com/ignasbernotas/laravel-model-generator

Apparently adding the required attribute with the following packages solved the issue. I'm still not sure why.

"require": {
    "php": ">=5.4.0",
    "illuminate/support": "~5.0"
 },

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM