app/Http/Controllers/ToDoItemController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $public_items = ToDoItem::where('status', 'public')->get();
        $public_items->load('user');
        return response()->json($public_items, 200);
    }
public function index ( ) { $ public_items = ToDoItem :: where ( 'status' , 'public' ) -> get ( ) ; $ public_items -> load ( 'user' ) ; return response ( ) -> json ( $ public_items , 200 ) ; }
Display a listing of the resource.
Display a listing of the resource .