vendredi 29 avril 2016

Join statment in controller not working Laravel 5.0

Works perfectly in routes but does not work in controller. What might be wrong?

    public function index(){

    $positions = DB::table('position')
    ->join('company', 'position.company_id', '=', 'company.id')
    ->select('position.*', 'company.name')
    ->get();

    //Just to check if its working
    print_r($positions);
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire