JeffreyWay / Laravel-4-Generators

Rapidly speed up your Laravel workflow with generators
https://packagist.org/packages/way/generators
MIT License
27 stars 9 forks source link

Call to undefined method [package] in L5 #437

Closed cawa87 closed 9 years ago

cawa87 commented 9 years ago

I've try to comment $this->package('way/generators') in boot method

     * Booting
     */
    public function boot()
    {
     //   $this->package('way/generators');
    }

But then you have new errors, like:

php artisan generate:controller   TestController
exception 'Way\Generators\Filesystem\FileNotFound' in /home/cawa/www/l5-app/vendor/way/generators/src/Way/Generators/Filesystem/Filesystem.php:45
avlastenok commented 9 years ago

I am receiving the same error here. Just now that I cant get it to work I really realize how much I use it.

Same error on all functions

jonathanpmartins commented 9 years ago

You can see on this commit: laravel/framework@3a0afc2 It is not a plugin problem. The L5 package system is being re-developed.

avlastenok commented 9 years ago

@jonathanpmartins thank you for pointing it out usefull information must have missed that commit.

cawa87 commented 9 years ago

@jonathanpmartins I know that, they are moving workbench in a standalone package. But now you can use packages too, with some modifications.

jonathanpmartins commented 9 years ago

Yeah, I like to learn that better!

RyanThompson commented 9 years ago

Configuration is loaded manually now for packages.

abishekrsrikaanth commented 9 years ago

Is there a way to fix this? Or should we wait till the framework is fixed?

cawa87 commented 9 years ago

@abishekrsrikaanth better wait till release

jcorry commented 9 years ago

@RyanThompson how do you 'manually' load configuration for a package then? I'm unclear if there are steps involved for how to use this package (or others) in L5 that I don't know about...or if there are changes coming to L5 that will restore the L4 method (adding the package service provider to app/config/app.php providers array?) @JeffreyWay can you weigh in on this? I have a L5 project that is SEVERELY crippled by my not knowing how to incorporate all of the packages I am accustomed to. Maybe you've covered it in a Laracast or somewhere else and I haven't seen it, but I need to figure this out ASAP.

RyanThompson commented 9 years ago

@jcorry Here are a couple examples of how I do it in our software:

https://github.com/anomalylabs/streams-platform/blob/master/src/Addon/AddonConfiguration.php

Could be as easy as this though: https://github.com/anomalylabs/streams-platform/blob/master/src/Addon/AddonConfiguration.php (or use files->getRequire there too)

His response indicated no, it's all on us now. But I've heard him suggest otherwise but only as a "maybe". My guess it 5.1 or something might reintroduce a more convenient method.

jcorry commented 9 years ago

Thanks, that helps...but what does the round trip from composer install [package] to calling the package methods through its Facade look like? I'm not 100% clear on this and haven't found any resources that make it clear.

RyanThompson commented 9 years ago

Not sure what you mean regarding the round trip - but you can register facades in your service provider manually if that's what you are asking: http://laravel.com/docs/4.2/facades#creating-facades

Hope this helps!

jcorry commented 9 years ago

Thanks @RyanThompson. I'm not sure where I am falling down, but am unclear how to use a package (like Way Generators) anymore. If I add the package's serviceprovider class to the 'providers' array in my app config, it fails. If I comment out the line calling package() in the package's service provider, it still fails. I'm unclear whether there is a new method for registering/incorporating package service providers in L5. What do you do, after installing a package with composer, to make it available in your L5 app?

thomasvanlankveld commented 9 years ago

Anyone have a copy-pastable solution for this package yet?

morrislaptop commented 9 years ago

I've got a package which can fix this - https://github.com/morrislaptop/LaravelFivePackageBridges