Zipper icon indicating copy to clipboard operation
Zipper copied to clipboard

Non-static method Chumper\Zipper\Zipper::make() should not be called statically

Open Danjavia opened this issue 10 years ago • 10 comments

Used on laravel 5.1

Danjavia avatar Sep 08 '15 16:09 Danjavia

same in laravel 5.2. did you resolve?

includeleec avatar May 30 '16 14:05 includeleec

This will work: $zipper = new Zipper(); $zipper->make($zipfile)->add($files);

inaydich avatar Jul 29 '16 21:07 inaydich

This will work: $zipper = new Zipper(); $zipper->make($zipfile)->add($files);

still got error with this code

robertoandres24 avatar Aug 02 '16 15:08 robertoandres24

in routes.php file works well. but doesnt in any controller. for instance HomeController

robertoandres24 avatar Aug 02 '16 15:08 robertoandres24

what error do you get? did you reference "use Chumper\Zipper\Zipper;" in controller? I am using php7-laravel5.2. It is working for me.

inaydich avatar Aug 02 '16 15:08 inaydich

sorry. my mistake. use Chumper\Zipper\Zipper; $zipper = new Zipper(); $zipper->make($zipfile)->add($files); this works for me. i was trying call method make this $zipper::make() instead of $zipper->make()

robertoandres24 avatar Aug 02 '16 16:08 robertoandres24

y es thanks. miss the reference .its working for me too now El ago. 2, 2016 12:54 PM, "inaydich" [email protected] escribió:

what error do you get? did you reference "use Chumper\Zipper\Zipper;" in controller? I am using php7-laravel5.2. It is working for me.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Chumper/Zipper/issues/55#issuecomment-236949683, or mute the thread https://github.com/notifications/unsubscribe-auth/AK-TVjAAjdT3N2Bq60YbydeDGiwX1alkks5qb2g6gaJpZM4F5p1S .

robertoandres24 avatar Aug 02 '16 17:08 robertoandres24

cool! good luck!

inaydich avatar Aug 02 '16 18:08 inaydich

Use the facade if you don't want to new-up an instance yourself.

use Chumper\Zipper\Facades\Zipper;

Zipper::make($path);

ewstefan avatar Jul 14 '17 10:07 ewstefan

@ewstefan is the correct answer, thanks!

JoaoPortella avatar Oct 04 '18 13:10 JoaoPortella