Esempio n. 1
0
 /**
  * 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'));
 }
Esempio n. 2
0
 /**
  * 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'));
 }
Esempio n. 3
0
 public function fresh()
 {
     $images = Image::latest()->get();
     return view('fresh', compact('images'));
 }
Esempio n. 4
0
 public function images()
 {
     $images = Image::latest()->get();
     return view('admin.images', compact('images'));
 }
Esempio n. 5
0
|--------------------------------------------------------------------------
*/
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();
Esempio n. 6
0
 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;
 }
Esempio n. 7
0
 function imagesWidget($min)
 {
     $entry = Cache::remember('images', $min, function () {
         return \App\Image::latest('published_at')->select('images', 'img_title')->first();
     });
     return $entry;
 }
 public function getPaginateAllImages($val)
 {
     return Image::latest()->paginate($val);
 }