<?php
namespace App\Http\Controllers;
use App\Model\question;
use Illuminate\Http\Request;
class QuestionController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return question::latest()->get;
}
这是我的控制器
<?php
Route::apiResource('/question','questioncontroller');
这是我的api.php