/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $providers = Cache::remember('providers', 15, function () { return Provider::orderBy('name')->get(); }); return response()->json(['data' => $providers], 200); }
/** * Display a form for saving a resource. * * @param string $subtitle Page subtitle. * @param string $action Form route sufix. * @param string $method Form method. * @return Response */ protected function showForm($subtitle, $action, $method = 'POST') { view()->share(['languages' => \App\Language::orderBy('name')->withTrashed()->lists('name', 'id'), 'providers' => \App\Provider::orderBy('name')->withTrashed()->lists('name', 'id'), 'role' => \App\Role::orderBy('name')->lists('name', 'id')]); return parent::showForm($subtitle, $action, $method); }