app/Http/Controllers/API/DynamicAPIController.php
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
Display a listing of the resource.
Display a listing of the resource .
public function index()
{
$all = dynamic::all();
$last=count($all);
$posts = dynamic::find($last);
return $this->sendResponse($posts->toArray(), 'Posts retrieved successfully.');
}
public function index ( ) { $ all = dynamic :: all ( ) ; $ last = count ( $ all ) ; $ posts = dynamic :: find ( $ last ) ; return $ this -> sendResponse ( $ posts -> toArray ( ) , 'Posts retrieved successfully.' ) ; }
Display a listing of the resource.
Display a listing of the resource .