I'm trying to bring data to a view to do some testing on Laravel but it's not working.
Controller
class ProfileController extends Controller
{
private $aluno;
private $request;
public function __construct(Aluno $aluno, Request $request)
{
$this->aluno = $aluno;
$this->request = $request;
}
public function index()
{
$id = '39';
$alunos = $this->aluno
->select('*')
->where('id', '=', $id)
->get();
return view('profile.index', compact('alunos'));
}
Model
<?php
namespace App\Models\Profile;
use Illuminate\Database\Eloquent\Model;
class Aluno extends Model
{
protected $table = 'aluno';
}