mahmoud-mhamed/laravel-helpers

This is my package laravel-helpers

0.1.3 2024-07-14 12:47 UTC

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Support us

We invest a lot of resources into creating best in class open source packages. support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

install the package via composer:

composer require mahmoud-mhamed/laravel-helpers

Before Use Any Command

for laravel < 11

must add to config -> app -> providers array
  \Mahmoudmhamed\LaravelHelpers\Providers\PackageServiceProvider::class

for laravel >= 11

must add to config -> app.php
  'providers' => ServiceProvider::defaultProviders()->merge([
        \Mahmoudmhamed\LaravelHelpers\Providers\PackageServiceProvider::class,
    ])->toArray()

to force publish any file add --force to command

publish command create builder:

php artisan vendor:publish --tag="command-create-builder" 

Example

php artisan make:builder ModelName 

publish command create service:

php artisan vendor:publish --tag="command-make-service" 

publish command make New Enum File:

php artisan vendor:publish --tag="command-create-enum" 

Example

php artisan make:enum FileName
php artisan make:enum FileName --model=Product

publish base model File:

php artisan vendor:publish --tag="base-model" 

publish base date text trait:

php artisan vendor:publish --tag="date-text-trait" 

publish paginatable-trait :

php artisan vendor:publish --tag="paginatable-trait" 

publish UseTranslationsTrait : work with spatie laravel translatable to append attribute for translation column

php artisan vendor:publish --tag="model-column-translation-trait" 

publish morph model trigger trait:

php artisan vendor:publish --tag="morph-model-trigger-trait" 

Table columns

$table->nullableMorphs('created_by');
$table->nullableMorphs('updated_by');
$table->nullableMorphs('deleted_by');
$table->softDeletes();

publish trans-lang-file-command:

composer require datlechin/laravel-google-translate
php artisan vendor:publish --tag="trans-lang-file-command" 

Credits

License

The MIT License (MIT). Please see License File for more information.