Egzan
Egzan

Reputation: 113

Laravel form choosing form

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 ?

Upvotes: 0

Views: 29

Answers (1)

user2693928
user2693928

Reputation:

You must use "==" to compare:

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

Upvotes: 2

Related Questions