public function run() { $exp = ['name' => 'Become an expeditionist', 'description' => 'Detailed info on how one can become an expeditionist and what it involves. Only PDFs are valid.']; $volunteer = ['name' => 'Become a volunteer', 'description' => 'Detailed info on how one can become a volunteer and what it involves. Only PDFs are valid.']; FileResource::create($exp); FileResource::create($volunteer); }
public function getInvolved() { $page = $this->contentRepository->getPageByName('get involved'); $sponsors = Sponsor::ordered()->get(); $charities = Charity::ordered()->get(); $expeditionistPdf = FileResource::where('name', 'Become an expeditionist')->first(); $volunteerPdf = FileResource::where('name', 'Become a volunteer')->first(); return view('front.pages.getinvolved')->with(compact('page', 'sponsors', 'charities', 'expeditionistPdf', 'volunteerPdf')); }
public function storeFile(Request $request, $resourceId) { $this->validate($request, ['file' => 'required|mimes:pdf']); FileResource::findOrFail($resourceId)->setFile($request->file('file')); return response()->json('ok'); }