Laravel, parameter in a function

I have this function, the idea is to create an object of the class type and transmit it to a service for it to perform the corresponding logic.

Public Service Index ()
$ data = [
        'user_id' => '1',
        'name' => test test test',
        'description' => 'test',

$ class = new class ();
$ class-> create ($ data);

ClassroomService :: CalculateNewClassroom ($ class);

Until now, I created the Classroom object and sent it as a parameter to the "CalculateNewClassroom" function where I defined it that way.

Public static function CalculateNewClassroom (Class $ class)
dump ($ class);

This dump returns empty, but in the first function, when I create the "class", I see how the data is placed in the corresponding table. So I create the object and save it to the database.

My question is, in this second function, when I pass the parameter, should I indicate that it is classroom type? Is this a good practice?

In both cases, I tried to put it or not and the dump appears empty.

Thank you