How to get data from two tables in laravel - W3codegenerator

PHOTO EMBED

Wed Dec 21 2022 19:43:06 GMT+0000 (Coordinated Universal Time)

Saved by @hassan_aheer #php

Route::get('/concat-table', function(){
    $users = App\Models\User::get();
    $posts = App\Models\Post::get();
    $data = $users->concat($posts);
    dd($data);
});
content_copyCOPY

https://w3codegenerator.com/code-snippets/laravel/how-to-get-data-from-two-tables-in-laravel