PHP code example of hongyukeji / laravel-theme

1. Go to this page and download the library: Download hongyukeji/laravel-theme 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/ */

    

hongyukeji / laravel-theme example snippets

shell
$ php artisan vendor:publish --provider="Hongyukeji\LaravelTheme\ThemeServiceProvider"

// 1. 在 config/themes.php 中 添加 templates, 如:
'templates' => [
    'frontend' => [
        'path' => 'frontend',
        'template' => 'default',
        'default' => 'default',
    ],
],

// 2. 在控制器中使用:
public function index()
{
    return view('frontend::index.index');
}

// 3. 在视图目录新建frontend目录和对应的index(frontend => 终端, default => 主题):
resources/views/frontend
resources/views/frontend/default
resources/views/frontend/default/index
resources/views/frontend/default/index/index.blade.php