Laravel形式选择形式

I have problem with laravel form and choosing files

$language = $request->input('language');

  if($language = "eng"){
    $type = "emails/eng";
  } else if($language = "pl" ){
    $type ="emails/pl"; 
  }
  dump($language);
  dump($type);

when I do that in controller I always get the same result with "eng" but when I delete if rules I get "eng" and "pl".

Any help with that ?

You must use "==" to compare:

 if($language == "eng"){
    $type = "emails/eng";
 } else if($language == "pl" ){
    $type ="emails/pl"; 
 }