2016-09-01 16:23:39 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Gallery;
|
|
|
|
|
2016-09-03 22:13:05 +01:00
|
|
|
use App\Album;
|
2016-09-02 10:42:05 +01:00
|
|
|
use App\Facade\Theme;
|
2016-09-01 16:23:39 +01:00
|
|
|
use App\Http\Controllers\Controller;
|
2016-09-06 14:45:51 +01:00
|
|
|
use Illuminate\Http\Request;
|
2016-09-01 16:23:39 +01:00
|
|
|
|
|
|
|
class DefaultController extends Controller
|
|
|
|
{
|
2016-09-06 14:45:51 +01:00
|
|
|
public function index(Request $request)
|
2016-09-01 16:23:39 +01:00
|
|
|
{
|
2016-09-05 14:06:41 +01:00
|
|
|
$albums = Album::withCount('photos')->get()->sortBy('name');
|
2016-09-03 22:13:05 +01:00
|
|
|
|
|
|
|
return Theme::render('gallery.index', [
|
2016-09-06 14:45:51 +01:00
|
|
|
'albums' => $albums,
|
|
|
|
'info' => $request->session()->get('info')
|
2016-09-03 22:13:05 +01:00
|
|
|
]);
|
2016-09-01 16:23:39 +01:00
|
|
|
}
|
|
|
|
}
|