如何从数据库中显示默认值

I am trying to get data from the database then display the data in input form as default. I'm using angularjs $http get method to retrieve the data but failed.

My laravel route

Route::group(array('prefix' => 'api', 'before' => 'csrf'), function() {
    Route::get('student', function() {
        $name = Student::where('name')->first();

        return Response::json($name);
    });
}

Angularjs

.controller('syncApiCtrl', function ($scope, $timeout, Module, $http) {
    $http.get('api/student').success(function(data) {
        $scope.name = data;     
        console.log(data);
    });

...

I would like to get the name from the Student table but the result return to me is something like

Result

<!DOCTYPE html><!--[if lt IE 7]>      <html lang="en" class="no-js lt-ie9 lt-ie8 lt-ie7">

Student::where('name')->first(); is incorrect. If you want to retrieve the name of the first student do Student::first()->name;, but consider that Student::first() can be null if the database table is empty.

I hope this will help you:

Route::prefix('api')->group(function () {
    Route::get('student', function() {
        $name = Student::first()->name;

        return Response::json($name);
    });
});