|-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the Closure to execute when that URI is requested. | */ // Route::get('/', array('uses' => 'HomeController@hello', 'as' => 'home')); Route::get('/', array('uses' => 'LoginController@index', 'as' => 'login')); Route::get('/login', array('uses' => 'LoginController@index', 'as' => 'login')); Route::group(array('before' => 'admin'), function () { Route::get('/edit-albums', array('uses' => 'AlbumsController@editAlbums', 'as' => 'edit-albums')); }); Route::group(array('before' => 'auth'), function () { Route::get('get_albums', function () { return Album::with('songs.lyric', 'artworks', 'series')->get(); }); Route::get('get_profile', function () { return User::with('actions')->with('user_details')->where('id', '=', 1)->get(); }); Route::get('/profile/{id}', array('uses' => 'ProfileController@getProfile', 'as' => 'user-profile')); Route::group(array('prefix' => 'albums'), function () { Route::get('/', array('uses' => 'AlbumsController@index', 'as' => 'albums-home')); Route::get('/{slug}', array('uses' => 'AlbumsController@index', 'as' => 'albums-details')); Route::post('/add-lyrics/{id}/save', array('uses' => 'AlbumsController@addLyrics', 'as' => 'add-lyrics')); Route::post('/add-sample/{id}/save', array('uses' => 'AlbumsController@addSample', 'as' => 'add-sample')); Route::group(array('before' => 'admin'), function () { Route::get('/album/{id}/delete', array('uses' => 'AlbumsController@deleteAlbum', 'as' => 'delete-album')); Route::get('/song/{id}/delete', array('uses' => 'AlbumsController@deleteSong', 'as' => 'delete-song')); Route::group(array('before' => 'csrf'), function () { Route::post('/newalbum', array('uses' => 'AlbumsController@saveAlbum', 'as' => 'save-album'));
public function showAllImages() { $albums = Album::with('images')->get(); return View::make('all', compact('albums')); }
public function viewAllAlbums() { $allAlbums = Album::with('owner')->get(); return View::make('albums.allAlbums', array('albums' => $allAlbums)); }