当前位置: 首页>>代码示例>>PHP>>正文


PHP Comment::fill方法代码示例

本文整理汇总了PHP中app\Comment::fill方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::fill方法的具体用法?PHP Comment::fill怎么用?PHP Comment::fill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Comment的用法示例。


在下文中一共展示了Comment::fill方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request, RentalUnit $rentalUnit)
 {
     $newComment = new Comment();
     $newComment->fill(Input::all());
     $newComment->save();
     return Response::json($newComment);
 }
开发者ID:VJan-fin,项目名称:Roomie,代码行数:13,代码来源:CommentController.php

示例2: store

 public function store(Requests\SaveCommentRequest $request, $offer_id)
 {
     $offer = Offer::findOrFail($offer_id);
     if (Gate::denies('add-comment', $offer)) {
         abort(403);
     }
     $comment = new Comment();
     $comment->fill($request->input());
     $comment->user_id = Auth::user()->id;
     $comment->offer_id = $offer_id;
     $comment->save();
     $violation = $offer->violation;
     // Send email
     $user_type = Auth::user()->getOriginal('user_type');
     if ($user_type == 'cus') {
         $to = $offer->author->username;
         $email = $offer->author->email;
     } else {
         $to = $violation->author->username;
         $email = $violation->author->email;
     }
     $poster_name = Auth::user()->username;
     $address = $violation_name = $violation->address1 . ', ' . $violation->city . ' (' . $violation->getOriginal('state') . ') ' . $violation->zip;
     $data = compact('user_type', 'to', 'poster_name', 'address', 'offer_id');
     Mail::send('emails.newcomment', $data, function ($message) use($email) {
         $message->subject('New Comment Posted');
         $message->to($email);
     });
     // Flash message
     Session::flash('message', 'Your comment has been posted to the offer.');
     Session::flash('message-type', 'success');
     // Redirect
     return redirect(url('/offer/' . $offer_id . '#comment_' . $comment->id));
 }
开发者ID:softelos,项目名称:app.buildingviolation.com,代码行数:34,代码来源:CommentController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store($id, Request $request)
 {
     $comment = new Comment();
     $comment->news_id = $request->input('news_id');
     $comment->fill($request->all());
     $comment->save();
     return Redirect::back();
 }
开发者ID:nikajorjika,项目名称:gamoiwere.ge,代码行数:14,代码来源:CommentController.php

示例4: store

 public function store(CommentRequest $request, Comment $comment)
 {
     $comment->fill($request->all());
     $comment->user_id = Auth::user()->id;
     $comment->save();
     $activity = 'Commented on a ' . ucfirst($request->input('belongs_to'));
     Activity::log($activity);
     return redirect()->back()->withSuccess(config('constants.SAVED'));
 }
开发者ID:EneaWeb,项目名称:aliangel,代码行数:9,代码来源:CommentController.php

示例5: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateCommentRequest $request, $task_id)
 {
     $task = Task::findOrFail($task_id);
     $comment = new Comment();
     $comment->fill($request->all());
     $comment->task_id = $task->id;
     $comment->user_id = \Auth::user()->id;
     $comment->save();
     $comment->user;
     return $comment;
 }
开发者ID:BostjanOb,项目名称:ProTODO,代码行数:17,代码来源:CommentsController.php

示例6: store

 /**
  * Store a newly created resource in storage.
  *
  * @param $id
  * @param CreateCommentRequest $request
  * @return \Illuminate\Http\RedirectResponse|string
  */
 public function store($id, CreateCommentRequest $request)
 {
     $lesson = Lesson::findOrFail($id);
     $comment = new Comment();
     $comment->fill($request->all());
     $comment->user_id = Auth::user()->id;
     $comment->lesson_id = $lesson->id;
     $comment->save();
     $message = trans('messages.comment_successfully_submitted');
     if ($request->ajax()) {
         return $message;
     }
     Flash::success($message);
     return redirect()->route('lessons.show', $lesson->id);
 }
开发者ID:jrafaelca,项目名称:school_virtual,代码行数:22,代码来源:CommentsController.php

示例7: savePost

 /**
  * save.
  *
  * @param Comment $comment comment
  * @param Request $input   输入
  */
 public function savePost($comment, $input)
 {
     $comment->fill($input);
     return $comment->save();
 }
开发者ID:lanzhiwang,项目名称:laravel-blog,代码行数:11,代码来源:CommentRepository.php


注:本文中的app\Comment::fill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。