Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Starter Pack Laravel Package

fukibay/laravel-starter-pack

Interactive Laravel starter pack for clean architecture with Repository/Service layers. One install command scaffolds base infrastructure, error handling, helpers, and DB config. Includes smart make commands, SoftDeletes auto-detection, QueryParameters DTO, MySQL/PostgreSQL support.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Steps

  1. Installation Run composer require fukibay/laravel-starter-pack in your Laravel project. Publish the package assets with php artisan vendor:publish --provider="Fukibay\StarterPack\StarterPackServiceProvider" to generate config files.

  2. First Command Kickstart your project’s infrastructure with:

    php artisan fukibay:install
    

    Follow the interactive prompts (e.g., database driver, table prefix).

  3. First Use Case Generate a Repository + Service pair for a model (e.g., User):

    php artisan fukibay:make:repository User
    php artisan fukibay:make:service User
    

    This creates:

    • app/Repositories/UserRepository.php (with soft-deletes logic if HasSoftDeletes is used in the model).
    • app/Services/UserService.php (with repository injection and soft-delete-aware methods).

Implementation Patterns

Workflows

  1. Layered Architecture Use the package to enforce Repository Pattern (data access) + Service Layer (business logic) separation. Example:

    // Service layer (app/Services/UserService.php)
    public function deleteUser($id) {
        return $this->userRepository->delete($id); // Soft-delete if enabled
    }
    
  2. Interactive Scaffolding Chain commands for rapid setup:

    php artisan fukibay:make:model Post -m --migration=posts
    php artisan fukibay:make:repository Post
    php artisan fukibay:make:service Post
    

    Flags:

    • -m: Create migration.
    • --migration=: Specify migration name.
  3. Soft Deletes Integration The package auto-detects HasSoftDeletes in models and generates:

    • Repository methods: forceDelete(), restore().
    • Service methods: softDelete(), permanentlyDelete().

Integration Tips

  • Customize Templates Override default stubs in resources/stubs/ (publish with php artisan vendor:publish --tag=starter-pack-stubs). Example: Modify repository.stub to add custom query scopes.

  • Service Binding Bind services in AppServiceProvider for dependency injection:

    $this->app->bind(UserService::class, function ($app) {
        return new UserService(new UserRepository());
    });
    
  • API Controllers Pair with laravel-api or similar to auto-generate controllers:

    php artisan fukibay:make:repository Post
    php artisan api:controller PostController --repository=PostRepository
    

Gotchas and Tips

Pitfalls

  1. Soft Deletes Mismatch

    • If a model uses HasSoftDeletes but the repository lacks forceDelete(), manually add:
      public function forceDelete($id) {
          return $this->model->where('id', $id)->forceDelete();
      }
      
    • Debug Tip: Check if the usesSoftDeletes property is set in the generated repository.
  2. Migration Conflicts

    • Running fukibay:make:model -m after migrations exist may cause conflicts. Use --force cautiously:
      php artisan fukibay:make:model Post -m --force
      
  3. Config Overrides

    • The package publishes a starter-pack.php config. Override defaults (e.g., repository_namespace) before running commands:
      'repository_namespace' => 'App\\Repositories\\Custom\\',
      

Debugging

  • Command Errors Enable debug mode in config/starter-pack.php:

    'debug' => env('APP_DEBUG', false),
    

    Check logs in storage/logs/laravel.log for interactive prompt failures.

  • Stub Path Issues If templates aren’t found, verify the stubs_path in the config points to the published stubs:

    'stubs_path' => __DIR__.'/../../../resources/stubs/',
    

Extension Points

  1. Custom Commands Extend the package by creating a custom command that uses its helpers:

    use Fukibay\StarterPack\Commands\MakeRepositoryCommand;
    
    class CustomMakeCommand extends MakeRepositoryCommand {
        protected $signature = 'custom:make {name}';
        // Override logic here
    }
    
  2. Event Listeners Hook into the repository.created event to post-process repositories:

    // In EventServiceProvider
    protected $listen = [
        'Fukibay\StarterPack\Events\RepositoryCreated' => [
            'App\Listeners\AddCustomScopeToRepository',
        ],
    ];
    
  3. Testing Mock repositories/services in tests:

    $this->mock(UserRepository::class)->shouldReceive('find')->andReturn($user);
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours