vendredi 4 septembre 2020

How to Save Data from Controller to a Place. So, I can Use It to All Controllers or Views in Laravel?

Example, I want to save $id below to a place. Then I can use in other controllers or views.

class StudyController extends Controller
{
    public function show($id)
    {
            
            $item = Course::findOrFail($id);
            $theories = Theory::WHERE('subpart', $item->subpart)->get();

            return view('pages.teacher.class.dashboard-class-study', [
                'items' => $theories,
                'idCourse' => $id,
            ]);
    }



Aucun commentaire:

Enregistrer un commentaire