resources() public static method

Register an array of resource controllers.
public static resources ( array $resources ) : void
$resources array
return void
Exemplo n.º 1
0
#Installation script Routes
Route::group(array('prefix' => 'install', 'before' => 'install'), function () {
    Route::get('/', 'InstallController@index');
    Route::get('/database', 'InstallController@getDatabase');
    Route::post('/database', 'InstallController@postDatabase');
    Route::get('/user', 'InstallController@getUser');
    Route::post('/user', 'InstallController@postUser');
});
Route::group(['middleware' => 'install'], function () {
    Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
    Route::group(['middleware' => 'auth'], function () {
        #home controller
        Route::get('/', 'HomeController@index');
        Route::get('home', 'HomeController@index');
        #Resources Routes
        Route::resources(['users' => 'UsersController', 'clients' => 'ClientsController', 'invoices' => 'InvoicesController', 'products' => 'ProductsController', 'expenses' => 'ExpensesController', 'estimates' => 'EstimatesController', 'payments' => 'PaymentsController', 'reports' => 'ReportsController']);
        #Grouped Routes
        Route::group(array('prefix' => 'settings'), function () {
            Route::resource('company', 'SettingsController', array('only' => array('index', 'store', 'update')));
            Route::resource('invoice', 'InvoiceSettingsController', array('only' => array('index', 'store', 'update')));
            Route::resource('tax', 'TaxSettingsController');
            Route::resource('templates', 'TemplatesController', array('only' => array('index', 'show', 'store', 'update')));
            Route::resource('number', 'NumberSettingsController', array('only' => array('index', 'store', 'update')));
            Route::resource('payment', 'PaymentMethodsController', array('except' => array('show', 'create')));
            Route::resource('currency', 'CurrencyController', array('except' => array('show', 'create')));
        });
        # estimates resource
        Route::group(array('prefix' => 'estimates'), function () {
            Route::post('deleteItem', 'EstimatesController@deleteItem');
            Route::get('pdf/{id}', 'EstimatesController@estimatePdf');
            Route::get('send/{id}', 'EstimatesController@send');
Exemplo n.º 2
0
|
| 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 controller to call when that URI is requested.
|
*/
Route::group(['namespace' => 'Frontend', 'domain' => env('HTTP_DOMAIN')], function () {
    Route::get('/', function () {
        return view('welcome');
    });
    Route::controller('auth', 'Auth\\AuthController');
    Route::controller('password', 'Auth\\PasswordController');
    if (file_exists(app_path('Http/Controllers/Frontend/TestController.php'))) {
        Route::controller('test', 'TestController');
    }
});
Route::group(['namespace' => 'Backend', 'domain' => env('ADMIN_DOMAIN')], function () {
    Route::controller('auth', 'Auth\\AuthController');
    Route::controller('password', 'Auth\\PasswordController');
    Route::group(['middleware' => 'admin.auth'], function () {
        Route::get('/', 'DashboardController@getIndex');
        Route::controller('dash', 'DashboardController');
        //        Route::controller('goods', 'GoodsController');
        Route::resources(['category' => 'CategoryController', 'goods' => 'GoodsController', 'brand' => 'BrandController', 'goodstype' => 'GoodstypeController']);
        //        Route::controller('brand', 'BrandController');
        //        Route::controller('goodstype', 'GoodstypeController');
    });
    if (file_exists(app_path('Http/Controllers/Backend/TestController.php'))) {
        Route::controller('test', 'TestController');
    }
});
Exemplo n.º 3
0
     $user = \App\User::find(3);
     $user->password = bcrypt('12345678');
     $user->save();
 });
 Route::group(['middleware' => 'role:administrador'], function () {
     /*
      * Delete Routes
      */
     Route::post('usuario/{id}/delete', ['as' => 'usuario.destroy', 'uses' => 'UserController@destroy']);
     Route::post('rol/{id}/delete', ['as' => 'rol.destroy', 'uses' => 'RoleController@destroy']);
     Route::post('permiso/{id}/delete', ['as' => 'permiso.destroy', 'uses' => 'PermissionController@destroy']);
     Route::post('tipo_pregunta/{id}/delete', ['as' => 'tipo_pregunta.destroy', 'uses' => 'TipoPreguntaController@destroy']);
     /*
      * Resources
      */
     Route::resources(['usuario' => 'UserController', 'rol' => 'RoleController', 'permiso' => 'PermissionController', 'cliente' => 'ClienteController', 'pregunta_secreta' => 'PreguntaSecretaController', 'tipo_pregunta' => 'TipoPreguntaController', 'asociado' => 'AsociadoController']);
     /*
      * JSON POST
      */
     Route::post('usuarios', 'UserController@postJsonList');
     Route::post('roles', 'RoleController@postJsonList');
     Route::post('permisos', 'PermissionController@postJsonList');
     Route::post('clientes', 'ClienteController@postJsonList');
     Route::post('obtener_tipo_pago/{id}', 'TipoPagoController@getJsonTipoPago');
     Route::post('preguntas', 'PreguntaSecretaController@getJsonPregunta');
     Route::post('tipos_preguntas', 'TipoPreguntaController@getJsonList');
     Route::post('asociados/{id}', 'AsociadoController@getJsonListByCliente');
     /*
      * OTHERS
      */
     Route::get('rol/{id}/attachperms', 'RoleController@getAttachPerms');
Exemplo n.º 4
0
Route::get('user/settings', ['as' => 'user.settings', 'uses' => 'UserController@getSettings']);
Route::post('user/settings', 'UserController@postSettings');
Route::get('user/favorites', ['as' => 'user.favorites', 'uses' => 'UserController@getFavorites']);
Route::post('user/avatar', ['as' => 'user.avatar', 'uses' => 'UserController@postAvatar']);
# Trick creation route
Route::get('user/tricks/new', ['as' => 'tricks.new', 'uses' => 'UserTricksController@getNew']);
Route::post('user/tricks/new', 'UserTricksController@postNew');
# Trick editing route
Route::get('user/tricks/{trick_slug}', ['as' => 'tricks.edit', 'uses' => 'UserTricksController@getEdit']);
Route::post('user/tricks/{trick_slug}', 'UserTricksController@postEdit');
# Trick delete route
Route::get('user/tricks/{trick_slug}/delete', ['as' => 'tricks.delete', 'uses' => 'UserTricksController@getDelete']);
# Feed routes
Route::get('feed', ['as' => 'feed.atom', 'uses' => 'FeedsController@getAtom']);
Route::get('feed.atom', ['uses' => 'FeedsController@getAtom']);
Route::get('feed.xml', ['as' => 'feed.rss', 'uses' => 'FeedsController@getRss']);
# This route will match the user by username to display their public profile
# (if we want people to see who favorites and who posts what)
Route::get('{user}', ['as' => 'user.profile', 'uses' => 'UserController@getPublic']);
/*
 * Admin
 */
$admin = ['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => 'admin'];
Route::group($admin, function () {
    Route::controller('auth', 'AuthController');
    Route::resources(['/' => 'HomeController', 'links' => 'LinkController']);
    Route::controller('users', 'UserController');
    Route::controller('settings', 'SettingController');
    Route::any('upload/ueditor', 'UploadController@ueditor');
    Route::post('upload/image', 'UploadController@postImage');
});
Exemplo n.º 5
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| 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 controller to call when that URI is requested.
|
*/
Route::get('/', 'DashboardController@home');
Route::post('upload/respondents', 'RespondentController@upload');
Route::controller('toot/smsquery', '\\smsquery\\RouteController');
//Route::controller('/ti/{ti_id?}/', function($ti_id)
//{
//	dd('\\' . $ti->toot->namespace . '\RouteController');
//	$ti = \nable\TootInstance::find($ti_id);
//
//	return '\\' . $ti->toot->namespace . '\RouteController';
//});
Route::resources(['organization' => 'OrganizationController', 'project' => 'ProjectController', 'topic' => 'TopicController', 'question' => 'QuestionController', 'response' => 'ResponseController', 'respondent' => 'RespondentController']);
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
Exemplo n.º 6
0
<?php

Route::group(['middleware' => ['web']], function () {
    Route::get('/', ['as' => 'home', 'uses' => 'HomeController@index']);
    Route::resources(['/group' => 'Group\\GroupController', '/group.program' => 'Group\\ProgramController']);
    Route::auth();
});
Exemplo n.º 7
0
    Route::group(['prefix' => 'data', 'namespace' => 'Data'], function () {
        Route::group(['prefix' => 'tambahan', 'namespace' => 'Tambahan'], function () {
            Route::resources(['agama' => 'AgamaController', 'akses_inet' => 'AksesInternetController', 'jenis_kelamin' => 'JenisKelaminController', 'suplai_air' => 'SuplaiAirController', 'sumber_listrik' => 'SumberListrikController']);
        });
        Route::group(['prefix' => 'program', 'namespace' => 'Program'], function () {
            Route::resources(['data_kebutuhan_khusus' => 'DataKebutuhanKhususController', 'data_layanan_khusus' => 'DataLayananKhususController']);
        });
        Route::group(['prefix' => 'administrasi/sekolah', 'namespace' => 'Administrasi\\Sekolah'], function () {
            Route::resources(['status_sekolah' => 'StatusSekolahController', 'sertifikat_iso' => 'SertifikatIsoController', 'bentuk_pendidikan' => 'BentukPendidikanController', 'status_kepemilikan' => 'StatusKepemilikanController']);
        });
        Route::group(['prefix' => 'akreditasi', 'namespace' => 'Akreditasi'], function () {
            Route::resources(['lembaga_akreditasi' => 'LembagaController', 'nilai_akreditasi' => 'NilaiController']);
        });
        Route::group(['prefix' => 'region', 'namespace' => 'Region'], function () {
            Route::resources(['provinsi' => 'ProvinsiController', 'kabupaten' => 'KabupatenController', 'kecamatan' => 'KecamatanController', 'kelurahan' => 'KelurahanController', 'kategori_wilayah' => 'KategoriWilayahController']);
        });
        Route::group(['prefix' => 'penyelenggaraan', 'namespace' => 'Penyelenggaraan'], function () {
            Route::resources(['semester' => 'SemesterController', 'tahun_ajaran' => 'TahunAjaranController', 'waktu_penyelenggaraan' => 'WaktuPenyelenggaraanController']);
        });
    });
    Route::resource('yayasan', 'YayasanController');
    Route::group(['prefix' => 'sekolah', 'namespace' => 'Sekolah'], function () {
        Route::group(['prefix' => 'program', 'namespace' => 'Program'], function () {
            Route::resources(['inkuisi' => 'InkuisiController', 'layanan_khusus' => 'LayananKhususController']);
        });
        Route::get('massasigment', ['as' => 'massasigment', 'uses' => function () {
            return "you found me :V";
        }]);
        Route::resources(['sekolah' => 'SekolahController', 'akreditasi' => 'AkreditasiController', 'rekening' => 'RekeningController', 'perizinan' => 'PerizinanController', 'lokasi_sekolah' => 'LokasiSekolahController', 'periodik' => 'PeriodikController', 'rekening' => 'RekeningController', 'sertifikat_iso' => 'SertifikasiIsoController', 'sanitasi' => 'SanitasiController', 'sertifikasi' => 'SertifikasiIsoController', 'siswa' => 'SiswaController', 'tambahan' => 'TambahanController']);
    });
});
Exemplo n.º 8
0
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
|	$route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples:	my-controller/index	-> my_controller/index
|		my-controller/my-method	-> my_controller/my_method
*/
require_once 'api_route.php';
/**
 *   get : usercontroller -> index
 *   get : usercontroller/1 -> show
 *   get : usercontroller/1/edit -> edit
 *   post: usercontroller -> store
 *   put/patch : usercontroller  -> update
 *   delete: usercontroller/1 -> delete
 */
Route::resources('UserController');
// open source route
$route = Route::map();
eval(decode_api($wap_api));
// Format API Routes
$route['default_controller'] = 'welcome';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
Exemplo n.º 9
0
<?php

Route::model('user', 'App\\User');
Route::model('post', 'App\\Post');
Route::controllers(['auth' => 'AuthController', 'checkout' => 'CheckoutController', 'schedule' => 'ScheduleController', 'shorten' => 'ShortenController']);
Route::get('me', 'UserController@edit');
Route::post('me', 'UserController@store');
Route::patch('me', 'UserController@update');
Route::get('user/{user}', 'UserController@show');
Route::group(['prefix' => 'api/v1', 'namespace' => 'API'], function () {
    Route::controllers(['trade' => 'TradeController']);
    Route::resources(['post' => 'PostController']);
    Route::post('post/{post}/reschedule', 'PostController@reschedule');
});
Route::get('/{hash}', 'ShortenController@handleShortcode');
Route::get('/', ['as' => 'home', 'uses' => 'SiteController@getIndex']);
Route::controller('/', 'SiteController');
Exemplo n.º 10
0
        });
        Route::resources(['provinsi' => 'ProvinsiController', 'kabupaten' => 'KabupatenController', 'kecamatan' => 'KecamatanController', 'desa' => 'DesaController']);
        Route::get('get/{region}/{id}', ['as' => 'getRegion', 'uses' => function ($r, $id) {
            $data = [];
            if ($r == 'kabupaten') {
                foreach (\App\Kabupaten::where('provinsi_id', $id)->get() as $list) {
                    $data = array_merge_recursive($data, [['id' => $list->id, 'text' => $list->label]]);
                }
            }
            if ($r == 'kecamatan') {
                foreach (\App\Kecamatan::where('kabupaten_id', $id)->get() as $list) {
                    $data = array_merge_recursive($data, [['id' => $list->id, 'text' => $list->label]]);
                }
            }
            if ($r == 'desa') {
                foreach (\App\Desa::where('kecamatan_id', $id)->get() as $list) {
                    $data = array_merge_recursive($data, [['id' => $list->id, 'text' => $list->label]]);
                }
            }
            return $data;
        }]);
    });
});
Route::group(['prefix' => 'admin/kecamatan', 'middleware' => 'UAC:kecamatan', 'namespace' => 'Admin\\Kecamatan'], function () {
    Route::get('/', ['as' => 'admin.kecamatan.landing', 'uses' => function () {
        return view('admin_template');
    }]);
    Route::get('get_bantuan', ['as' => 'getBantuan', 'uses' => 'PenerimaBantuanController@getBantuan']);
    Route::get('get_kriteria', ['as' => 'getKI', 'uses' => 'PenerimaBantuanController@getKI']);
    Route::resources(['penduduk' => 'PendudukController', 'penerima' => 'PenerimaBantuanController', 'generate' => 'GeneratorController']);
});
Exemplo n.º 11
0
Route::get('admin/logout', 'Auth\\AuthController@getLogout');
//Public authentication routes
Route::get('/login', 'PublicAuthController@getLogin');
Route::post('/login', 'PublicAuthController@postLogin');
Route::get('/logout', 'PublicAuthController@getLogout');
Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'backend_access']], function () {
    Route::get('/', 'AdminPagesController@home');
    Route::get('/mail', 'AdminPagesController@sendMail');
    /* Edit password */
    Route::get('/director/{id}/edit/password', 'DirectorController@getEditPassword');
    Route::post('/director/{id}/edit/password', 'DirectorController@postEditPassword');
    Route::get('/administrador/{id}/edit/password', 'AdministradorController@getEditPassword');
    Route::post('/administrador/{id}/edit/password', 'AdministradorController@postEditPassword');
    Route::get('/alumno/{id}/edit/password', 'AlumnoController@getEditPassword');
    Route::post('/alumno/{id}/edit/password', 'AlumnoController@postEditPassword');
    /* RESTful */
    Route::resources(['administrador' => 'AdministradorController', 'director' => 'DirectorController', 'maestro' => 'MaestroController', 'escuela' => 'EscuelaController', 'estado' => 'EstadoController', 'tabla' => 'TablaController', 'estatus' => 'EstatusController', 'alumno' => 'AlumnoController']);
});
Route::group(['prefix' => '/', 'middleware' => 'public_auth'], function () {
    Route::get('/', 'PublicPagesController@home');
    Route::get('grupos', 'PublicPagesController@gruposJson');
    Route::get('grupo/{grupo_id}/alumnos', 'AlumnoController@alumnoByGrupo');
    Route::get('/escuelas', 'PublicPagesController@escuelasJson');
    Route::get('/alumno/{alumno_id}/tareas', 'AlumnoController@getTareasAlumno');
    Route::get('alumno/{alumno_id}/tarea/{tarea_id}/calificar', 'TareaController@getCalificarTarea');
    Route::post('/periodos', 'PeriodoController@periodosJson');
    Route::post('grupo/alumnos', 'AlumnoController@postAlumnoByGrupo');
    Route::post('alumno/tareas', 'AlumnoController@postTareasAlumno');
    Route::post('tarea/calificar', 'TareaController@postCalificarTarea');
    Route::resources(['periodo' => 'PeriodoController']);
});
Exemplo n.º 12
0
<?php

