> For the complete documentation index, see [llms.txt](https://abnermouke.gitbook.io/abnermouke-supports/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://abnermouke.gitbook.io/abnermouke-supports/kuang-jia-shi-yong/laravel.md).

# Laravel

abnermouke/supports 安装成功后即可进行Laravel个性化配置，步骤如下：

在[ **config/app.php** ](#user-content-fn-1)[^1]的[ **providers** ](#user-content-fn-1)[^1]中注册服务提供者

```php
Abnermouke\Supports\Frameworks\Laravel\SupportsServiceProvider::class,
```

构建工具提供一配置文件帮助开发者自行配置自己的构建配置，导出命令：

```sh
php artisan vendor:publish --provider="Abnermouke\Supports\Frameworks\Laravel\SupportsServiceProvider"
```

添加通用中间件至[ **app/Http/Kernel.php**](#user-content-fn-1)[^1] (如需在指定路由使用中间件，请将内容填充至 $routeMiddleware 内，并标记标识):

```php
protected $middleware = [
    
    ///
   
    \App\Http\Middleware\Abnermouke\BaseSupportsMiddleware::class,
];
```

执行组件初始化命令：

```sh
php artisan builder:supports
```

添加辅助函数自动加载只 [**composer.json**](#user-content-fn-1)[^1]

```json
 "autoload": {
       
       // 
        
        "files": [
            "app/Helpers/auth.php",
            "app/Helpers/response.php",
            "app/Helpers/projects.php"
        ]
    },
```

执行[ **Composer Autoload** ](#user-content-fn-1)[^1]以生效辅助函数

```bash
composer dump-autoload
```

更改数据库严格模式（兼容GroupBy查询 Mysql5.7）[**configs/database.php**](#user-content-fn-1)[^1]

```php
 "mysql" => [
        
        //关闭严格模式
        "strict" => false
        
 ],
```

**How to use it - 这么使用**

创建资源构建 Package

```bash
php artisan builder:package {your-table-name-without-db-prefix}
```

例如：

```sh
php artisan builder:package accounts
```

即可生成 accounts 相关的migration、service、model、repository、cache文件

资源构建完毕后，可通过接口构建工具 Interface 生成对应接口访问 controller、interface 文件。

执行命令与 Package 相似：

```
php artisan builder:interface {your-table-name-without-db-prefix}
```

[^1]:


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://abnermouke.gitbook.io/abnermouke-supports/kuang-jia-shi-yong/laravel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
