@Snapey Ok thnx, below the full code, as i said, theres not much in there, just a function that collects users and store in variable (array) and outputs to blade view. Im currently getting 500 results in the blade view instead of the +1900 that are in the array and which is outputted correctly in the controller. So when i pass the variable to the view its getting (automatically) chunked?
Controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
class MyController extends Controller
{
public function FetchAllUsers() {
$token = XXXXXXXXXXXXXXXXXXXXXXX;
$url = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
try{
$guzzleResponse = Http::withOptions([
'verify' => false,
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Authorization' => "$token",
]
])->GET($url);
if ($guzzleResponse->getStatusCode() == 200) {
$response = json_decode($guzzleResponse->getBody()->getContents(), true);
foreach($response['results'] as $i){
$user_table[] = $i;
}
}
//dd($user_table);
return view('users', compact('user_table'));
}
} catch (ClientException $exception) {
echo Psr7\Message::toString($exception->getResponse());
echo "\n-----------------------------------------------------\n";
}
}
}
Route:
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\UserManagementController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\MyController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/users', [MyController::class, 'FetchAllUsers']);
Blade View:
@dd($user_table)
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div>
<div>
<table class="table text-nowrap table-hover">
@foreach( $user_table as $items )
<tbody>
<tr>
<td>{{ $items['id'] }}</td>
<td>{{ $items['modified'] }}</td>
<td>{{ $items['username'] }}</td>
<td>{{ $items['first_name'] }}</td>
<td>{{ $items['middle_name'] }}</td>
<td>{{ $items['last_name'] }}</td>
<td>{{ $items['email'] }}</td>
<td>{{ $items['display_name'] }}</td>
<td>{{ $items['gender'] }}</td>
<td>{{ $items['birth_date'] }}</td>
<td>{{ $items['address'] }}</td>
<td>{{ $items['zipcode'] }}</td>
<td>{{ $items['city'] }}</td>
</tr>
</tbody>
@endforeach
</table>
</div>
</div>
</div>
</div>
@endsection