Route::get('/', function () {
    return view('welcome');
});
// public
Route::group(['middleware' => 'web'], function () {
    Route::auth();
    Route::get('/home', 'HomeController@index');
});
// admin
Route::group(['middleware' => ['web', 'auth', 'admin'], 'namespace' => 'Admin', 'prefix' => 'admin'], function () {
    // base view
    Route::get('/', 'AdminController@index');
    // actions
    Route::resources(['users' => 'UsersController']);
    Route::resources(['roles' => 'RolesController']);
    Route::resources(['documents' => 'DocumentsController']);
    Route::get('permissions', 'PermissionsController@index');
});
Exemplo n.º 13
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| 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 controller to call when that URI is requested.
|
*/
Route::resources('customer', 'CustomerController');
Exemplo n.º 14
0
<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => 'web'], function () {
    Route::auth();
    Route::get('/', 'HomeController@index');
    Route::resources(['/course' => 'CourseController']);
});
Exemplo n.º 15
0
Route::controllers(['/vk-friend' => 'Pages\\FriendsController', '/wallpaper' => 'Wallpaper\\WallpaperController', '/bot_telegram' => 'CrossFit\\MainController']);
// ТЕСТ создание страницы слайдоов
Route::get('/slide', function () {
    return view('pages.slides.content');
})->name('slide');
/*  *  *  *  *  *  *  *  *  *  *  *  *
| Выдача шаблонов для View Angular.JS
*/
Route::get('/template/{name}', function ($name) {
    return View::make('angular-pages.' . $name);
});
Route::get('/auth', function () {
    return view('auth.index');
})->name('auth');
// Authentication routes...
Route::get('/auth/login', 'Auth\\AuthController@getLogin')->name('login');
Route::post('/auth/login', 'Auth\\AuthController@postLogin');
Route::get('/auth/logout', 'Auth\\AuthController@getLogout')->name('logout');
//* Registration routes...
Route::get('/auth/register', 'Auth\\AuthController@getRegister')->name('register');
Route::post('/auth/register', 'Auth\\AuthController@postRegister');
// */
Route::get('/social_login/{provider}', 'Auth\\SocialController@login')->name('social_login');
Route::get('/social_login/callback/{provider}', 'Auth\\SocialController@callback');
// Social login
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => 'admin', 'as' => 'admin_page'], function () {
    // admin route
    Route::resources(['/glossary_req' => 'GlossaryReqController', '/glossary' => 'GlossaryController']);
    Route::controller('/', 'DashbordController');
});
//
Exemplo n.º 16
0
<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', 'HomeController@index');
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
    Route::auth();
    Route::get('tasks', 'TaskController@index');
});
Route::group(['middleware' => ['web', 'auth'], 'namespace' => 'Api', 'prefix' => 'api'], function () {
    Route::resources(['task_list' => 'TaskListController', 'task_list.task' => 'TaskController']);
});
Exemplo n.º 17
0
 public function testResources()
 {
     Route::resources('Form');
     $this->assertEquals(count($this->Nimble->routes), 7);
 }
