I'm trying to get Laravel 5 and ask a question, which is probably very easy to solve, but I'm afraid.
I have a controller called TestController and it is located in \ app \ Http \ Controllers
This is the controller:
<?php
namespace App\Http\Controllers;
class TestController extends Controller {
public function test()
{
$diamonds = diamonds::find(1);
var_dump($diamonds);
}
}
Then I have a model that I created that resides in / app:
<?php
namespace App;
class diamonds extends Model {
}
Set aside all other errors that I am sure there are, my problem is that laravel is causing the error:
FatalErrorException in line TestController.php 10: class 'App \ Http \ Controllers \ diamonds' not found
So, how can I make the controller understand that I am pointing to a model, not a controller?
Thanks in advance...
source
share