PHP code example of ianrothmann / inertia-laravel-app-service

1. Go to this page and download the library: Download ianrothmann/inertia-laravel-app-service library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ianrothmann / inertia-laravel-app-service example snippets


composer install ianrothmann/inertia-laravel-app-service

IanRothmann\InertiaApp\ServiceProviders\InertiaAppServiceProvider::class

'Rocket' =>IanRothmann\InertiaApp\Facades\InertiaApp::class

php artisan vendor:publish --provider="IanRothmann\InertiaApp\ServiceProviders\InertiaAppServiceProvider"  --tag="config"

InertiaApp::register()->resolveMenuItemRightsWith(function($code){
            //The code that is 

 $group=InertiaApp::menuGroup('Sub-menu','mdi-account')
            ->route('Page 1','pages.page1',[],'mdi-phone')
            ->link('Google','http://google.com','mdi-link');

        InertiaApp::menu('main')
            ->route('Item 1','pages.spec',[1,2],'mdi-home')
            ->route('Item 2','pages.spec',[2,1],'mdi-phone','test')
            ->route('Item 3','pages.spec',[9,8],'mdi-phone')
            ->group($group)
            ->link('Google','http://google.com');


$group=InertiaApp::menuGroup(Auth::user()->name,'mdi-account')
            ->route('Update profile','pages.user.profile',[],'mdi-account-card-details-outline')
            ->route('Change password','pages.user.changepassword',[],'mdi-key-variant');

        InertiaApp::menu('main')
            ->prependGroup($group); //or prependRoute, prependCustom etc.