Reputation: 3730
I created a package which also contains his own controller files and also a router.php file.
My problem is that i can't access anyone of the main classes like Schema
or View
.
I always get a Error: Class not Found error.
Upvotes: 1
Views: 111
Reputation: 6075
I'm assuming you're using namespaces in your package, which you should be. As a result, you need to precede global classes with a backslash to access them. For example, View::make()
becomes \View::make()
.
Alternatively, you could import the Facades:
<?php
namespace Your\Namespace;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\View;
//...
View::make($view, $data);
See the PHP namespace FAQ.
Upvotes: 1