How or where to add some code to help Laravel to delete products' images which related to the deleted sub category record when using Laravel CASCADE?
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('sub_category_id');
$table->foreign('sub_category_id')->references('id')->on('sub_categories')->onDelete('CASCADE');
$table->text('description');
$table->double('price');
$table->string('image');
$table->timestamps();
});
Note that: I upload images to 'public/' path.