api.php 2.22 KB
Newer Older
Vipul Basapati's avatar
Vipul Basapati committed
1
<?php
2 3 4 5 6 7 8 9 10 11 12 13 14 15


/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], function () {
16
    Route::group(['prefix' => 'auth', 'middleware' => ['guest']], function () {
Viral Solani's avatar
Viral Solani committed
17 18
        Route::post('register', 'RegisterController@register');
        Route::post('login', 'AuthController@login');
19 20
        // Password Reset
        Route::post('password/email', 'ForgotPasswordController@sendResetLinkEmail');
Viral Solani's avatar
Viral Solani committed
21 22
    });

Vidhyut Pandya's avatar
Vidhyut Pandya committed
23
    Route::group(['middleware' => ['auth:api']], function () {
Viral Solani's avatar
Viral Solani committed
24 25
        Route::group(['prefix' => 'auth'], function () {
            Route::post('logout', 'AuthController@logout');
26
            // Route::post('password/reset', 'ResetPasswordController@reset')->name('password.reset');
Viral Solani's avatar
Viral Solani committed
27 28
        });
        // Users
29
        Route::resource('users', 'UsersController', ['except' => ['create', 'edit']]);
Viral Solani's avatar
Viral Solani committed
30
        Route::post('users/delete-all', 'UsersController@deleteAll');
Viral Solani's avatar
Viral Solani committed
31
        //@todo need to change the route name and related changes
Viral Solani's avatar
Viral Solani committed
32 33
        Route::get('deactivated-users', 'DeactivatedUsersController@index');
        Route::get('deleted-users', 'DeletedUsersController@index');
34

35
        // Roles
36
        Route::resource('roles', 'RolesController', ['except' => ['create', 'edit']]);
Viral Solani's avatar
Viral Solani committed
37

38
        // Permission
39
        Route::resource('permissions', 'PermissionController', ['except' => ['create', 'edit']]);
cygnet's avatar
cygnet committed
40 41

        // Page
cygnet's avatar
cygnet committed
42
        Route::resource('pages', 'PagesController', ['except' => ['create', 'edit']]);
43

cygnet's avatar
cygnet committed
44
        // Faqs
cygnet's avatar
cygnet committed
45
        Route::resource('faqs', 'FaqsController', ['except' => ['create', 'edit']]);
46 47

        // Blog Categories
48
        Route::resource('blog_categories', 'BlogCategoriesController', ['except' => ['create', 'edit']]);
49 50

        // Blog Tags
cygnet's avatar
cygnet committed
51
        Route::resource('blog_tags', 'BlogTagsController', ['except' => ['create', 'edit']]);
52 53

        // Blogs
cygnet's avatar
cygnet committed
54
        Route::resource('blogs', 'BlogsController', ['except' => ['create', 'edit']]);
55 56
    });
});