laravel-countdown icon indicating copy to clipboard operation
laravel-countdown copied to clipboard

Facades does not seems to work when used with Laravel 5.5 auto-discovery

Open sluxzer opened this issue 7 years ago • 4 comments

Halo

I like to try it, but when i try to run, it's show:

(1/1) ErrorException Non-static method jpmurray\LaravelCountdown\Countdown::from() should not be called statically

Thank you.

sluxzer avatar Aug 19 '17 18:08 sluxzer

I'll be checking that in the coming days. Until then, can you show me the code you are trying to run?

jpmurray avatar Aug 20 '17 11:08 jpmurray

Hello, I have the same problem. This is the code I am trying to run:

public function devuelveTiempoRestante(){ Carbon::setLocale('es'); $fecha_finaliza_todo = Carbon::parse($this->fechaentrega_tarea); $fecha_ahora = Carbon::parse(date('Y-m-d H:i:s')); $countdown = Countdown::from($fecha_ahora) ->to($fecha_finaliza_todo) ->get(); return($countdown->toHuman()); }

Thank you

diego-mglab avatar Sep 07 '17 08:09 diego-mglab

@diego-mglab Thank you, I'll look at that probably today, if not tomorrow!

jpmurray avatar Sep 07 '17 10:09 jpmurray

@diego-mglab @sluxzer for some reasons, it seems that the auto-loading of the Facade is not working. You would have to include it yourself, like so:

use Facades\jpmurray\LaravelCountdown\Countdown;

That way I could make it work. I'll mark this as a bug to fix, but it's not high in my priorities, especially since we can import the facade ourselves.

jpmurray avatar Sep 07 '17 17:09 jpmurray