For reference, I worked with this tutorial https://scotch.io/tutorials/build-a-time-tracker-with-laravel-5-and-angularjs-part-2 .
I wanted to get acquainted with laravel 5, since earlier I used only 4 and found the above tutorial, which was also mixed with a little angular js. I followed part one and two of the writing tutorials and created the database using mysql and phpmyadmin as indicated.
I get to the section, on the half of which the group route with the api prefix is โโconfigured to pull the data from the database and display it in the view.
...
Route::group(array('prefix' => 'api'), function()
{
Route::resource('time', 'TimeEntriesController');
Route::resource('users', 'UsersController');
});
, , , . , " , 404 ( )", time-tracker-2/public/api/time.
, userdata
...
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\TimeEntry;
use Illuminate\Support\Facades\Request;
class TimeEntriesController extends Controller {
public function index()
{
$time = TimeEntry::with('user')->get();
return $time;
}
...
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Http\Request;
class UsersController extends Controller {
public function index()
{
$users = User::all();
return $users;
}
Laravel, angular, , - . , , . , - , .
, .