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


PHP Image::latest方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $sliders = Slider::latest()->get();
     $images = Image::latest()->take(4)->get();
     $news = News::latest('published_at')->published()->take(3)->get();
     $articles = Article::latest('published_at')->published()->take(3)->get();
     return view('pages.index', compact('articles', 'news', 'images', 'sliders'));
 }
开发者ID:kobeuu,项目名称:bpb-sf,代码行数:13,代码来源:PagesController.php

示例2: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show(Family $family)
 {
     $id = $family->id;
     $mother = Person::latest('created_at')->where('id', '=', $family->mother_id)->first();
     $father = Person::latest('created_at')->where('id', '=', $family->father_id)->first();
     $kids = FamilyController::get_kids_of_family($family);
     $images = Image::where('family', $id)->orderBy('year', 'asc')->get();
     $featured_image = Image::latest('created_at')->orderBy('year', 'asc')->Where('family', $id)->Where('featured', 1)->get();
     return view('family.show', compact('family', 'kids', 'images', 'mother', 'father', 'featured_image'));
 }
开发者ID:abada,项目名称:Family-laravel,代码行数:16,代码来源:FamilyController.php

示例3: fresh

 public function fresh()
 {
     $images = Image::latest()->get();
     return view('fresh', compact('images'));
 }
开发者ID:prisacaruadela,项目名称:theWall,代码行数:5,代码来源:ImageController.php

示例4: images

 public function images()
 {
     $images = Image::latest()->get();
     return view('admin.images', compact('images'));
 }
开发者ID:kobeuu,项目名称:bpb-sf,代码行数:5,代码来源:AdminController.php

示例5: function

|--------------------------------------------------------------------------
*/
Route::get('track', 'WebTrackController@index');
// Sitemap
Route::get('/sitemap', function () {
    return Response::view('sitemap')->header('Content-Type', 'application/xml');
});
Route::get('contact', ['as' => 'contact', 'uses' => 'AboutController@create']);
// Email Contact Route
Route::post('contact', ['as' => 'contact_store', 'uses' => 'AboutController@store']);
// Main index route
Route::get("/", function () {
    return view('pages.index');
});
Route::get("theatre", function () {
    $photo = \App\Image::latest()->take(1)->lists('url');
    return view('images.theatre')->with('photo', $photo);
});
/*
|-------------------------------------------------------------------------
| App Routes
|--------------------------------------------------------------------------
*/
//  Blog Routes
Route::get('post', 'PostController@index');
Route::get('admin/post', 'PostController@index');
Route::get('Cat-Gifs', 'ImageController@index');
Route::get('Cat-Gifs/{id}', 'ImageController@show');
Route::get('Cat-Gifs/{id}/embed', 'ImageController@embed');
Route::get('api/posts', function () {
    $posts = \App\Post::latest()->get();
开发者ID:Gadurp1,项目名称:KD-2,代码行数:31,代码来源:routes.php

示例6: get_recently_added_pictures

 public function get_recently_added_pictures()
 {
     $new_pictures = Image::latest('created_at')->Where('created_at', '>', Carbon::now()->subDays(30))->take(11)->get();
     return $new_pictures;
 }
开发者ID:abada,项目名称:Family-laravel,代码行数:5,代码来源:HomeController.php

示例7: imagesWidget

 function imagesWidget($min)
 {
     $entry = Cache::remember('images', $min, function () {
         return \App\Image::latest('published_at')->select('images', 'img_title')->first();
     });
     return $entry;
 }
开发者ID:Vatia13,项目名称:megaportal,代码行数:7,代码来源:widgets.php

示例8: getPaginateAllImages

 public function getPaginateAllImages($val)
 {
     return Image::latest()->paginate($val);
 }
开发者ID:jeroenhekihenk,项目名称:video-platform,代码行数:4,代码来源:ImagesRepository.php


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