app/Http/Controllers/Member/PlanController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
     */
Display a listing of the resource.
Display a listing of the resource .
public function index()
    {
        try {
            $plans = Plan::all();
            if ($plans->count() === 0) {
                abort(404, "No plans found");
            }
            return PlanResource::collection($plans);
        } catch (\Exception $exception) {
            return Helper::exceptionJSON($exception, 422, "Plan");
        }
    }
public function index ( ) { try { $ plans = Plan :: all ( ) ; if ( $ plans -> count ( ) === 0 ) { abort ( 404 , " No plans found " ) ; } return PlanResource :: collection ( $ plans ) ; } catch ( \ Exception $ exception ) { return Helper :: exceptionJSON ( $ exception , 422 , " Plan " ) ; } }
Display a listing of the resource.
Display a listing of the resource .