Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel class not found

I'm a Laravel newbie. I'm working with a package called Confide. It has an error which I'm trying to identify using the Log function. When I call the Log function I get an exception

Class 'Zizaco\Confide\Log' not found 

when I include use Illuminate\Log; I get an error message

Class 'Illuminate\Log' not found 

What am I doing wrong? I have run composer dump-auto -o but there is no change

Here is a section of my code

<?php namespace Zizaco\Confide;

use Illuminate\Log;
use Illuminate\View\Environment;
use Illuminate\Config\Repository;
use InvalidArgumentException;
use Zizaco\Confide\ObjectProvider;



class Confide
{

and the code that causes an error is:

Log::info('The value is '.$token);
like image 677
user1801060 Avatar asked Dec 19 '22 17:12

user1801060


2 Answers

You have to use just Log:

use Log;

Because this is not the class, but the Log Facade.

like image 158
Antonio Carlos Ribeiro Avatar answered Dec 24 '22 02:12

Antonio Carlos Ribeiro


It looks like Illuminate\Log is a namespace, not a class.

See the Laravel API here: http://laravel.com/api/namespace-Illuminate.Log.html

Laravel uses Monolog, and creates a Log facade to it. You should be able to simply use use Log;.

like image 27
Jim D Avatar answered Dec 24 '22 03:12

Jim D