
Creating a Rest API with Laravel
This article was originally published on bmf-tech.com . We are using React as the frontend framework with Laravel, and since we needed to design an API, we decided to give it a try. What We'll Do Create a ResourceController to build a simple API that outputs data Implement authentication middleware in anticipation of public API exposure What We Won't Do Explain REST Update or delete API data Fetch and output data using Ajax Environment Laravel 5.2 Creating a Resource Controller The artisan's morning starts early... php artisan make:controller HogeController --resource When the artisan gets to work, they create a controller like this. <?php namespace App\Http\Controllers ; use Illuminate\Http\Request ; use App\Http\Requests ; class HogeController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index () { // } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function cre
Continue reading on Dev.to React
Opens in a new tab


