I keep getting the following error:
Use of undefined constant App - assumed 'App'
when I do:
Route::get('/tasks', function () {
$tasks = App / Task::all();
return view('tasks.index', compact('tasks'));
});
This is how my model look like and it is located in the root of app directory:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Task extends Model
{
//
}
Then if I change it to $tasks = 'App' / Task::all();
as it suggests then I get the class not found error:
"Class 'Task' not found"
I have no clue what´s wrong, but as I am following a 5.4 tutorial and I am working with 5.6 there must be something different.
Please help me.