in routes can be retrieve
Route::get('', function() {
return User::all();
});
this reuslt [{"id":2,"name":"amman","number":4567889,"location":"aaaa","phone":125454},{"id":3,"name":"amman","number":4567889,"location":"aaaa","phone":125454},{"id":4,"name":"aaaa","number":0,"location":"aaaa","phone":0},{"id":5,"name":"aaaaaaaa","number":2147483647,"location":"aaaaaa","phone":100000000},{"id":6,"name":"\u0634\u0634\u0634\u0634","number":14545454,"location":"\u0628\u0644\u0628\u0644\u0628\u0644\u0628\u0644\u0628","phone":5455454},{"id":7,"name":"aaaa","number":0,"location":"aaa","phone":0},{"id":8,"name":"mohammad","number":766354353,"location":"aaaa","phone":25536563},{"id":9,"name":"mohammad","number":1235464,"location":"aaaaa","phone":2147483647},{"id":10,"name":"aaaaaaaaaaaaa","number":12121,"location":"aaaa","phone":1212121},{"id":11,"name":"mohammad","number":0,"location":"aaa","phone":0}]
how can be retrieve previous data in table?
Its Json what you posted is used for creating ajax requests so you have to do it with ajax and use json or render some view and use array.
// routes.php
Route::get("/", function()
{
$users = User::all();
return View::make("users")->with("allUsers", $users);
});
// views/users.blade.php
<table>
<tr>
<td>ID</td>
<td>Name</td>
</tr>
@foreach($allUsers as $usr)
<tr>
<td>{{ $usr->id }}</td>
<td>{{ $usr->name }}</td>
</tr>
@endforeach
</table>
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community