Call/Show table from database
Budget: €8 – €30 EUR
Hello guys,
I want to call table “shares” which contains the field “allow_showpassword_in & showpassword_in” inside.
I am calling the api - Route::get(’/showPW’, [GetPasswordNote::class, ‘index’]);
The “GetPasswordNote” file I have looks like this:
<?php
namespace Domain\Sharing\Controllers;
use DB;
use App\Http\Controllers\Controller;
class GetPasswordNote extends Controller
{
public function index()
{
$users = DB::table('shares')->select('allow_showpassword_in', 'showpassword_in')->get();
return $users;
}
}
and I wanted to make the values of these 2 fields appear, when I make the call in the vue file
<tbody v-for="(user, index) in users" :key="index">
<tr>
<th>{{ user.allow_showpassword_in }}</th>
<th>{{ user.showpassword_in }}</th>
</tr>
</tbody>
fetchUsers() {
this.isLoading = true;
this.users = [];
axios
.get('/api/showPW')
.then((response) => {
const data = response.data;
this.users = data;
this.isLoading = false;
})
},
but it does block the page.
Thank you
I want to call table “shares” which contains the field “allow_showpassword_in & showpassword_in” inside.
I am calling the api - Route::get(’/showPW’, [GetPasswordNote::class, ‘index’]);
The “GetPasswordNote” file I have looks like this:
<?php
namespace Domain\Sharing\Controllers;
use DB;
use App\Http\Controllers\Controller;
class GetPasswordNote extends Controller
{
public function index()
{
$users = DB::table('shares')->select('allow_showpassword_in', 'showpassword_in')->get();
return $users;
}
}
and I wanted to make the values of these 2 fields appear, when I make the call in the vue file
<tbody v-for="(user, index) in users" :key="index">
<tr>
<th>{{ user.allow_showpassword_in }}</th>
<th>{{ user.showpassword_in }}</th>
</tr>
</tbody>
fetchUsers() {
this.isLoading = true;
this.users = [];
axios
.get('/api/showPW')
.then((response) => {
const data = response.data;
this.users = data;
this.isLoading = false;
})
},
but it does block the page.
Thank you