├── .github └── FUNDING.yml ├── .styleci.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── composer.json ├── config ├── config.php └── viewcomposers.php ├── src ├── Console │ └── Commands │ │ ├── MakeCastCommand.php │ │ ├── MakeHelperCommand.php │ │ ├── MakeMacroCommand.php │ │ ├── MakeScopeCommand.php │ │ ├── MakeServiceCommand.php │ │ ├── MakeTraitCommand.php │ │ └── MakeViewComposerCommand.php └── LaravelMakeExtenderServiceProvider.php └── stubs ├── cast.stub ├── helper.stub ├── macro.stub ├── scope.stub ├── service.invokable.stub ├── service.stub ├── trait.bootable.stub ├── trait.stub └── viewcomposer.stub /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [dipeshsukhia] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | preset: laravel 2 | 3 | disabled: 4 | - single_class_element_per_statement 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `laravel-make-extender` will be documented in this file 4 | 5 | ## 1.0.0 - 2021-05-12 6 | 7 | - stable release 8 | 9 | 1.0.1 - 2021-06-08 10 | - invokable service, cast, collection macro 11 | 12 | 1.0.2 - 2021-09-88 13 | - View composers -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | Please read and understand the contribution guide before creating an issue or pull request. 6 | 7 | ## Etiquette 8 | 9 | This project is open source, and as such, the maintainers give their free time to build and maintain the source code 10 | held within. They make the code freely available in the hope that it will be of use to other developers. It would be 11 | extremely unfair for them to suffer abuse or anger for their hard work. 12 | 13 | Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the 14 | world that developers are civilized and selfless people. 15 | 16 | It's the duty of the maintainer to ensure that all submissions to the project are of sufficient 17 | quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. 18 | 19 | ## Viability 20 | 21 | When requesting or submitting new features, first consider whether it might be useful to others. Open 22 | source projects are used by many developers, who may have entirely different needs to your own. Think about 23 | whether or not your feature is likely to be used by other users of the project. 24 | 25 | ## Procedure 26 | 27 | Before filing an issue: 28 | 29 | - Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. 30 | - Check to make sure your feature suggestion isn't already present within the project. 31 | - Check the pull requests tab to ensure that the bug doesn't have a fix in progress. 32 | - Check the pull requests tab to ensure that the feature isn't already in progress. 33 | 34 | Before submitting a pull request: 35 | 36 | - Check the codebase to ensure that your feature doesn't already exist. 37 | - Check the pull requests to ensure that another person hasn't already submitted the feature or fix. 38 | 39 | ## Requirements 40 | 41 | If the project maintainer has any additional requirements, you will find them listed here. 42 | 43 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer). 44 | 45 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 46 | 47 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 48 | 49 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option. 50 | 51 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 52 | 53 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 54 | 55 | **Happy coding**! 56 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Limewell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # laravel-make-extender 2 | ## Generate below stub 3 | 1. Generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory. 4 | 2. Generate Service class for process chunk of codes 5 | 3. Generate Trait for process chunk of codes 6 | 4. Generate Global Scope class for Model 7 | 5. Generate Custom Casts 8 | 6. Generate Collections Macros 9 | 7. Generate View Composers 10 | 11 | [![Latest Version on Packagist](https://img.shields.io/packagist/v/limewell/laravel-make-extender.svg?style=flat-square)](https://packagist.org/packages/limewell/laravel-make-extender) 12 | [![Total Downloads](https://img.shields.io/packagist/dt/limewell/laravel-make-extender.svg?style=flat-square)](https://packagist.org/packages/limewell/laravel-make-extender) 13 | 14 | This package helps to generate and autoload custom helpers, It can generate multilevel helpers in the context of the 15 | directory. 16 | 17 | ## Installation 18 | 19 | You can install the package via composer: 20 | 21 | ```bash 22 | composer require limewell/laravel-make-extender 23 | ``` 24 | 25 | ## Generate Helper file 26 | 27 | Generate UserHelper.php under App/Helpers directory 28 | ```php 29 | php artisan make:helper UserHelper 30 | ``` 31 | Generate Module/UserHelper.php under App/Helpers/Module directory 32 | ```php 33 | php artisan make:helper Module/UserHelper 34 | ``` 35 | 36 | 37 | 38 | ## Generate Service 39 | Generate UserService.php under App/Services directory 40 | ```php 41 | php artisan make:service UserService 42 | ``` 43 | ```php 44 | (new UserService())->handle(); 45 | ``` 46 | 47 | Generate invokable UserService.php under App/Services directory 48 | ```php 49 | php artisan make:service UserService --invokable 50 | ``` 51 | ```php 52 | (new UserService())(); 53 | ``` 54 | 55 | ## Generate Trait 56 | Generate UserTrait.php under App/Traits directory 57 | ```php 58 | php artisan make:trait UserTrait 59 | ``` 60 | 61 | Generate bootable UserTrait.php under App/Traits directory 62 | ```php 63 | php artisan make:trait UserTrait --bootable 64 | ``` 65 | 66 | ## Generate Scope 67 | Generate UserScope.php under App/Scopes directory 68 | ```php 69 | php artisan make:scope UserScope 70 | ``` 71 | see document [here](https://laravel.com/docs/8.x/eloquent#global-scopes) for how to use global scopes 72 | 73 | 74 | ## Generate Custom Casts 75 | Generate JsonCast.php under App/Casts directory 76 | ```php 77 | php artisan make:cast JsonCast 78 | ``` 79 | see document [here](https://laravel.com/docs/8.x/eloquent-mutators#custom-casts) for how to use Custom Casts 80 | 81 | ## Generate Collections Macro 82 | Generate toUpper.php under App/Macros directory 83 | ```php 84 | php artisan make:macro toUpper 85 | ``` 86 | see document [here](https://laravel.com/docs/8.x/collections#extending-collections) for how to use Macro 87 | 88 | 89 | ## Generate View composers 90 | Generate config file for register view composers 91 | ```php 92 | php artisan vendor:publish --provider="Limewell\LaravelMakeExtender\LaravelMakeExtenderServiceProvider" --tag="config" 93 | ``` 94 | 95 | Generate view composers class 96 | ```php 97 | php artisan make:composer MovieComposer 98 | ``` 99 | Register view composers Edit config (config/viewcomposers.php) 100 | 101 | ```php 102 | use App\ViewComposers\MovieComposer; 103 | 104 | return [ 105 | MovieComposer::class => [ 106 | 'view1','view2' 107 | ], 108 | ]; 109 | ``` 110 | 111 | see document [here](https://laravel.com/docs/8.x/views#view-composers) for how to use View Composers 112 | 113 | ## Customize Stubs 114 | ```php 115 | php artisan vendor:publish --provider="Limewell\LaravelMakeExtender\LaravelMakeExtenderServiceProvider" --tag="stubs" 116 | ``` 117 | This will export stubs into /stubs/vendor/laravel-make-extender for customization 118 | 119 | 120 | ### Changelog 121 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. 122 | 123 | ## Contributing 124 | 125 | Please see [CONTRIBUTING](CONTRIBUTING.md) for details. 126 | 127 | ## Credits 128 | 129 | - [Dipesh Sukhia](https://github.com/dipeshsukhia) 130 | - [Bhavin Gajjar](https://github.com/bhavingajjar) 131 | - [All Contributors](../../contributors) 132 | 133 | ## License 134 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 135 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "limewell/laravel-make-extender", 3 | "description": "This package helps to generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory.", 4 | "keywords": [ 5 | "limewell", 6 | "laravel-make-extender" 7 | ], 8 | "homepage": "https://github.com/limewell/laravel-make-extender", 9 | "license": "MIT", 10 | "type": "library", 11 | "authors": [ 12 | { 13 | "name": "Dipesh Sukhia", 14 | "email": "dipesh.sukhia@gmail.com", 15 | "role": "Developer" 16 | }, 17 | { 18 | "name": "Bhavin Gajjar", 19 | "email": "gajjarbhavin22@gmail.com", 20 | "role": "Developer" 21 | } 22 | ], 23 | "require": { 24 | "php": ">=7.1.3", 25 | "illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0" 26 | }, 27 | "require-dev": { 28 | "phpunit/phpunit": "^9.0|^10.5" 29 | }, 30 | "autoload": { 31 | "psr-4": { 32 | "Limewell\\LaravelMakeExtender\\": "src" 33 | } 34 | }, 35 | "autoload-dev": { 36 | "psr-4": { 37 | "Limewell\\LaravelMakeExtender\\Tests\\": "tests" 38 | } 39 | }, 40 | "scripts": { 41 | "test": "vendor/bin/phpunit", 42 | "test-coverage": "vendor/bin/phpunit --coverage-html coverage" 43 | }, 44 | "config": { 45 | "sort-packages": true 46 | }, 47 | "extra": { 48 | "laravel": { 49 | "providers": [ 50 | "Limewell\\LaravelMakeExtender\\LaravelMakeExtenderServiceProvider" 51 | ] 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /config/config.php: -------------------------------------------------------------------------------- 1 | [ 10 | | 'welcome', 11 | | 'layout.main' 12 | | ] 13 | | 14 | | All bald files 15 | | App\Http\ViewComposers\MenuComposers::class => [ 16 | | '*' 17 | | ] 18 | | 19 | */ 20 | 21 | return [ 22 | ]; -------------------------------------------------------------------------------- /src/Console/Commands/MakeCastCommand.php: -------------------------------------------------------------------------------- 1 | resolveStubPath('cast.stub'); 22 | } 23 | 24 | /** 25 | * Resolve the fully-qualified path to the stub. 26 | * 27 | * @param string $stub 28 | * @return string 29 | */ 30 | protected function resolveStubPath(string $stub): string 31 | { 32 | return file_exists($customPath = $this->laravel->basePath("stubs/vendor/laravel-make-extender/".$stub)) 33 | ? $customPath 34 | : __DIR__. "/../../../stubs/".$stub; 35 | } 36 | 37 | /** 38 | * @param string $rootNamespace 39 | * @return string 40 | */ 41 | protected function getDefaultNamespace($rootNamespace): string 42 | { 43 | return $rootNamespace . '\Casts'; 44 | } 45 | 46 | /** 47 | * @return bool 48 | * @throws FileNotFoundException 49 | */ 50 | public function handle(): bool 51 | { 52 | $handle = parent::handle(); 53 | 54 | if ($handle === false) { 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Console/Commands/MakeHelperCommand.php: -------------------------------------------------------------------------------- 1 | resolveStubPath('helper.stub'); 22 | } 23 | 24 | /** 25 | * Resolve the fully-qualified path to the stub. 26 | * 27 | * @param string $stub 28 | * @return string 29 | */ 30 | protected function resolveStubPath(string $stub): string 31 | { 32 | return file_exists($customPath = $this->laravel->basePath("stubs/vendor/laravel-make-extender/".$stub)) 33 | ? $customPath 34 | : __DIR__. "/../../../stubs/".$stub; 35 | } 36 | 37 | /** 38 | * @param string $rootNamespace 39 | * @return string 40 | */ 41 | protected function getDefaultNamespace($rootNamespace): string 42 | { 43 | return $rootNamespace . '\Helpers'; 44 | } 45 | 46 | /** 47 | * @return bool 48 | * @throws FileNotFoundException 49 | */ 50 | public function handle(): bool 51 | { 52 | $handle = parent::handle(); 53 | 54 | if ($handle === false) { 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Console/Commands/MakeMacroCommand.php: -------------------------------------------------------------------------------- 1 | resolveStubPath('macro.stub'); 22 | } 23 | 24 | /** 25 | * Resolve the fully-qualified path to the stub. 26 | * 27 | * @param string $stub 28 | * @return string 29 | */ 30 | protected function resolveStubPath(string $stub): string 31 | { 32 | return file_exists($customPath = $this->laravel->basePath("stubs/vendor/laravel-make-extender/".$stub)) 33 | ? $customPath 34 | : __DIR__. "/../../../stubs/".$stub; 35 | } 36 | 37 | /** 38 | * @param string $rootNamespace 39 | * @return string 40 | */ 41 | protected function getDefaultNamespace($rootNamespace): string 42 | { 43 | return $rootNamespace . '\Macros'; 44 | } 45 | 46 | /** 47 | * @return bool 48 | * @throws FileNotFoundException 49 | */ 50 | public function handle(): bool 51 | { 52 | $handle = parent::handle(); 53 | 54 | if ($handle === false) { 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Console/Commands/MakeScopeCommand.php: -------------------------------------------------------------------------------- 1 | resolveStubPath('scope.stub'); 22 | } 23 | 24 | /** 25 | * Resolve the fully-qualified path to the stub. 26 | * 27 | * @param string $stub 28 | * @return string 29 | */ 30 | protected function resolveStubPath(string $stub): string 31 | { 32 | return file_exists($customPath = $this->laravel->basePath("stubs/vendor/laravel-make-extender/".$stub)) 33 | ? $customPath 34 | : __DIR__. "/../../../stubs/".$stub; 35 | } 36 | 37 | /** 38 | * @param string $rootNamespace 39 | * @return string 40 | */ 41 | protected function getDefaultNamespace($rootNamespace): string 42 | { 43 | return $rootNamespace . '\Scopes'; 44 | } 45 | 46 | /** 47 | * @return bool 48 | * @throws FileNotFoundException 49 | */ 50 | public function handle(): bool 51 | { 52 | $handle = parent::handle(); 53 | 54 | if ($handle === false) { 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Console/Commands/MakeServiceCommand.php: -------------------------------------------------------------------------------- 1 | option('invokable') 23 | ? $this->resolveStubPath('service.invokable.stub') 24 | : $this->resolveStubPath('service.stub'); 25 | } 26 | 27 | /** 28 | * Resolve the fully-qualified path to the stub. 29 | * 30 | * @param string $stub 31 | * @return string 32 | */ 33 | protected function resolveStubPath(string $stub): string 34 | { 35 | return file_exists($customPath = $this->laravel->basePath("stubs/vendor/laravel-make-extender/".$stub)) 36 | ? $customPath 37 | : __DIR__. "/../../../stubs/".$stub; 38 | } 39 | 40 | /** 41 | * @param string $rootNamespace 42 | * @return string 43 | */ 44 | protected function getDefaultNamespace($rootNamespace): string 45 | { 46 | return $rootNamespace . '\Services'; 47 | } 48 | 49 | /** 50 | * @return bool 51 | * @throws FileNotFoundException 52 | */ 53 | public function handle(): bool 54 | { 55 | $handle = parent::handle(); 56 | 57 | if ($handle === false) { 58 | return false; 59 | } 60 | 61 | return true; 62 | } 63 | 64 | /** 65 | * Get the console command options. 66 | * 67 | * @return array 68 | */ 69 | protected function getOptions() 70 | { 71 | return [ 72 | ['invokable', null, InputOption::VALUE_NONE, 'Indicates that service should be invokable'], 73 | ]; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/Console/Commands/MakeTraitCommand.php: -------------------------------------------------------------------------------- 1 | option('bootable') 23 | ? $this->resolveStubPath('trait.bootable.stub') 24 | : $this->resolveStubPath('trait.stub'); 25 | } 26 | 27 | /** 28 | * Resolve the fully-qualified path to the stub. 29 | * 30 | * @param string $stub 31 | * @return string 32 | */ 33 | protected function resolveStubPath(string $stub): string 34 | { 35 | return file_exists($customPath = $this->laravel->basePath("stubs/vendor/laravel-make-extender/".$stub)) 36 | ? $customPath 37 | : __DIR__. "/../../../stubs/".$stub; 38 | } 39 | 40 | /** 41 | * @param string $rootNamespace 42 | * @return string 43 | */ 44 | protected function getDefaultNamespace($rootNamespace): string 45 | { 46 | return $rootNamespace . '\Traits'; 47 | } 48 | 49 | /** 50 | * @return bool 51 | * @throws FileNotFoundException 52 | */ 53 | public function handle(): bool 54 | { 55 | $handle = parent::handle(); 56 | 57 | if ($handle === false) { 58 | return false; 59 | } 60 | 61 | return true; 62 | } 63 | 64 | /** 65 | * Get the console command options. 66 | * 67 | * @return array 68 | */ 69 | protected function getOptions() 70 | { 71 | return [ 72 | ['bootable', null, InputOption::VALUE_NONE, 'Indicates that trait should be bootable'], 73 | ]; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/Console/Commands/MakeViewComposerCommand.php: -------------------------------------------------------------------------------- 1 | resolveStubPath('viewcomposer.stub'); 22 | } 23 | 24 | /** 25 | * Resolve the fully-qualified path to the stub. 26 | * 27 | * @param string $stub 28 | * @return string 29 | */ 30 | protected function resolveStubPath(string $stub): string 31 | { 32 | return file_exists($customPath = $this->laravel->basePath("stubs/vendor/laravel-make-extender/".$stub)) 33 | ? $customPath 34 | : __DIR__. "/../../../stubs/".$stub; 35 | } 36 | 37 | /** 38 | * @param string $rootNamespace 39 | * @return string 40 | */ 41 | protected function getDefaultNamespace($rootNamespace): string 42 | { 43 | return $rootNamespace . '\ViewComposers'; 44 | } 45 | 46 | /** 47 | * @return bool 48 | * @throws FileNotFoundException 49 | */ 50 | public function handle(): bool 51 | { 52 | $handle = parent::handle(); 53 | 54 | if ($handle === false) { 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/LaravelMakeExtenderServiceProvider.php: -------------------------------------------------------------------------------- 1 | $views) { 48 | $this->app->make('view')->composer($views, $composer); 49 | } 50 | } 51 | } 52 | 53 | /** 54 | * Bootstrap the application services. 55 | */ 56 | public function boot() 57 | { 58 | /* 59 | * include helpers 60 | * */ 61 | array_map(function ($helper) { 62 | require_once($helper); 63 | }, self::getIncludes(app_path('Helpers'))); 64 | 65 | /* 66 | * include macros 67 | * */ 68 | array_map(function ($helper) { 69 | require_once($helper); 70 | }, self::getIncludes(app_path('Macros'))); 71 | 72 | if ($this->app->runningInConsole()) { 73 | // Publishing the stub files. 74 | $this->publishes([ 75 | __DIR__ . '/../stubs' => base_path('stubs/vendor/laravel-make-extender'), 76 | ], 'stubs'); 77 | 78 | $this->publishes([ 79 | __DIR__ . '/../config/viewcomposers.php' => base_path('config/viewcomposers.php'), 80 | ], 'config'); 81 | 82 | // Registering package commands. 83 | $this->commands([ 84 | MakeHelperCommand::class, 85 | MakeServiceCommand::class, 86 | MakeTraitCommand::class, 87 | MakeScopeCommand::class, 88 | MakeMacroCommand::class, 89 | MakeCastCommand::class, 90 | MakeViewComposerCommand::class 91 | ]); 92 | } 93 | } 94 | 95 | /** 96 | * Register the application services. 97 | */ 98 | public function register() 99 | { 100 | self::ViewComposer(); 101 | // Automatically apply the package configuration 102 | $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'laravel-make-extender'); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /stubs/cast.stub: -------------------------------------------------------------------------------- 1 | map(function ($value) use ($locale) { 11 | //return Str::upper($value); 12 | }); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /stubs/scope.stub: -------------------------------------------------------------------------------- 1 | query(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /stubs/service.invokable.stub: -------------------------------------------------------------------------------- 1 | requestData = $requestData; 16 | } 17 | 18 | /** 19 | * @return null 20 | */ 21 | public function __invoke() 22 | { 23 | return $this->requestData; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /stubs/service.stub: -------------------------------------------------------------------------------- 1 | requestData = $requestData; 16 | } 17 | 18 | /** 19 | * @return null 20 | */ 21 | public function handle() 22 | { 23 | return $this->requestData; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /stubs/trait.bootable.stub: -------------------------------------------------------------------------------- 1 | with('data',$data); 24 | } 25 | } --------------------------------------------------------------------------------