123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- namespace App\Http\Controllers;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Input;
- use App\Comment;
- use App\Post;
- class CommentController extends Controller
- {
-
- public function index()
- {
-
- }
-
- public function create()
- {
-
- }
-
- public function store(Request $request)
- {
- $newRecord = new Comment([ 'text' =>Input::get('text')]);
- $post = Post::find(Input::get('post_id'));
-
-
- $post->comments()->save($newRecord);
-
-
-
- return redirect(route('cntrl.show', [Input::get('post_id')]));
- }
-
- public function show($id)
- {
-
- }
-
- public function edit($id)
- {
-
- }
-
- public function update(Request $request, $id)
- {
-
- }
-
- public function destroy($id)
- {
-
- }
- }
|