jeudi 14 septembre 2017

Is there any difference between using '=' in a 'join' or 'where' on Laravel?

I have used both ways:

$this->data = DB::table('projects')
     ->select('companies_info.*', 'project_roles_types.name AS project_role_name')
     ->join('project_companies_members', 'project_companies_members.project_id', 'projects.project_id')
     ->where($some_variable, $project_id)
     ->get();

and:

$this->data = DB::table('projects')
    ->select('companies_info.*', 'project_roles_types.name AS project_role_name')
    ->join('project_companies_members', 'project_companies_members.project_id', '=', 'projects.project_id')
    ->where($some_variable, '=', $project_id)
    ->get();

and for me it has worked the same either adding or removing the = sign. Does anybody know if this is allowed? If so, what's the best way to do it? Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire