Q: Need help in registration system In  laravel9 I have created following tables

*

*users (its laravel auth ui)

*tournamnets

*matches (in matches i have column "name")

*registrations (in registration I have relation with users and one column status_id Bydefault its 0  and relation with matches is hasmany and belongsTo)

Note: match id is linked with hasmany and belongsto relation
Note: registrations and tournamnets have Pivot table which is reg_tours
Column names are tournaments_id and registrations_id.
Now I need with user  registered for the specific tournament and registrations status is 0 the show {you are registered} in that specific tournament  and if with user  registered for the specific tournament and that registrations status is any match id which is linked with belongs to relation then show that match name
Tournament Controller
public function singleTournament($id) {
   $game = Game::all();
   $data = Tournament::find($id);

   if ($data->teamsize == 1) {
      $data->teamsize = "Solo";
   } elseif ($data->teamsize == 2) {
      $data->teamsize = "Duo";
   } elseif ($data->teamsize == 4) {
      $data->teamsize = "Squad";
   }
   return view('site.tournament',compact('data','game'));
}

Thank You!
I need to show status for specific tournament to specific user

A: you can add initialize for the status variable before
