I have a little problem:
I have created an API from my DB with Laravel; i used this API in my Vue.js with AXIOS and it'all ok (with stamp and with console.log).
I have "readed" my API with postman, and i tryed to select a single value with id (in this case number 1), but it doesn't work.
Like this method:
http://127.0.0.1:8000/api/players/1
With other API it's works, but in this case, it doesn't return the id value.
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Player;
class PlayerController extends Controller
{
public function getAll()
{
$players = Player::all();
return response()->json($players);
}
}
Hello! Sorry, I'm not familiar with Vue.js or AXIOS so maybe I'm lost here. But shouldn't you specify a route and controller method to show a single player?