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