mgahed / laravel-starter
This is my package laravel-starter
Installs: 24
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
pkg:composer/mgahed/laravel-starter
Requires
- php: ^8.2
- phpunit/phpunit: ^11.1
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^3.1
- laravel/pint: ^1.17
- orchestra/testbench: ^v9.0.0
README
The package mgahed/laravel-starter allows you to easily use starter templates for your Laravel projects.
This is a PHP Package made to serve a plain Laravel project, This package add authentication and (view, edit, delete) profile using Saul theme. And you can easily customize and use the theme features in your project.
Warning
Please note that this package is still in development.
Installation
composer require mgahed/laravel-starter
Publishing
assets
php artisan vendor:publish --tag="mgahed-laravel-starter-assets"
This will add folder assets to the public path in your Laravel project.
migrations
php artisan vendor:publish --tag="mgahed-laravel-starter-migrations"
seeders
php artisan vendor:publish --tag="mgahed-laravel-starter-seeders"
Running Migrations
php artisan migrate --path=database/migrations/mgahed-laravel-starter
Running Seeders
php artisan db:seed --class=Mgahed\LaravelStarter\Database\Seeders\MgahedStarterSitesSeeder
php artisan db:seed --class=Mgahed\LaravelStarter\Database\Seeders\MgahedStarterMenusSeeder
Features supported
- Authentication
- Profile (view, edit, delete)
- Easy translation system with multi-language support
- Automated translation job (see Translation Job Guide)
- Saul Theme supported
- Easy to customize
- Supports
mcamara/laravel-localizationpackage- Run
composer require mcamara/laravel-localization - publish the config file
php artisan vendor:publish --provider="Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider" - See docs here
- Run
Translation System
The package includes a powerful translation job that can automatically translate your content to multiple languages using Google Translate API. The job integrates seamlessly with mcamara/laravel-localization to support all configured locales.
Translation Scanning
The translation scanner automatically discovers translation keys from your code and vendor packages.
for example if you have alot of packages under mgahed By default, it scans:
- Application views and controllers
- All vendor packages under the
mgahednamespace (configurable)
Scanning Multiple Vendor Packages
You can configure the package prefix to scan all packages under a specific vendor namespace. This is useful when you have multiple packages like mgahed/ai, mgahed/core, mgahed/one, etc.
Configuration:
Add to your .env file:
PACKAGES_PREFIX=mgahed
How it works:
The scanner will automatically discover and scan all packages under vendor/{PACKAGES_PREFIX}/:
- Scans
resources/viewsdirectory in each package - Scans
srcdirectory in each package - No need to manually configure each package
Example:
If you have the following packages:
vendor/mgahed/aivendor/mgahed/corevendor/mgahed/onevendor/mgahed/laravel-starter
All of them will be automatically scanned for translation keys without additional configuration.
Running the Scan:
use Mgahed\LaravelStarter\Jobs\ScanTranslationJob; // Dispatch the job to scan for translation keys ScanTranslationJob::dispatch();
Quick Start
use Mgahed\LaravelStarter\Jobs\TranslateJob; // Translate from English to all supported languages TranslateJob::dispatch('en'); // Translate from English to specific languages TranslateJob::dispatch('en', ['ar', 'fr', 'es']);
For detailed usage instructions, see the Translation Job Guide.