Skip to content

Development

Generate Plugin Command

Generate the given console command for the specified plugin.

php
fresns make:command CreateDemoCommand

Generate Plugin Migration

Generate a migration for specified plugin.

php
fresns make:migration create_demos_table

Generate Plugin Seed

Generate the given seed name for the specified plugin.

php
fresns make:seed seed_fake_demos

Generate Plugin Factory

Generate the given database factory for the specified plugin.

php
fresns make:factory FactoryName

Generate Plugin Provider

Generate the given service provider name for the specified plugin.

php
fresns make:provider DemoServiceProvider

Generate Plugin Controller

Generate a controller for the specified plugin.

php
fresns make:controller PostsController

Generate Plugin Model

Generate the given model for the specified plugin.

php
fresns make:model Post

Optional options:

  • --fillable=field1,field2: set the fillable fields on the generated model
  • --migration, -m: create the migration file for the given model

Generate Plugin Middleware

Generate the given middleware name for the specified plugin.

php
fresns make:middleware CanReadPostsMiddleware

Generate Plugin DTO

Generate a DTO(data transfer object) for specified plugin.

php
fresns make:dto VerifySignDTO

Generate Plugin Mail

Generate the given mail class for the specified plugin.

php
fresns make:mail SendWeeklyPostsEmail

Generate Plugin Notification

Generate the given notification class name for the specified plugin.

php
fresns make:notification NotificationAdminOfNewComment

Generate Plugin 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.

php
fresns make:listener NotificationUsersOfANewPost

fresns make:listener NotificationUsersOfANewPost --event=PostWasCreated

fresns make:listener NotificationUsersOfANewPost --event=PostWasCreated --queued

Generate Plugin Request

Generate the given request for the specified plugin.

php
fresns make:request CreatePostRequest

Generate Plugin Event

Generate the given event for the specified plugin.

php
fresns make:event BlogPostWasUpdated

Generate Plugin Job

Generate the given job for the specified plugin.

php
fresns make:job JobName

//A synchronous job class
fresns make:job JobName --sync

Generate Plugin 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.

php
fresns make:policy PolicyName

Generate Plugin 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.

php
fresns make:rule ValidationRule

Generate Plugin 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.

php
fresns make:resource PostResource

fresns make:resource PostResource --collection

Generate Plugin Test

Generate the given test class for the specified plugin.

php
fresns make:test EloquentPostRepositoryTest

Generate Plugin Schedule Provider

Generate a console service provider for specified plugin.

php
fresns make:console-provider

Generate Plugin Event Provider

Generate a event provider for specified plugin.

php
fresns make:event-provider
  • You need to add it yourself to the providers parameter of plugin.json.

Generate Plugin SQL Provider

Generate a sql provider for specified plugin.

php
fresns make:sql-provider
  • You need to add it yourself to the providers parameter of plugin.json.

Generate Plugin Exception Provider

Generate a exception provider for specified plugin.

php
fresns make:exception-provider

Generate Plugin Command Word Provider

Generate a cmd word service provider for specified plugin.

php
fresns make:cmdword-provider
  • You need to add it yourself to the providers parameter of plugin.json.

Released under the Apache-2.0 License