/** * Display a listing of the resource. * * @return Response */ public function index() { $character = new Character(['first_name' => 'Arcadia', 'last_name' => 'Townsend', 'description' => 'A test character for testing purposes. Testy test.']); $character->save(); $characters = Character::get(); print_r($characters->toArray()); }
/** * Display a specific character. * * @param int $id * @return Response */ public function show($id) { $character = Character::find($id); if (!$character) { return Response::json(['error' => ['message' => 'Character does not exist']], 404); } return Response::json(['data' => $lesson]); }