mercredi 27 mars 2019

Getting syntax error when using foreach in controller

This is my controller and I'm getting syntax error when using foreach in controller

namespace App\Http\Controllers;

use DB;

class course_controller extends Controller {

    public function show_details() {
        $prospects = DB::table('prospect')->get();

        foreach ($prospects as $prospect) {
            DB::table('course_prospect')->insert(['prospect_id' => 
$prospect->id, 'course_id' => $prospect->course_intrested])
        };

    }

}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Wt7ahM
via IFTTT

Aucun commentaire:

Enregistrer un commentaire