當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。