Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ctf0/laravel-helper-cmnds
Some Helper Console Cmnds For Laravel To Speedup The Usual Workflow
https://github.com/ctf0/laravel-helper-cmnds
console laravel php
Last synced: 11 days ago
JSON representation
Some Helper Console Cmnds For Laravel To Speedup The Usual Workflow
- Host: GitHub
- URL: https://github.com/ctf0/laravel-helper-cmnds
- Owner: ctf0
- License: mit
- Created: 2016-08-04T04:52:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T23:14:42.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T12:19:27.694Z (about 1 month ago)
- Topics: console, laravel, php
- Language: PHP
- Homepage:
- Size: 83 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Laravel Helper Cmnds
A helper console cmnds to speedup the usual workflow.
## Installation
- `composer require ctf0/helper-cmnds`
## Usage
```bash
ex:clear # Clear (Bootstrap-Files/Cache/Config/Route-Cache/View/Session/Compiled/Laravel-LogFile/Pass-Resets)
ex:finetune # Cache (Bootstrap-Files/View/Config/Routes/Events)
ex:make # Make (Controller/Model/Migration/Seeder/Route/View/Validation)
```**1-** ex:clear
> - php artisan optimize:clear
> - Cache::store('file')->flush();
> - Session::flush()
> - File::cleanDirectory(config('session.files'));
> - File::put(storage_path('logs/laravel.log'), '');
> - php artisan auth:clear-resets `if the table was migrated`
> - composer dump-autoload* an event gets fired when this command has finished in case you want to run something else after it, and you can hook into it through:
```php
// app/Providers/EventServiceProvider.php
public function boot()
{
parent::boot();Event::listen('clearAll.done', function () {
// any other cmnds you want to run
});
}
```
**2-** ex:finetune
> - composer dump-autoload
> - php artisan optimize
> - php artisan view:cache
> - php artisan event:cache
**3-** ex:make (for a two word className ex. `SubPage`, write it as `sub_page`)
> - Validation [y/N] [Read More](https://ctf0.wordpress.com/2016/10/16/extend-formrequest-to-allow-more-functionality-in-laravel-v5-3/).
> - create 2 classes for **Update & Store** `php artisan make:request {name}`
> - register the **FormRequest** classes to the controller automatically
>
> - Controller
> - if "Route Model Binding" we will add the **Model** class to the controller automatically
> - php artisan make:controller --resource
>
> - Model & Migration
> - create `App/Models/BaseModel.php` if not found
> - create `App/Models/ClassName.php`
> - `php artisan make:migration {name} --create`
>
> - Seeder [y/N]
> - php artisan make:seeder
> - create a seeder file & register it under `DatabaseSeeder::run()`.
>
> - Routes [y/N] [Also Check](http://code4fun.io/post/how-to-share-data-with-all-views-in-laravel-5-3-the-right-way)
> - creates a new folder in `routes/WebRoutes/ClassName.php`.
> - append a loop to `web.php` to include all the files from the `routes/WebRoutes` folder.
>
> - Views [y/N]
> - create a new folder in `resources/views/pages/ClassName/` + files for **'index/create/show/edit'**.
### Security
If you discover any security-related issues, please email [[email protected]](mailto:[email protected]).