コード例 #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $problems = DB::table('problemhastags')->join('tags', 'tags.id', '=', 'problemhastags.tag_id')->join('problems', 'problems.id', '=', 'problemhastags.problem_id')->where('tags.name', '=', $id)->select('problems.name as name', 'problems.id as id', 'tags.name as tag')->paginate(3);
     $hastags = problemhastag::all();
     $tag = tag::all();
     //return view('tags.show')->withProblems($problems)->withTag($id);
     return view('problems.index')->withProblems($problems)->withtaganame($id)->withhastags($hastags)->withtag($tag);
 }
コード例 #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $tags = tag::all();
     $hasTags = problemhastag::all();
     return view('problems.edit')->withProblem(Problem::findOrFail($id))->withtags($tags)->withhastags($hasTags);
 }