erikfig/laravel

Laravel 框架。

dev-master 2017-11-01 00:42 UTC

This package is auto-updated.

Last update: 2024-09-07 16:23:58 UTC


README

官方骨架: https://github.com/laravel/laravel

Bake 模块

运行

php artisan bake:module [name]

运行名称使用复数和小写,例如

php artisan bake:module pages

在 config/app.php 中注册服务提供者,查看命令结果。命令结果示例

Add this provider to config/app.php:
Modules\Pages\Providers\PageServiceProvider::class,

CrudController 和 ApiController

两个简单的 Laravel 上的 CRUD 特性。

查看模块 app/Http/Controllers/ApiControllerTrait.phpapp/Http/Controllers/CrudControllerTrait.php 中的文件,以及在模块 Controllers 目录中的示例。

UploadObserverTrait

示例

<?php

namespace Modules\MyModule\Observers;

use Modules\MyModule\Models\Profile;

class ProfileObserver
{
    use UploadObserverTrait;

    protected $field = 'photo';
    protected $path = 'profile_photos/';

    public function creating(Profile $model)
    {
        $this->sendFile($model);
    }

    public function deleting(Profile $model)
    {
        $this->removeFile($model);
    }

    public function updating(Profile $model)
    {
        $this->updateFile($model);
    }
}

待办事项

  • AdminLTE
  • 通过电子邮件和 Socialite 进行身份验证
  • CORS 包 (barryvdh/laravel-cors)
  • 使用 Passport 和社交网络的 OAuth 2.0
  • 默认启用 S3 上传