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


PHP Image::orderBy方法代码示例

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


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

示例1: compose

 public function compose(View $view)
 {
     $tags = Tag::orderBy('id', 'DESC')->get();
     $categories = Category::orderBy('id', 'DESC')->simplepaginate(7);
     $images = Image::orderBy('id', 'DESC')->paginate(4);
     $view->with('tags', $tags)->with('categories', $categories)->with('images', $images);
 }
开发者ID:EstevenJaviier,项目名称:Semillero-IN,代码行数:7,代码来源:AsideComposer.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $articles = Article::OrderBy('id', 'DESC')->paginate(7);
     $categories = Category::orderBy('name', 'ASC')->get();
     $tags = Tag::orderBy('name', 'ASC')->get();
     $images = Image::orderBy('article_id', 'DESC')->get();
     return view('admin.index')->with('articles', $articles)->with('tags', $tags)->with('images', $images)->with('categories', $categories);
 }
开发者ID:sebasPintoO,项目名称:bloglaravel,代码行数:13,代码来源:IndexController.php

示例3: index

 public function index()
 {
     $results = ['columns' => [['Id', 'id'], ['Create time', 'created_at'], ['Update time', 'updated_at'], ['Operation', 'buttons', function ($data) {
         $buttons = [['Detail'], ['Delete']];
         return $buttons;
     }]]];
     $paginate = Image::orderBy('id')->paginate();
     $results['items'] = $paginate;
     return $this->view('forone::' . $this->uri . '.index', compact('results'));
 }
开发者ID:YogiAi,项目名称:ColorTalk_PHP,代码行数:10,代码来源:ImagesController.php

示例4: searchTag

 public function searchTag($name)
 {
     $tag = Tag::SearchTag($name)->first();
     $articles = $tag->articles()->paginate(14);
     $images = Image::orderBy('id', 'ASC')->paginate(4);
     $articles->each(function ($articles) {
         $articles->category;
         $articles->images;
     });
     return view('vistas.index')->with('articles', $articles)->with('images', $images);
 }
开发者ID:EstevenJaviier,项目名称:Semillero-IN,代码行数:11,代码来源:HomeController.php

示例5: upload

 public function upload($id = null)
 {
     if (!empty($id)) {
         $images = Image::where('id_product', '=', $id)->orderBy('id', 'DESC')->get();
         $id_product = $id;
         return view('image.upload', compact('images', 'id_product'));
     } else {
         $images = Image::orderBy('id', 'DESC')->get();
         return view('image.upload', compact('images'));
     }
 }
开发者ID:rereyossi,项目名称:hairstuation,代码行数:11,代码来源:ImageController.php

示例6: feed

 public function feed()
 {
     $tags = Tag::where('id', '>', 0)->get();
     $phototags = PhotoTag::where('image_id', '>', 0)->get();
     $images = Image::orderBy('updated_at', 'desc')->paginate(10);
     if (Auth::check()) {
         $votes = Auth::user()->votes()->get();
         return view('feed')->with(['images' => $images, 'tags' => $tags, 'votes' => $votes, 'phototags' => $phototags]);
     }
     return view('feed')->with(['images' => $images, 'tags' => $tags, 'phototags' => $phototags]);
 }
开发者ID:Night0nly,项目名称:ImageSharingWeb,代码行数:11,代码来源:MainController.php

示例7: all

 public function all()
 {
     return Image::orderBy('created_at', 'desc')->simplePaginate(24);
 }
开发者ID:amirmasoud,项目名称:chakoshLaravelBlog,代码行数:4,代码来源:ImageHelper.php

示例8: test

 public function test()
 {
     $images = Image::orderBy('year', 'asc')->get();
     return view('pages/test', compact('images'));
 }
开发者ID:abada,项目名称:Family-laravel,代码行数:5,代码来源:ImageController.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @param Request $request
  *
  * @return Response
  */
 public function store(Request $request)
 {
     try {
         if (!$request->hasFile('photo')) {
             return $this->respondWithError('No photo is selected');
         }
         $file = $request->file('photo');
         // Create Eloquent object
         $image = new Image();
         $image->point_id = $request->id;
         $image->filename = $this->generate_random_string();
         $image->mime_type = $file->getClientMimeType();
         $image->base_64 = $this->convert_to_base_64($file);
         $image->created_by = Auth::user()->id;
         $image->updated_by = Auth::user()->id;
         if (!$image->save()) {
             // If creation fails
             // Return error response
             return $this->respondInternalError();
         }
         // Select latest row from DB
         $resp = $image->orderBy('id', 'DESC')->first();
         // return with Fractal
         return Fractal::item($resp, new \App\Transformers\ImageTransformer())->responseJson(200);
     } catch (Exception $e) {
         return $this->respondInternalError();
     }
 }
开发者ID:arelstone,项目名称:Gps-RESTfull,代码行数:35,代码来源:ImageController.php

示例10: getImagesWithPaginate

 public function getImagesWithPaginate(Request $request)
 {
     $perPage = $request->get('num');
     if (!is_numeric($perPage) || $perPage < 1 || $perPage > 30) {
         $perPage = 15;
     }
     $images = ImageModel::orderBy('id', 'desc')->paginate($perPage);
     return $this->buildResponse(trans('api.image.paginate.success'), Tools::toArray($images));
 }
开发者ID:lialosiu,项目名称:amaoto-core,代码行数:9,代码来源:ImageController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($type)
 {
     $events = Event::where('status', '1')->where('type', $type)->orderBy('updated_at', 'desc')->get();
     $images = Image::orderBy(\DB::raw('RAND()'))->take(4)->get();
     return view($type . '.index', compact('events', 'images', 'now'));
 }
开发者ID:heckyeah,项目名称:ngaitauira,代码行数:11,代码来源:EventController.php

示例12: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function edit($id)
 {
     $configuracion = Configuracion::findOrFail($id);
     $image = Image::orderBy('filename', 'asc')->lists('filename', 'filename');
     return view('admin.configuracion.edit', compact('configuracion', 'image'));
 }
开发者ID:wilderguzman,项目名称:lugrawibe,代码行数:13,代码来源:ConfiguracionController.php


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