Switch Condition in Laravel service provider

Viewed 170

I was trying to get a french month using service provider.

my code is,

Blade::directive('frenchmonth', function($arguments){

       switch($arguments)
 {

     case "January":
     $frmonth="Janvier";
     break;

     case "February":
     $frmonth="Février";
     break;

     case "March":
     $frmonth="Mars";
     break;
}

 return "<?php echo \"{$frmonth}\"; ?>";

        });

But it returns Undefined variable: frmonth.

How to solve this issue?

0 Answers
Related