Exemplo n.º 18
0
                    echo e($link . '00' . $i . '.png">');
                } else {
                    if ($i < 100) {
                        echo e($link . '0' . $i . '.png">');
                    } else {
                        echo e($link . $i . '.jpg">');
                    }
                }
            }
        })->where(['f' => '[0-9]+', 'n' => '[0-9]+']);
        Route::get('story/status', 'StoryController@status');
        Route::get('/', function () {
            return redirect('admin/dashboard');
        });
        Route::group(['prefix' => 'manager'], function () {
            Route::resource('user', 'UserController');
            Route::resource('role', 'RoleController');
            Route::resource('permission', 'PermissionsController');
        });
        Route::get('logout', function () {
            Auth::logout();
            return redirect('home');
        });
        Route::match(['get', 'post'], 'chapter/ads', 'ChapterController@ads');
        Route::get('chapter/add', 'ChapterController@add');
        Route::get('chapter/load', 'ChapterController@loadData');
        Route::resource('media', 'MediaController', ['only' => ['index']]);
        Route::resources(['author' => 'AuthorController', 'category' => 'CategoryController', 'chapter' => 'ChapterController', 'cloud' => 'CloudController', 'country' => 'CountryController', 'dashboard' => 'DashboardController', 'language' => 'LanguageController', 'tag' => 'TagController', 'story' => 'StoryController', 'question' => 'QuestionController']);
    });
    //});
});
Exemplo n.º 19
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| 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 controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('welcome');
});
Route::get('/user/{name?}', function ($name = "longlong") {
    return "Hello, " . $name;
});
//文章详情
// Route::get('/article/create','ArticleController@create');
// Route::post('/article','ArticleController@store');
// Route::get('/article','ArticleController@index');
// Route::get('/article/{id}','ArticleController@show');
Route::resources(['article' => 'ArticleController']);
//用户登录注册
Route::get('/auth/login', 'Auth\\AuthController@getLogin');
Route::post('/auth/login', 'Auth\\AuthController@postLogin');
Route::get('/auth/register', 'Auth\\AuthController@getRegister');
Route::post('/auth/register', 'Auth\\AuthController@postRegister');
Route::get('/auth/logout', 'Auth\\AuthController@getLogout');