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


PHP Post::CreatePost方法代码示例

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


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

示例1: uploadpost

 public function uploadpost(Request $request)
 {
     $board_id = $request->input("board_id");
     $description = $request->input("description");
     $photo_link = '';
     $user_id = '';
     $place_id = $request->input("place_id");
     $hashtag = $request->input("hashtag");
     Post::CreatePost($board_id, $description, $photo_link, $user_id, $place_id, $hashtag);
 }
开发者ID:NhuanTDBK,项目名称:Bluemix-Laravel-Demo,代码行数:10,代码来源:FrontEndController.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //
     if (!Auth::check()) {
         return response()->json("Please login");
     }
     $description = $request->input('description');
     $board_id = $request->input('board_id');
     $user_id = Auth::user()->user_id;
     $photo_link = $request->input('photo_link');
     $post = Post::CreatePost($board_id, $description, $photo_link, $user_id, null, null);
     return response()->json($post);
 }
开发者ID:NhuanTDBK,项目名称:FoodieWebOpenshift,代码行数:19,代码来源:PostController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //
     if (!Auth::check()) {
         return response()->json("Please login");
     }
     $description = $request->input('description');
     $board_id = $request->input('board_id');
     $user_id = Auth::user()->user_id;
     $photo_link = $request->input('photo_link');
     if ($request->input('name_address') != null) {
         $place_lat = $request->input('latitude');
         $place_lng = $request->input('longitude');
         $place_name = $request->input('name_address');
         $place_address = $request->input('address');
         $hash_tag = $request->input('hashtag');
         $place = Place::createPlace($place_name, $place_address, $place_lat, $place_lng);
         $post = Post::CreatePost($board_id, $description, $photo_link, $user_id, $place, $hash_tag);
     } else {
         $post = Post::CreatePost($board_id, $description, $photo_link, $user_id, null, $hash_tag);
     }
     return response()->json(true);
 }
开发者ID:NhuanTDBK,项目名称:Bluemix-Laravel-Demo,代码行数:29,代码来源:PostController.php


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