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

Core Laravel Package

l5starter/core

Laravel 5.4 core starter package bundling common providers (Repository, Flash, Collective HTML) plus a CoreServiceProvider. Includes publishable config and supports Laravel auth scaffolding and migrations for quick project setup.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation:

    composer require l5starter/core:5.4.x-dev
    

    Add the provider and aliases to config/app.php as shown in the README.

  2. Publish Config:

    php artisan vendor:publish --provider="L5Starter\Core\CoreServiceProvider"
    

    This generates a config/l5starter.php file with default settings.

  3. First Use Case: Run the built-in authentication scaffolding:

    php artisan make:auth
    

    Then migrate the database:

    php artisan migrate
    

    The package integrates with Laravel's default auth system, Laracasts Flash, and Collective HTML out of the box.


Implementation Patterns

Core Workflows

  1. Authentication & Authorization:

    • Use the default make:auth scaffolding for login, registration, and password reset.
    • Extend Authenticatable models (e.g., User) with custom logic via traits or accessors.
    • Example:
      use L5Starter\Core\Traits\HasRoles; // Hypothetical trait (verify if included)
      class User extends Authenticatable {
          use HasRoles;
      }
      
  2. Form Handling:

    • Leverage Collective HTML for forms:
      {!! Form::open(['route' => 'posts.store']) !!}
          {!! Form::text('title') !!}
          {!! Form::submit('Create') !!}
      {!! Form::close() !!}
      
    • Use Laracasts Flash for notifications:
      Flash::success('Post created!');
      
  3. Repository Pattern (Prettus):

    • If the package includes Prettus Repository, use it for Eloquent models:
      use Prettus\Repository\Eloquent\BaseRepository;
      class PostRepository extends BaseRepository {
          public function scopePublished($query) {
              return $query->where('published', true);
          }
      }
      
    • Register the repository in AppServiceProvider:
      $this->app->bind('App\Repositories\PostRepository', function () {
          return new PostRepository(new Post());
      });
      
  4. Middleware Integration:

    • Use auth, guest, or custom middleware (e.g., role) in routes:
      Route::get('/admin', 'AdminController@index')->middleware('role:admin');
      
  5. Configuration:

    • Override defaults in config/l5starter.php:
      'auth' => [
          'redirects' => [
              'login' => '/dashboard',
              'logout' => '/',
          ],
      ],
      

Gotchas and Tips

Pitfalls

  1. Missing Documentation:

    • The package lacks detailed docs. Assume Prettus Repository and custom traits (e.g., HasRoles) may not exist—verify via source code (vendor/l5starter/core).
    • Check for namespace collisions if using similar packages (e.g., Laracasts or Collective).
  2. Laravel 5.4 Compatibility:

    • The package targets 5.4.x-dev. Ensure your Laravel version matches or test thoroughly.
    • Some features (e.g., make:auth) may behave differently in newer Laravel versions.
  3. Configuration Overrides:

    • Publishing config (vendor:publish) is required for customization. Skipping this may lead to undefined behavior.
  4. Authentication Quirks:

    • The make:auth command generates 5.4-style scaffolding. If you upgrade Laravel later, manually update routes/controllers.
    • Default guards (web, api) may not be configured. Verify in config/auth.php.
  5. Flash Messages:

    • Laracasts Flash uses sessions. Ensure middleware is registered in app/Http/Kernel.php:
      'web' => [
          \Laracasts\Flash\FlashServiceProvider::class,
          // ...
      ],
      

Debugging Tips

  1. Check Published Config:

    • After vendor:publish, inspect config/l5starter.php for overrides. Example:
      dd(config('l5starter.auth.redirects'));
      
  2. Repository Debugging:

    • If using Prettus, enable debug mode:
      Prettus\Repository\Config::withDebug();
      
    • Check for errors in bootstrap/app.php or AppServiceProvider.
  3. Form/HTML Issues:

    • Clear cached views (php artisan view:clear) if forms render incorrectly.
    • Verify Collective HTML is loaded in config/app.php aliases.
  4. Authentication Failures:

    • Test routes manually:
      php artisan route:list | grep auth
      
    • Check App\User model for required fields (e.g., password, remember_token).

Extension Points

  1. Custom Traits:

    • Extend App\User with traits for reusable logic (e.g., HasPermissions):
      use L5Starter\Core\Traits\HasPermissions; // Hypothetical
      class User extends Authenticatable {
          use HasPermissions;
      }
      
  2. Middleware:

    • Create custom middleware in app/Http/Middleware/ and register it:
      $router->aliasMiddleware('role', \App\Http\Middleware\CheckRole::class);
      
  3. Service Providers:

    • Bind custom repositories or services in AppServiceProvider:
      $this->app->singleton('customService', function () {
          return new CustomService();
      });
      
  4. Views:

    • Override default auth views (e.g., resources/views/auth/login.blade.php) for theming.
  5. Events:

    • Listen for auth events (e.g., Illuminate\Auth\Events\Registered) in EventServiceProvider.
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.
datacore/hub-sdk
alengo/sulu-http-cache-bundle
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php
trappistes/laravel-custom-fields
splash/sonata-admin
splash/metadata