Reputation: 113
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
Reputation:
You must use "==" to compare:
if($language == "eng"){
$type = "emails/eng";
} else if($language == "pl" ){
$type ="emails/pl";
}
Upvotes: 2