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.
Installation:
composer require l5starter/core:5.4.x-dev
Add the provider and aliases to config/app.php as shown in the README.
Publish Config:
php artisan vendor:publish --provider="L5Starter\Core\CoreServiceProvider"
This generates a config/l5starter.php file with default settings.
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.
Authentication & Authorization:
make:auth scaffolding for login, registration, and password reset.Authenticatable models (e.g., User) with custom logic via traits or accessors.use L5Starter\Core\Traits\HasRoles; // Hypothetical trait (verify if included)
class User extends Authenticatable {
use HasRoles;
}
Form Handling:
{!! Form::open(['route' => 'posts.store']) !!}
{!! Form::text('title') !!}
{!! Form::submit('Create') !!}
{!! Form::close() !!}
Flash::success('Post created!');
Repository Pattern (Prettus):
use Prettus\Repository\Eloquent\BaseRepository;
class PostRepository extends BaseRepository {
public function scopePublished($query) {
return $query->where('published', true);
}
}
AppServiceProvider:
$this->app->bind('App\Repositories\PostRepository', function () {
return new PostRepository(new Post());
});
Middleware Integration:
auth, guest, or custom middleware (e.g., role) in routes:
Route::get('/admin', 'AdminController@index')->middleware('role:admin');
Configuration:
config/l5starter.php:
'auth' => [
'redirects' => [
'login' => '/dashboard',
'logout' => '/',
],
],
Missing Documentation:
HasRoles) may not exist—verify via source code (vendor/l5starter/core).Laracasts or Collective).Laravel 5.4 Compatibility:
make:auth) may behave differently in newer Laravel versions.Configuration Overrides:
vendor:publish) is required for customization. Skipping this may lead to undefined behavior.Authentication Quirks:
make:auth command generates 5.4-style scaffolding. If you upgrade Laravel later, manually update routes/controllers.web, api) may not be configured. Verify in config/auth.php.Flash Messages:
app/Http/Kernel.php:
'web' => [
\Laracasts\Flash\FlashServiceProvider::class,
// ...
],
Check Published Config:
vendor:publish, inspect config/l5starter.php for overrides. Example:
dd(config('l5starter.auth.redirects'));
Repository Debugging:
Prettus\Repository\Config::withDebug();
bootstrap/app.php or AppServiceProvider.Form/HTML Issues:
php artisan view:clear) if forms render incorrectly.config/app.php aliases.Authentication Failures:
php artisan route:list | grep auth
App\User model for required fields (e.g., password, remember_token).Custom Traits:
App\User with traits for reusable logic (e.g., HasPermissions):
use L5Starter\Core\Traits\HasPermissions; // Hypothetical
class User extends Authenticatable {
use HasPermissions;
}
Middleware:
app/Http/Middleware/ and register it:
$router->aliasMiddleware('role', \App\Http\Middleware\CheckRole::class);
Service Providers:
AppServiceProvider:
$this->app->singleton('customService', function () {
return new CustomService();
});
Views:
resources/views/auth/login.blade.php) for theming.Events:
Illuminate\Auth\Events\Registered) in EventServiceProvider.How can I help you explore Laravel packages today?