開發指令
產生外掛 Command
Generate the given console command for the specified plugin.
fresns make:command CreateDemoCommand產生外掛 Migration
Generate a migration for specified plugin.
fresns make:migration create_demos_table產生外掛 Seed
Generate the given seed name for the specified plugin.
fresns make:seed seed_fake_demos產生外掛 Factory
Generate the given database factory for the specified plugin.
fresns make:factory FactoryName產生外掛 Provider
Generate the given service provider name for the specified plugin.
fresns make:provider DemoServiceProvider產生外掛 Controller
Generate a controller for the specified plugin.
fresns make:controller PostsController產生外掛 Model
Generate the given model for the specified plugin.
fresns make:model PostOptional options:
--fillable=field1,field2: set the fillable fields on the generated model--migration,-m: create the migration file for the given model
產生外掛 Middleware
Generate the given middleware name for the specified plugin.
fresns make:middleware CanReadPostsMiddleware產生外掛 DTO
Generate a DTO(data transfer object) for specified plugin.
fresns make:dto VerifySignDTO產生外掛 Mail
Generate the given mail class for the specified plugin.
fresns make:mail SendWeeklyPostsEmail產生外掛 Notification
Generate the given notification class name for the specified plugin.
fresns make:notification NotificationAdminOfNewComment產生外掛 Listener
Generate the given listener for the specified plugin. Optionally you can specify which event class it should listen to. It also accepts a --queued flag allowed queued event listeners.
fresns make:listener NotificationUsersOfANewPost
fresns make:listener NotificationUsersOfANewPost --event=PostWasCreated
fresns make:listener NotificationUsersOfANewPost --event=PostWasCreated --queued產生外掛 Request
Generate the given request for the specified plugin.
fresns make:request CreatePostRequest產生外掛 Event
Generate the given event for the specified plugin.
fresns make:event BlogPostWasUpdated產生外掛 Job
Generate the given job for the specified plugin.
fresns make:job JobName
//A synchronous job class
fresns make:job JobName --sync產生外掛 Policy
Generate the given policy class for the specified plugin.
The Policies is not generated by default when creating a new plugin. Change the value of paths.generator.policies in plugins.php to your desired location.
fresns make:policy PolicyName產生外掛 Rule
Generate the given validation rule class for the specified plugin.
The Rules folder is not generated by default when creating a new plugin. Change the value of paths.generator.rules in plugins.php to your desired location.
fresns make:rule ValidationRule產生外掛 Resource
Generate the given resource class for the specified plugin. It can have an optional --collection argument to generate a resource collection.
The Transformers folder is not generated by default when creating a new plugin. Change the value of paths.generator.resource in plugins.php to your desired location.
fresns make:resource PostResource
fresns make:resource PostResource --collection產生外掛 Test
Generate the given test class for the specified plugin.
fresns make:test EloquentPostRepositoryTest產生外掛任務調度提供者
Generate a console service provider for specified plugin.
fresns make:console-provider產生外掛事件服務提供者
Generate a event provider for specified plugin.
fresns make:event-provider- You need to add it yourself to the
providersparameter ofplugin.json.
產生外掛 SQL 服務提供者
Generate a sql provider for specified plugin.
fresns make:sql-provider- You need to add it yourself to the
providersparameter ofplugin.json.
產生外掛 Exception 服務提供者
Generate a exception provider for specified plugin.
fresns make:exception-provider產生外掛「指令字」服務提供者
Generate a cmd word service provider for specified plugin.
fresns make:cmdword-provider- You need to add it yourself to the
providersparameter ofplugin.json.