I have two Mysql tables.One is matches and other one is betsettings. i have match_id as a foreign key in betsettings table.Now how can i get betsettings information for every match_name ? i want to show every matches all betsettings information under that match name.I am using laravel
matches table:
Schema::create('matches', function (Blueprint $table) {
$table->increments('id');
$table->string('match_name');
$table->timestamps();
});
betsettings table:
Schema::create('betsettings', function (Blueprint $table) {
$table->increments('id');
$table->integer('match_id')->unsigned();
$table->dateTime('close_time');
$table->string('status')->default('active');
$table->timestamps();
});
Schema::table('betsettings', function( $table) {
$table->foreign('match_id')
->references('id')
->on('matches')
->onDelete('cascade')
->onUpdate('cascade');
});