-1
public function getListaPresencial(Request $request, Presencial $Presencial)
{
if ($Presencial->id) {
return response()->json(['data' => $Presencial->toArray()]);
}
$query = Presencial::query();
$tipo = 1;
$query->select('id', 'nome_professor', 'nome_disciplina', 'nome_curso', 'nome_turma', 'data_inicio');
// $query->where('id','=',1 );
$query->where('tipo','=',$tipo );
$query->whereDate('data_inicio', date('Y-m-d'));
return response()->json($query->paginate($request->get('limit')));
}
I need to bring the result of the search in a variable:
Example:
$nomeprofessor = ?
$nomedisciplina = ?
so I can write in another table only this data.
Just to make sure what version of your Laravel?
– Erlon Charles