PHP code example of lingyun / think-assistor

1. Go to this page and download the library: Download lingyun/think-assistor 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/ */

    

lingyun / think-assistor example snippets


$assistor = $this->app->get('service.assistor');

public function boot()
{
    $assistor = $this->app->get('service.assistor');
    $assistor->publishes([
        __DIR__.'/../config/courier.php' => config_path('courier.php'),
    ]);
}

public function boot()
{
    $assistor = $this->app->get('service.assistor');
    $assistor->loadMigrationsFrom(__DIR__.'/../database/migrations');
}

public function boot()
{
    $assistor = $this->app->get('service.assistor');
    $assistor->loadFactoriesFrom(__DIR__ . '/../database/factories/');
}

public function boot()
{
    $assistor = $this->app->get('service.assistor');
    $assistor->loadTranslationsFrom(__DIR__.'/../resources/lang');
}

public function boot()
{
    $assistor = $this->app->get('service.assistor');

    $assistor->loadViewsFrom(__DIR__.'/../resources/views', 'courier');
}

Route::get('/dashboard', function () {
     return app('view.finder')->fetch('courier::dashboard', ['name' => 'thinkphp']);
});

public function boot()
{
    if($this->app->has('service.assistor')){
        $assistor = $this->app->get('service.assistor');

        $assistor->loadViewsFrom(__DIR__.'/../resources/views', 'courier');

        $assistor->publishes([
            __DIR__.'/../resources/static' => public_path('vendor/courier'),
            ], 'courier-static');
    }
}

php think assets:publish --tag=courier-static --force