We’re currently experiencing a high volume of inquiries and our response time could be up to 2 days. We apologize for the delay, and thank you for your patience. Our available time: 2 AM - 1 PM (Monday - Friday) (UTC+0 Timezone).

Okay
  Public Ticket #2555387
adding new page on admin side
Closed

Comments

  •  1
    SS started the conversation

    hello there,

    I want to add a new page on back-end / admin side.

    I have to use which route.php and controller, could you explain me please?

    thanks.

  •  2,557
    Support replied

    Hi,

    You can create a new plugin for it.

    Start with command: php artisan cms:plugin:create [plugin name]

    Ex: In platform/plugins/your-plugin/src/Http/Controllers/YourPluginController.php

    public function getTest()
    {   
        return view('core/setting::test');
    }
    

    Add your route in platform/plugins/your-plugin/routes/web.php

    Add your view in platform/plugins/your-plugin/resources/views/test.blade.php

    @extends('core/base::layouts.master')
    @section('content')
     <h1>Hello</h1>
    @stop


    Or you can add route, controller, view as normal Laravel project. Just need to set layout to core/base::layouts.master


  •   SS replied privately
  •  2,557
    Support replied

    Hi,

    Change 

    Route::get('', 'MypluginController@getTest')->parameters(['' => 'randevu']);

    To

    Route::get('test', 'MypluginController@getTest');

    You can't set

    Route::get('')...

    for that route, it has conflict with 

    Route::resource('')...

    Then you can access to http://your-domain.dev/admin/myplugin/test

  •   SS replied privately
  •  2,557
    Support replied

    Hi,

    You need to add routes for theme in platform/themes/[your-theme]/routes/web.php

    And controller in platform/themes/[your-theme]/src/Http/Controllers/YourThemeController.php

  •   SS replied privately
  •  2,557
    Support replied

    I can't see this screenshot http://prntscr.com/ur3363

    Need to insert extra data into table language_meta and slugs.

  •   SS replied privately