本文整理汇总了PHP中App\Http\Requests\PostRequest::user方法的典型用法代码示例。如果您正苦于以下问题:PHP PostRequest::user方法的具体用法?PHP PostRequest::user怎么用?PHP PostRequest::user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Http\Requests\PostRequest
的用法示例。
在下文中一共展示了PostRequest::user方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
public function store(PostRequest $request, TagRepository $tagRepository)
{
$inputs = array_merge($request->all(), ['user_id' => $request->user()->id]);
$post = $this->postRepository->store($inputs);
if (isset($inputs['tags'])) {
$tagRepository->store($post, $inputs['tags']);
}
return redirect(route('post.index'));
}
示例2: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(PostRequest $request)
{
$post = new Post();
$topic_id = $request->input('topic_id');
$post->content = $request->input('content');
$post->user_id = $request->user()->id;
$post->topic_id = $topic_id;
$post->save();
return Redirect::action('TopicController@show', array('id' => $topic_id));
}
示例3: store
public function store(PostRequest $request, PhotoGestion $photoGestion)
{
if ($photoGestion->save($request->file('photo'))) {
$input = $request->all();
$input['photo'] = $photoGestion->getPictureLink();
$inputs = array_merge($input, ['user_id' => $request->user()->id]);
/*return 'Le formulaire est bien rempli avec :
nom = '.$inputs['user_id'].'
type = '.$inputs['type'].'
postPicture = '.$inputs['photo'].'
photo = '.$photoGestion->getPictureLink().'
etat = '.$inputs['etat']; */
$posts = $this->postRepository->store($inputs);
//$posts['photo'] = $photoGestion->getPictureLink();
return redirect(route('post.index'));
}
//$inputs = array_merge($request->all(), ['user_id' => $request->user()->id]);
//$this->postRepository->store($inputs);
//return redirect(route('post.index'));
}
示例4: store
public function store(PostRequest $request)
{
$inputs = array_merge($request->all(), ['user_id' => $request->user()->id]);
$this->postRepository->store($inputs);
return redirect(route('post.index'));
}
示例5: store
/**
* Store a newly created resource in storage.
*
* @param App\Http\Requests\PostRequest $request
* @return Response
*/
public function store(PostRequest $request)
{
$this->blog_gestion->store($request->all(), $request->user()->id);
return redirect('blog')->with('ok', trans('back/blog.stored'));
}
示例6: store
/**
* Store a newly created resource in storage.
*
* @param App\Http\Requests\PostRequest $request
* @return Response
*/
public function store(PostRequest $request)
{
$this->blog_gestion->store($request->all(), $request->user()->id);
return redirect('blog')->with('ok', '≈да добавлена');
}
示例7: store
/**
* Store a newly created resource in storage.
*
* @param App\Http\Requests\PostRequest $request
* @return Response
*/
public function store(PostRequest $request)
{
$this->blog_control->store($request->all(), $request->user()->id);
return redirect('kadmin/articles')->with('ok', trans('kadmin.articles.stored'));
}