Answers for "How to convert array to object of an array laravel"

PHP
0

laravel array to object

public function index() {

    $user = Auth::user();
    $page = array(
        'title' => 'Hello World',
        'template' => 'welcome',
    );

    $page = (object)$page;

    return View('index', array(
        'user' => $user,
        'page' => $page,
    ));

}
Posted by: Guest on June-20-2021

Code answers related to "How to convert array to object of an array laravel"

Browse Popular Code Answers by Language