/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $frames = Frames::all(); $jsonArray = []; foreach ($frames as $fs) { $jsonArray[] = ["frameId" => $fs->id, "frameName" => $fs->name, "image" => url('/uploads/frames/' . $fs->image), "frameDescription" => $fs->description]; } return response()->json($jsonArray); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $frames = Frames::all(); $jsonArray = []; foreach ($frames as $fs) { $jsonArray[] = ["frameId" => $fs->frame_id, "frameName" => $fs->name, "imageLayout" => url('/uploads/frames/' . $fs->image_layout), "imageBackground" => url('/uploads/frames/' . $fs->image_background), "imageForeground" => url('/uploads/frames/' . $fs->image_foreground), "imagePreview" => url('/uploads/frames/' . $fs->image_preview), "frameDescription" => $fs->description]; } return response()->json($jsonArray); }
public function delete($id) { $frames = Frames::find($id); $frames->delete(); return redirect()->intended('frames'); }