lundi 21 août 2017

Laravel 5.1 translate an array pass to blade

I have this in my controller

public function editProfile(Request $request){
  $question1 = Question::where('group',1)->lists('question', 'id');
  $question2 = Question::where('group',2)->lists('question', 'id');

  return view('user', compact(''question1', 'question2'));
}


$question = {\"1\":\"What is the first name of your best friend in high school?\",\"2\":\"What was the name of your first pet?\",\"3\":\"What was the first thing you learned to cook?\",\"4\":\"What was the first film you saw in the theater?\"}

$question2 = {\"5\":\"Where did you go the first time you flew on a plane?\",\"6\":\"What is the last name of your favorite elementary school teacher?\",\"7\":\"In What city or town does your nearest sibling live?\"}

I would like to translate the value in both question 1 and question 2 and pass it to user blade without changing the key, Any suggestions?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire