### Setup Algolia Front-end Source: https://github.com/programmernomad/laracorekit/blob/main/docs/advanced/search.md Install dependencies and initialize the search client in JavaScript. ```bash npm install algoliasearch instantsearch.js ``` ```javascript import algoliasearch from 'algoliasearch/lite'; import instantsearch from 'instantsearch.js'; const searchClient = algoliasearch('YOUR_APP_ID', 'YOUR_SEARCH_KEY'); const search = instantsearch({ indexName: 'blog_posts', searchClient, }); search.start(); ``` -------------------------------- ### Install LaraCoreKit Source: https://github.com/programmernomad/laracorekit/blob/main/docs/comparisons/laracorekit-vs-livewire-starter.md Manual installation via Git clone, requiring environment configuration and database setup. ```bash # Git clone installation git clone https://github.com/ProgrammerNomad/LaraCoreKit.git my-app cd my-app composer install npm install cp .env.example .env php artisan key:generate touch database/database.sqlite php artisan migrate --seed php artisan storage:link php artisan filament:user npm run build php artisan serve ``` -------------------------------- ### Install Demo Module Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Install the required demo module package via Composer. ```bash composer require programmernomad/laracorekit-demo-module ``` -------------------------------- ### Install and Configure Laravel Scout Source: https://github.com/programmernomad/laracorekit/blob/main/docs/advanced/search.md Setup commands for Laravel Scout integration. ```bash composer require laravel/scout php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider" ``` -------------------------------- ### Setup Docker with Laravel Sail Source: https://github.com/programmernomad/laracorekit/blob/main/docs/faq.md Install and start the application using Laravel Sail for containerized development. ```bash composer require laravel/sail --dev php artisan sail:install ./vendor/bin/sail up ``` -------------------------------- ### Clone and Install Dependencies Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Clone the repository and install PHP and JavaScript dependencies. ```bash git clone https://github.com/ProgrammerNomad/LaraCoreKit.git cd LaraCoreKit ``` ```bash composer install ``` ```bash COMPOSER_MEMORY_LIMIT=-1 composer install ``` ```bash npm install ``` ```bash yarn install ``` -------------------------------- ### Install LaraCoreKit locally Source: https://github.com/programmernomad/laracorekit/blob/main/CONTRIBUTING.md Commands to clone the repository, install dependencies, configure the environment, and initialize the database. ```bash # Clone your fork git clone https://github.com/YOUR-USERNAME/LaraCoreKit.git cd LaraCoreKit # Install dependencies composer install npm install # Setup environment cp .env.example .env php artisan key:generate # Setup database touch database/database.sqlite php artisan migrate --seed php artisan storage:link # Create admin user php artisan filament:user # Start development servers npm run dev php artisan serve ``` -------------------------------- ### Setup Database Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Creates the production database and user, then runs migrations. ```bash # Create production database mysql -u root -p << EOF CREATE DATABASE laracorekit_prod CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'laracorekit_user'@'localhost' IDENTIFIED BY 'secure_password_here'; GRANT ALL PRIVILEGES ON laracorekit_prod.* TO 'laracorekit_user'@'localhost'; FLUSH PRIVILEGES; EOF # Run migrations php artisan migrate --force ``` -------------------------------- ### Start Development Server Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Launch the local development server. ```bash php artisan serve ``` -------------------------------- ### Install Laravel Telescope Source: https://github.com/programmernomad/laracorekit/blob/main/docs/faq.md Install and configure Telescope to monitor SQL queries and application events. ```bash composer require laravel/telescope --dev php artisan telescope:install php artisan migrate ``` -------------------------------- ### Install Official Laravel Livewire Starter Source: https://github.com/programmernomad/laracorekit/blob/main/docs/comparisons/laracorekit-vs-livewire-starter.md Uses the official Laravel installer to scaffold a new project with Livewire. ```bash # One command installation laravel new my-app --using=livewire cd my-app php artisan migrate npm install && npm run dev php artisan serve ``` -------------------------------- ### Install Dependencies Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Install required PHP and Node.js packages using Composer and npm. ```bash composer install npm install ``` -------------------------------- ### Create Admin and Start Server Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Create the initial administrator account and launch the development server. ```bash php artisan filament:user ``` ```bash php artisan serve ``` -------------------------------- ### Set up the local environment Source: https://github.com/programmernomad/laracorekit/blob/main/docs/contributing.md Commands to configure environment variables, install dependencies, and prepare the database. ```bash cp .env.example .env composer install npm install php artisan key:generate php artisan migrate --seed npm run dev ``` -------------------------------- ### Install and build JavaScript dependencies Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Installs Node.js packages and compiles frontend assets. ```bash ./vendor/bin/sail npm install ./vendor/bin/sail npm run build ``` -------------------------------- ### Install and Use Module Source: https://github.com/programmernomad/laracorekit/blob/main/docs/modules/publishing.md Commands to install the package via Composer and usage of the Livewire component in Blade templates. ```bash composer require programmernomad/laracorekit-newsletter php artisan migrate ``` ```blade @livewire('newsletter.subscribe') ``` -------------------------------- ### Configure Production Environment Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Example .env file configuration for production settings. ```env APP_ENV=production APP_DEBUG=false APP_URL=https://www.laracorekit.com DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_DATABASE=laracorekit_prod DB_USERNAME=laracorekit_user DB_PASSWORD=secure_password_here CACHE_DRIVER=redis SESSION_DRIVER=redis QUEUE_CONNECTION=redis MAIL_MAILER=smtp MAIL_HOST=smtp.laracorekit.com MAIL_PORT=587 MAIL_USERNAME=your_email MAIL_PASSWORD=your_password ``` -------------------------------- ### Migration Output Example Source: https://github.com/programmernomad/laracorekit/blob/main/docs/modules/create-module.md Expected console output after running the migration command. ```text Migrating: 2024_01_01_create_subscribers_table Migrated: 2024_01_01_create_subscribers_table (32.50ms) ``` -------------------------------- ### Setup Supervisor Queue Worker Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Configures and starts a Supervisor process to manage Laravel queue workers. ```ini [program:laracorekit-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/LaraCoreKit/artisan queue:work --sleep=3 --tries=3 --max-time=3600 autostart=true autorestart=true stopasgroup=true killasgroup=true user=www-data numprocs=4 redirect_stderr=true stdout_logfile=/var/www/LaraCoreKit/storage/logs/worker.log stopwaitsecs=3600 ``` ```bash sudo supervisorctl reread sudo supervisorctl update sudo supervisorctl start laracorekit-worker:* ``` -------------------------------- ### Install and Configure Laravel Telescope Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Installs Telescope dependencies and restricts its availability to demo mode environments. ```bash composer require laravel/telescope php artisan telescope:install php artisan migrate ``` ```php // config/telescope.php 'enabled' => env('TELESCOPE_ENABLED', env('DEMO_MODE', false)), ``` -------------------------------- ### Clone and Configure Application Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Clones the repository, installs dependencies, generates the application key, and sets directory permissions. ```bash cd /var/www sudo git clone https://github.com/ProgrammerNomad/LaraCoreKit.git cd LaraCoreKit # Install dependencies (production) composer install --no-dev --optimize-autoloader npm install --production npm run build # Setup environment cp .env.example .env php artisan key:generate # Set permissions sudo chown -R www-data:www-data /var/www/LaraCoreKit sudo chmod -R 755 /var/www/LaraCoreKit sudo chmod -R 775 /var/www/LaraCoreKit/storage sudo chmod -R 775 /var/www/LaraCoreKit/bootstrap/cache ``` -------------------------------- ### Install via Composer Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Use these commands to install the demo module via Packagist for production or local development environments. ```bash composer require programmernomad/laracorekit-demo-module ``` ```bash composer require programmernomad/laracorekit-demo-module --dev ``` -------------------------------- ### Troubleshoot Composer Installation Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Steps to clear the Composer cache and perform a verbose installation to debug failures. ```bash # Clear Composer cache composer clear-cache # Install with verbose output composer install -vvv ``` -------------------------------- ### Manage Laravel Sail Development Environment Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/docker.md Commands for installing, starting, and interacting with Laravel Sail containers. ```bash # Install Sail php artisan sail:install # Start all services (MySQL, Redis, etc.) ./vendor/bin/sail up -d # Run artisan commands inside container ./vendor/bin/sail artisan migrate ./vendor/bin/sail artisan queue:work # Run composer inside container ./vendor/bin/sail composer require some/package # Run npm inside container ./vendor/bin/sail npm run dev ``` -------------------------------- ### Install Composer dependencies Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Uses a temporary Docker container to install PHP dependencies without requiring a local PHP installation. ```bash docker run --rm \ -u "$(id -u):$(id -g)" \ -v $(pwd):/var/www/html \ -w /var/www/html \ laravelsail/php82-composer:latest \ composer install --ignore-platform-reqs ``` -------------------------------- ### Verify Installation Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Commands to check the Laravel version, list installed modules, and run system health checks. ```bash # Check Laravel version php artisan --version # Check installed modules php artisan module:list # Run health checks php artisan about ``` -------------------------------- ### List Endpoint Query Parameters Source: https://github.com/programmernomad/laracorekit/blob/main/docs/api/endpoints.md Example request demonstrating filtering and pagination parameters. ```text GET /api/posts?locale=en&status=published&page=1&per_page=12 ``` -------------------------------- ### Source Files Metadata Example Source: https://github.com/programmernomad/laracorekit/blob/main/docs/DOCUMENTATION_METADATA_GUIDE.md Example format for linking to relevant source code files within the metadata block. ```markdown **Source Files:** [BlogResource](../../modules/Blog/src/Filament/Resources/BlogResource.php) | [Routes](../../modules/Blog/routes/web.php) | [Model](../../modules/Blog/src/Models/Post.php) ``` -------------------------------- ### Verify Environment Prerequisites Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Check installed versions of PHP, Composer, and Node.js to ensure compatibility. ```bash php -v # Should show 8.2+ composer -V # Should show 2.x node -v # Should show 18+ ``` -------------------------------- ### Register Module Routes Source: https://github.com/programmernomad/laracorekit/blob/main/docs/project-structure.md Example of how to load module-specific routes within a ServiceProvider. ```php // modules/Blog/src/BlogServiceProvider.php public function boot() { $this->loadRoutesFrom(__DIR__.'/routes/web.php'); } ``` -------------------------------- ### Install and Configure Certbot Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/hosting.md Commands to install Certbot and issue SSL certificates for Nginx. ```bash # Install Certbot sudo apt install certbot python3-certbot-nginx # Issue certificate sudo certbot --nginx -d laracorekit.com -d www.laracorekit.com # Auto-renewal (runs twice daily) sudo systemctl enable certbot.timer ``` -------------------------------- ### Install System Dependencies Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Installs PHP 8.3, Composer, Node.js 18, MySQL, and Nginx on Ubuntu/Debian systems. ```bash # Update system sudo apt update && sudo apt upgrade -y # Install PHP 8.3 sudo add-apt-repository ppa:ondrej/php sudo apt install php8.3-fpm php8.3-cli php8.3-mysql php8.3-pgsql \ php8.3-xml php8.3-mbstring php8.3-curl php8.3-zip \ php8.3-gd php8.3-bcmath php8.3-intl # Install Composer curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer # Install Node.js 18 curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt install -y nodejs # Install MySQL sudo apt install mysql-server # Install Nginx sudo apt install nginx ``` -------------------------------- ### Install SSL Certificate Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Uses Certbot to provision Let's Encrypt SSL certificates for the domain. ```bash sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d laracorekit.com -d www.laracorekit.com ``` -------------------------------- ### Install Package in LaraCoreKit Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Steps to remove the local module and install the new package via Composer. ```bash git rm -r modules/Demo ``` ```bash composer require laracorekit/demo-module ``` -------------------------------- ### Configure Algolia Driver Source: https://github.com/programmernomad/laracorekit/blob/main/docs/advanced/search.md Install the Algolia client and set environment variables for Scout. ```bash composer require algolia/algoliasearch-client-php # Set Scout driver to algolia SCOUT_DRIVER=algolia ALGOLIA_APP_ID=your-app-id ALGOLIA_SECRET=your-secret-key ``` -------------------------------- ### Start Laravel Sail services Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Initializes the Docker containers for the application stack. ```bash ./vendor/bin/sail up -d ``` -------------------------------- ### Supervisor Configuration Source: https://github.com/programmernomad/laracorekit/blob/main/docs/advanced/queues.md Example configuration for running queue workers as a background process in production. ```ini [program:laracorekit-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/html/artisan queue:work redis --sleep=3 --tries=3 --max-time=3600 autostart=true autorestart=true user=www-data numprocs=2 redirect_stderr=true stdout_logfile=/var/log/laracorekit-worker.log stopwaitsecs=3600 ``` -------------------------------- ### Deploy to Laravel Cloud Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/hosting.md Commands to install the CLI, authenticate, and deploy a project to the official Laravel hosting platform. ```bash # Install CLI curl -fsSL https://cloud.laravel.com/installer.sh | sh # Login cloud login # Deploy from your project root cloud deploy ``` -------------------------------- ### Implement Full Filament Resource Source: https://github.com/programmernomad/laracorekit/blob/main/docs/admin/resources.md Complete example of a PostResource class defining form schema, table columns, filters, and route pages. ```php schema([ Forms\Components\Grid::make(2)->schema([ Forms\Components\TextInput::make('title') ->required() ->maxLength(255) ->live(onBlur: true) ->afterStateUpdated(fn ($state, $set) => $set('slug', \Str::slug($state)) ), Forms\Components\TextInput::make('slug') ->required() ->unique(ignoreRecord: true), ]), Forms\Components\Select::make('status') ->options(['draft' => 'Draft', 'published' => 'Published']) ->default('draft') ->required(), Forms\Components\Select::make('locale') ->options(['en' => 'English', 'hi' => 'Hindi', 'ar' => 'Arabic']) ->default('en') ->required(), Forms\Components\Textarea::make('excerpt') ->rows(2) ->maxLength(500), Forms\Components\RichEditor::make('content') ->columnSpanFull() ->required(), Forms\Components\SpatieMediaLibraryFileUpload::make('cover') ->collection('cover') ->image() ->imageResizeMode('cover'), Forms\Components\DateTimePicker::make('published_at'), ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('title')->searchable()->sortable(), Tables\Columns\BadgeColumn::make('status') ->colors(['warning' => 'draft', 'success' => 'published']), Tables\Columns\TextColumn::make('locale')->label('Lang'), Tables\Columns\TextColumn::make('published_at')->since()->sortable(), ]) ->filters([ Tables\Filters\SelectFilter::make('status') ->options(['draft' => 'Draft', 'published' => 'Published']), Tables\Filters\SelectFilter::make('locale') ->options(['en' => 'English', 'hi' => 'Hindi', 'ar' => 'Arabic']), ]) ->actions([ Tables\Actions\EditAction::make(), Tables\Actions\DeleteAction::make(), ]) ->bulkActions([ Tables\Actions\DeleteBulkAction::make(), ]); } public static function getPages(): array { return [ 'index' => Pages\ListPosts::route('/'), 'create' => Pages\CreatePost::route('/create'), 'edit' => Pages\EditPost::route('/{record}/edit'), ]; } } ``` -------------------------------- ### Add as Dev Dependency Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Install the package as a development dependency. ```bash composer require laracorekit/demo-module --dev ``` -------------------------------- ### Run Queue Worker Source: https://github.com/programmernomad/laracorekit/blob/main/docs/configuration.md Start the queue worker process. ```bash php artisan queue:work ``` -------------------------------- ### Dispatching Jobs in Livewire Source: https://github.com/programmernomad/laracorekit/blob/main/docs/advanced/queues.md Example of dispatching background jobs from within a Livewire component method. ```php class RegisterForm extends Component { public function register(): void { $user = User::create($this->validated()); // Dispatch to queue - don't block the response SendWelcomeEmail::dispatch($user); SendVerificationEmail::dispatch($user); $this->redirect(route('home')); } } ``` -------------------------------- ### Running Queue Workers Source: https://github.com/programmernomad/laracorekit/blob/main/docs/advanced/queues.md Commands to start and manage queue worker processes. ```bash # Basic worker php artisan queue:work # Worker with specifics php artisan queue:work redis --queue=emails,default --sleep=3 --tries=3 # Process only one job then stop php artisan queue:work --once # Graceful shutdown after current job php artisan queue:restart ``` -------------------------------- ### GitHub Actions Demo Deployment Workflow Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Automates deployment to a Plesk server, including dependency installation, asset building, and database resetting. ```yaml name: Deploy Demo Environment on: push: branches: - main - demo jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Deploy to Plesk uses: appleboy/ssh-action@master with: host: ${{ secrets.DEMO_SERVER_HOST }} username: ${{ secrets.DEMO_SERVER_USER }} key: ${{ secrets.DEMO_SERVER_SSH_KEY }} script: | cd /var/www/vhosts/laracorekit.com # Pull latest code git pull origin main # Install dependencies composer install --no-dev --optimize-autoloader # Run migrations (safe with fresh flag in demo) php artisan migrate --force # Clear caches php artisan config:cache php artisan route:cache php artisan view:cache # Build assets npm ci npm run build # Reset demo database immediately after deploy php artisan demo:reset --force # Restart queues if applicable php artisan queue:restart ``` -------------------------------- ### Deployment Automation Script Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/production.md Automate the deployment process by pulling the latest code, installing dependencies, and clearing caches. ```bash #!/bin/bash set -e # Navigate to app cd /var/www/laracorekit # Pull latest code git pull origin main # Install/update PHP dependencies composer install --no-dev --optimize-autoloader --no-interaction # Install/build frontend npm ci && npm run build # Cache everything php artisan config:cache php artisan route:cache php artisan view:cache php artisan event:cache # Run migrations php artisan migrate --force # Create storage symlink (if not exists) php artisan storage:link # Restart queue workers php artisan queue:restart echo " Deployment complete!" ``` ```bash chmod +x deploy.sh ./deploy.sh ``` -------------------------------- ### Configure Environment and Database Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Set up the environment file, application key, and database connection. ```bash cp .env.example .env ``` ```bash php artisan key:generate ``` ```env DB_CONNECTION=sqlite # Comment out or remove these: # DB_HOST=127.0.0.1 # DB_PORT=3306 # DB_DATABASE=laracorekit # DB_USERNAME=root # DB_PASSWORD= ``` ```bash # Windows type nul > database\database.sqlite # macOS/Linux touch database/database.sqlite ``` ```sql CREATE DATABASE laracorekit CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ``` ```env DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laracorekit DB_USERNAME=root DB_PASSWORD=your_password ``` ```sql CREATE DATABASE laracorekit ENCODING 'UTF8'; ``` ```env DB_CONNECTION=pgsql DB_HOST=127.0.0.1 DB_PORT=5432 DB_DATABASE=laracorekit DB_USERNAME=postgres DB_PASSWORD=your_password ``` -------------------------------- ### Manual Deployment Commands Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Execute these commands via SSH to pull the latest code, install dependencies, run migrations, and build assets. ```bash # SSH into server ssh username@www.laracorekit.com cd /var/www/vhosts/laracorekit.com # Pull latest code git pull origin main # Install dependencies composer install --no-dev --optimize-autoloader # Publish demo config php artisan vendor:publish --tag=demo-config # Run migrations php artisan migrate --force # Seed demo data php artisan db:seed --force # Clear and cache php artisan config:cache php artisan route:cache php artisan view:cache # Build assets npm ci npm run build # Initial demo reset php artisan demo:reset --force ``` -------------------------------- ### Initialize Environment Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Create the environment configuration file and generate the application encryption key. ```bash cp .env.example .env php artisan key:generate ``` -------------------------------- ### Execute commands using Sail alias Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Examples of using the configured sail alias for common tasks. ```bash sail up -d sail artisan migrate sail npm run dev ``` -------------------------------- ### Publish Demo Configuration Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Run this command to generate the config/demo.php file with default settings. ```bash php artisan vendor:publish --tag=demo-config ``` -------------------------------- ### Create Package README Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Basic documentation template for the new package repository. ```markdown # Demo Module for Laravel Auto-resetting demo environment with Filament integration. ## Installation composer require laracorekit/demo-module ## Configuration php artisan vendor:publish --tag=demo-config ## Usage See full documentation... ``` -------------------------------- ### Configure Database Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Set up the database connection settings in the .env file and prepare the SQLite file if applicable. ```env DB_CONNECTION=sqlite # DB_DATABASE=database/database.sqlite # Commented out for SQLite ``` ```bash touch database/database.sqlite ``` ```env DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laracorekit DB_USERNAME=root DB_PASSWORD=your_password ``` -------------------------------- ### Run Migrations and Build Assets Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Execute database migrations and compile frontend assets. ```bash php artisan migrate --seed ``` ```bash npm run dev ``` ```bash npm run build ``` -------------------------------- ### Configure queues Source: https://github.com/programmernomad/laracorekit/blob/main/docs/faq.md Set the queue connection in the environment file and prepare the database table. ```env QUEUE_CONNECTION=database ``` ```bash php artisan queue:table php artisan migrate php artisan queue:work ``` -------------------------------- ### Initialize SQLite Database Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Create the SQLite database file if it does not exist. ```bash touch database/database.sqlite ``` -------------------------------- ### GET /api/settings Source: https://github.com/programmernomad/laracorekit/blob/main/docs/api/endpoints.md Retrieves public site settings. ```APIDOC ## GET /api/settings ### Description Retrieves public site settings. ### Method GET ### Endpoint /api/settings ``` -------------------------------- ### GET /api/user Source: https://github.com/programmernomad/laracorekit/blob/main/docs/api/endpoints.md Retrieves the profile information of the authenticated user. ```APIDOC ## GET /api/user ### Description Retrieves the profile information of the authenticated user. ### Method GET ### Endpoint /api/user ``` -------------------------------- ### Initialize New Repository Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Commands to create a new repository and clone it locally for the extracted module. ```bash # On GitHub, create: laracorekit/demo-module git clone https://github.com/laracorekit/demo-module.git cd demo-module ``` -------------------------------- ### Create Module Directory Structure Source: https://github.com/programmernomad/laracorekit/blob/main/docs/modules/create-module.md Use these shell commands to initialize the standard directory layout for a new module. ```bash mkdir -p modules/Newsletter/src/Http/Livewire mkdir -p modules/Newsletter/src/Models mkdir -p modules/Newsletter/src/Filament/Resources mkdir -p modules/Newsletter/database/migrations mkdir -p modules/Newsletter/database/seeders mkdir -p modules/Newsletter/views/newsletter mkdir -p modules/Newsletter/routes ``` -------------------------------- ### Create screenshot directory Source: https://github.com/programmernomad/laracorekit/blob/main/NEXT_STEPS.md Run this command to prepare the directory structure for project screenshots. ```bash mkdir -p docs/images/screenshots ``` -------------------------------- ### GET /api/posts/{slug} Source: https://github.com/programmernomad/laracorekit/blob/main/docs/api/endpoints.md Retrieves a single published blog post by its slug. ```APIDOC ## GET /api/posts/{slug} ### Description Retrieves a single published blog post by its slug. ### Method GET ### Endpoint /api/posts/{slug} ### Parameters #### Path Parameters - **slug** (string) - Required - The unique slug of the post ``` -------------------------------- ### Configure ServiceProvider for Package Source: https://github.com/programmernomad/laracorekit/blob/main/docs/modules/publishing.md Registers migrations, views, configuration, and Livewire components within the package's boot method. ```php class NewsletterServiceProvider extends ServiceProvider { public function boot(): void { // Load migrations $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); // Load views $this->loadViewsFrom(__DIR__ . '/../views', 'newsletter'); // Publish assets (optional) $this->publishes([ __DIR__ . '/../config/newsletter.php' => config_path('newsletter.php'), __DIR__ . '/../views' => resource_path('views/vendor/newsletter'), ], 'newsletter'); // Merge config $this->mergeConfigFrom( __DIR__ . '/../config/newsletter.php', 'newsletter' ); // Register Livewire components Livewire::component('newsletter.subscribe', Subscribe::class); } } ``` -------------------------------- ### GET /api/posts Source: https://github.com/programmernomad/laracorekit/blob/main/docs/api/endpoints.md Lists all published blog posts with support for pagination and filtering. ```APIDOC ## GET /api/posts ### Description Lists all published blog posts with support for pagination and filtering. ### Method GET ### Endpoint /api/posts ### Parameters #### Query Parameters - **locale** (string) - Optional - Filter by language (default: en) - **page** (integer) - Optional - Page number (default: 1) - **per_page** (integer) - Optional - Items per page (default: 15, max: 100) ``` -------------------------------- ### Bootstrap module functionality via ServiceProvider Source: https://github.com/programmernomad/laracorekit/blob/main/docs/core/modules-system.md Use the boot method to register migrations, views, Livewire components, and routes. Views are loaded under a specific namespace for isolation. ```php namespace Modules\\Blog; use Illuminate\\Support\\ServiceProvider; use Livewire\\Livewire; class BlogServiceProvider extends ServiceProvider { public function register(): void { // Bind interfaces, share config, etc. } public function boot(): void { // Load migrations $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); // Load Blade views under 'blog::' namespace $this->loadViewsFrom(__DIR__ . '/../views', 'blog'); // Register Livewire components Livewire::component('blog.blog-list', \\Modules\\Blog\\Http\\Livewire\\BlogList::class); Livewire::component('blog.blog-detail', \\Modules\\Blog\\Http\\Livewire\\BlogDetail::class); // Load routes $this->loadRoutesFrom(__DIR__ . '/../routes/web.php'); } } ``` -------------------------------- ### Deploy to Fly.io Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/hosting.md CLI commands to initialize and deploy a Docker-based application to Fly.io. ```bash # Install flyctl curl -L https://fly.io/install.sh | sh # Login fly auth login # Initialize (creates fly.toml) fly launch # Deploy fly deploy ``` -------------------------------- ### Setup Cron Job Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Adds the Laravel scheduler to the crontab for the www-data user. ```bash * * * * * cd /var/www/LaraCoreKit && php artisan schedule:run >> /dev/null 2>&1 ``` -------------------------------- ### User Control Commands Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Commands for users to install, enable, disable, or remove the module. ```bash # Install composer require laracorekit/demo-module # Enable # .env: DEMO_MODULE_ENABLED=true # Disable # .env: DEMO_MODULE_ENABLED=false # Remove completely composer remove laracorekit/demo-module ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Define demo mode settings and credentials in the .env file. ```env DEMO_MODE=true DEMO_RESET_INTERVAL=30 DEMO_ADMIN_EMAIL=admin@laracorekit.com DEMO_ADMIN_PASSWORD=Admin@123 DEMO_USER_EMAIL=user@laracorekit.com DEMO_USER_PASSWORD=User@123 ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Set demo mode and credentials in the .env file. Ensure DEMO_MODE is set to true only on the demo server. ```env # Demo Mode Configuration DEMO_MODE=true DEMO_RESET_INTERVAL=30 # Demo Credentials (displayed on login pages) DEMO_ADMIN_EMAIL=admin@laracorekit.com DEMO_ADMIN_PASSWORD=Admin@123 DEMO_USER_EMAIL=user@laracorekit.com DEMO_USER_PASSWORD=User@123 ``` ```env # Demo Mode (set to true on demo server only) DEMO_MODE=false DEMO_RESET_INTERVAL=30 DEMO_ADMIN_EMAIL=admin@laracorekit.com DEMO_ADMIN_PASSWORD=Admin@123 DEMO_USER_EMAIL=user@laracorekit.com DEMO_USER_PASSWORD=User@123 ``` -------------------------------- ### Implement module ServiceProvider Source: https://github.com/programmernomad/laracorekit/blob/main/docs/modules/module-structure.md The ServiceProvider is the only required file for bootstrapping module resources. ```php class BlogServiceProvider extends ServiceProvider { public function boot(): void { // Makes migrations run with php artisan migrate $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); // Enables blog:: view namespace $this->loadViewsFrom(__DIR__ . '/../views', 'blog'); // Registers Livewire components Livewire::component('blog.blog-list', BlogList::class); // Registers routes $this->loadRoutesFrom(__DIR__ . '/../routes/web.php'); // Publishes config (optional) $this->publishes([ __DIR__ . '/../config/blog.php' => config_path('blog.php'), ], 'config'); } } ``` -------------------------------- ### Prepare Database for Queues Source: https://github.com/programmernomad/laracorekit/blob/main/docs/advanced/queues.md Commands to generate and run the migration for the jobs table when using the database driver. ```bash php artisan queue:table php artisan migrate ``` -------------------------------- ### Run Migrations and Seeders Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Execute database migrations and seed the database with initial data. ```bash php artisan migrate --seed ``` -------------------------------- ### Create Module-Specific Layouts Source: https://github.com/programmernomad/laracorekit/blob/main/docs/frontend/layouts.md Example of a custom module layout that extends the core application layout. ```blade @extends('core::layouts.app') @section('content')
{{ $slot }}
@endsection ``` -------------------------------- ### Create a Livewire Search Component Source: https://github.com/programmernomad/laracorekit/blob/main/docs/frontend/livewire.md A basic component demonstrating state management and real-time search filtering. ```php when($this->query, fn ($q) => $q->where('title', 'like', "%{$this->query}%") ) ->latest() ->take(10) ->get(); return view('blog::livewire.blog-search', compact('posts')); } } ``` ```blade
Searching...
``` -------------------------------- ### Sanctum API Route Protection Source: https://github.com/programmernomad/laracorekit/blob/main/docs/features/authentication.md Example of protecting an API route using the sanctum guard. ```php Route::middleware('auth:sanctum')->get('/user', function (Request $request) { return $request->user(); }); ``` -------------------------------- ### Configuration Documentation Template Source: https://github.com/programmernomad/laracorekit/blob/main/docs/DOCUMENTATION_METADATA_GUIDE.md Standard header for configuration files and settings documentation. ```markdown # Configuration --- **Supported Stack:** Laravel 13 / Filament 5 / Livewire 4 / Tailwind 4 **Last Updated:** April 22, 2026 **Source Files:** [modules.php](../../config/modules.php) | [app.php](../../config/app.php) --- Learn how to configure LaraCoreKit for your project... ``` -------------------------------- ### Run Settings Seeder Source: https://github.com/programmernomad/laracorekit/blob/main/docs/features/settings.md Execute the seeder command to persist custom settings to the database. ```bash php artisan db:seed --class=Modules\\Settings\\Database\\Seeders\\SettingsSeeder ``` -------------------------------- ### Troubleshoot Demo Banner Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Commands to clear configuration and view caches, and verify demo configuration settings via tinker. ```php // Check config php artisan config:clear php artisan tinker >>> config('demo.enabled') >>> config('demo.banner.show_on_login') // Clear view cache php artisan view:clear ``` -------------------------------- ### Configure Forge Environment Variables Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/hosting.md Example production environment configuration for a Laravel site managed via Forge. ```env APP_ENV=production APP_DEBUG=false APP_URL=https://www.laracorekit.com DB_DATABASE=laracorekit DB_PASSWORD=your-secure-password QUEUE_CONNECTION=redis CACHE_DRIVER=redis ``` -------------------------------- ### Token Issuance Request and Response Source: https://github.com/programmernomad/laracorekit/blob/main/docs/api/sanctum.md Example cURL request to obtain a token and the corresponding JSON response structure. ```bash curl -X POST https://www.laracorekit.com/api/tokens \ -H "Content-Type: application/json" \ -d '{"email":"user@laracorekit.com","password":"secret","device_name":"My App"}' ``` ```json { "token": "1|abc123def456...", "user": { "id": 1, "name": "John Doe", "email": "john@laracorekit.com" } } ``` -------------------------------- ### Repository Management Commands Source: https://github.com/programmernomad/laracorekit/blob/main/NEXT_STEPS.md Commands for creating the screenshot directory, committing assets, and tagging a new release. ```bash # Create screenshots directory mkdir -p docs/images/screenshots # After adding images, commit them git add docs/images/screenshots/ git commit -m "Add product screenshots and demo GIFs" git push # When ready for first release git tag -a v0.1.0 -m "Release v0.1.0" git push origin v0.1.0 ``` -------------------------------- ### Register a new module Source: https://github.com/programmernomad/laracorekit/blob/main/docs/faq.md Steps to register a custom module by updating configuration and autoloading settings. ```php enabled => true ``` ```json composer.json ``` ```bash composer dump-autoload && php artisan optimize:clear ``` -------------------------------- ### Forge Deployment Script Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/hosting.md Standard shell commands to update code, install dependencies, and run migrations on a Forge-managed server. ```bash cd /home/forge/laracorekit.com git pull origin main composer install --no-dev --optimize-autoloader npm ci && npm run build php artisan migrate --force php artisan optimize php artisan queue:restart ``` -------------------------------- ### Add Database Indexes Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/optimization.md Example migration code to add indexes to frequently queried columns for improved lookup speed. ```php // In a migration Schema::table('blog_posts', function (Blueprint $table) { $table->index(['status', 'locale']); $table->index('slug'); $table->index('published_at'); $table->index('author_id'); }); ``` -------------------------------- ### Feature test implementation Source: https://github.com/programmernomad/laracorekit/blob/main/docs/advanced/testing.md Example of a feature test class using RefreshDatabase and model factories to verify HTTP responses. ```php count(5)->published()->create(); Post::factory()->count(3)->draft()->create(); $response = $this->get(route('blog.index')); $response ->assertOk() ->assertViewHas('posts') ->assertViewHas('posts', fn ($posts) => $posts->count() === 5); } /** @test */ public function it_shows_a_published_post(): void { $post = Post::factory()->published()->create([ 'title' => 'Test Post Title', ]); $this->get(route('blog.show', $post->slug)) ->assertOk() ->assertSee('Test Post Title'); } /** @test */ public function it_returns_404_for_draft_post(): void { $post = Post::factory()->draft()->create(); $this->get(route('blog.show', $post->slug)) ->assertNotFound(); } } ``` -------------------------------- ### Create Database for MySQL Source: https://github.com/programmernomad/laracorekit/blob/main/docs/faq.md Execute this SQL command on your MySQL server if the database does not exist. ```sql CREATE DATABASE laracorekit; ``` -------------------------------- ### Create Storage Symlink Source: https://github.com/programmernomad/laracorekit/blob/main/docs/configuration.md Create a symbolic link for local storage access. ```bash php artisan storage:link ``` -------------------------------- ### Paginated Response Structure Source: https://github.com/programmernomad/laracorekit/blob/main/docs/api/endpoints.md Example of the JSON structure returned by list endpoints, including data, metadata, and navigation links. ```json { "data": [ { "id": 1, "title": "First Post", "slug": "first-post" } ], "meta": { "current_page": 1, "last_page": 5, "per_page": 15, "total": 72 }, "links": { "first": "https://www.laracorekit.com/api/posts?page=1", "next": "https://www.laracorekit.com/api/posts?page=2", "prev": null, "last": "https://www.laracorekit.com/api/posts?page=5" } } ``` -------------------------------- ### Run tests Source: https://github.com/programmernomad/laracorekit/blob/main/docs/faq.md Execute the test suite using either Artisan or Composer. ```bash php artisan test # Or composer test ``` -------------------------------- ### View Project Structure Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Use the tree command to visualize the project directory structure, excluding vendor and node_modules folders. ```bash # View project structure tree -L 2 -I 'vendor|node_modules' # Or just explore in your code editor code . ``` -------------------------------- ### Build Frontend Assets Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Compile frontend assets using Vite. ```bash npm run build ``` -------------------------------- ### Clone Repository Source: https://github.com/programmernomad/laracorekit/blob/main/docs/quick-start.md Download the project source code from GitHub and navigate into the directory. ```bash git clone https://github.com/ProgrammerNomad/LaraCoreKit.git cd LaraCoreKit ``` -------------------------------- ### List Root Directory Files Source: https://github.com/programmernomad/laracorekit/blob/main/docs/project-structure.md Displays the essential files located in the project root directory. ```text .env # Environment configuration (DO NOT COMMIT) .env.example # Environment template .gitignore # Git ignore rules artisan # Artisan CLI tool composer.json # PHP dependencies composer.lock # Locked PHP versions package.json # JavaScript dependencies package-lock.json # Locked JS versions phpunit.xml # PHPUnit configuration README.md # Project readme ``` -------------------------------- ### Configure Image Storage and Permissions Source: https://github.com/programmernomad/laracorekit/blob/main/docs/faq.md Commands and configuration checks to resolve issues with image display. ```bash php artisan storage:link ``` ```bash chmod -R 755 storage ``` -------------------------------- ### View Config Directory Structure Source: https://github.com/programmernomad/laracorekit/blob/main/docs/project-structure.md Layout of the /config directory containing framework and module settings. ```text config/ ├── app.php # Application settings ├── auth.php # Authentication config ├── database.php # Database connections ├── filesystems.php # Storage disks ├── modules.php # Module configuration ├── permission.php # Spatie permission config ├── filament.php # Filament admin config ├── cache.php # Cache drivers ├── mail.php # Email settings ├── queue.php # Queue connections └── services.php # Third-party services ``` -------------------------------- ### Enable Module Configuration Source: https://github.com/programmernomad/laracorekit/blob/main/docs/modules/create-module.md Register the module in the configuration file to enable it and define its namespace and service provider. ```php 'Newsletter' => [ 'enabled' => true, 'namespace' => 'Modules\\Newsletter', 'provider' => 'Modules\\Newsletter\\NewsletterServiceProvider', ], ``` -------------------------------- ### Configure Mail Settings in .env Source: https://github.com/programmernomad/laracorekit/blob/main/docs/configuration.md Sets up SMTP mail server details and sender information. ```env MAIL_MAILER=smtp MAIL_HOST=mailpit MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS="hello@laracorekit.com" MAIL_FROM_NAME="${APP_NAME}" ``` -------------------------------- ### Project File Structure Source: https://github.com/programmernomad/laracorekit/blob/main/NEXT_STEPS.md Displays the newly created and modified files within the project directory. ```text docs/ SCREENSHOT_GUIDE.md DOCUMENTATION_METADATA_GUIDE.md faq.md (updated) introduction.md (updated) comparisons/ laracorekit-vs-larament.md laracorekit-vs-livewire-starter.md .github/ ISSUES_TO_SEED.md README_REPOSITORY.md IMPLEMENTATION_CHECKLIST.md ROADMAP.md phpstan.neon.dist ``` ```text README.md - Added screenshot section with placeholders CHANGELOG.md - Updated [Unreleased] section docs/introduction.md - Added metadata header ``` ```text docs/images/screenshots/ - You need to create this and add 6 images ``` -------------------------------- ### Optimize application performance Source: https://github.com/programmernomad/laracorekit/blob/main/docs/faq.md Cache configuration and routes, and configure Redis for improved performance. ```bash php artisan optimize # Cache everything ``` ```env CACHE_DRIVER=redis SESSION_DRIVER=redis QUEUE_CONNECTION=redis ``` -------------------------------- ### Configure Database Connection in .env Source: https://github.com/programmernomad/laracorekit/blob/main/docs/configuration.md Specifies database credentials and connection parameters. ```env DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laracorekit DB_USERNAME=root DB_PASSWORD= ``` -------------------------------- ### Configure Vite Build Inputs Source: https://github.com/programmernomad/laracorekit/blob/main/docs/configuration.md Define entry points for the Vite build process. ```js input: ['resources/css/app.css', 'resources/js/app.js'] ``` -------------------------------- ### Troubleshoot Database Connections Source: https://github.com/programmernomad/laracorekit/blob/main/docs/installation.md Commands to verify database connectivity and clear configuration caches. ```bash # Test database connection php artisan db:show # Clear config cache php artisan config:clear ``` -------------------------------- ### Test and verify changes Source: https://github.com/programmernomad/laracorekit/blob/main/docs/contributing.md Commands to format code, execute test suites, and perform static analysis. ```bash # Format code ./vendor/bin/pint # Run all tests php artisan test # Run type checking (if using PHPStan) ./vendor/bin/phpstan analyse ``` -------------------------------- ### Create Global Search Livewire Component Source: https://github.com/programmernomad/laracorekit/blob/main/docs/advanced/search.md Implement a real-time search component that maps results to URLs. ```php class GlobalSearch extends Component { public string $query = ''; public array $results = []; public function updatedQuery(): void { if (strlen($this->query) < 2) { $this->results = []; return; } $this->results = Post::search($this->query) ->take(10) ->get() ->map(fn ($post) => [ 'id' => $post->id, 'title' => $post->title, 'url' => route('blog.show', $post->slug), 'type' => 'Post', ]) ->toArray(); } public function render() { return view('core::livewire.global-search'); } } ``` -------------------------------- ### Read Settings in PHP Source: https://github.com/programmernomad/laracorekit/blob/main/docs/features/settings.md Retrieve individual settings with optional defaults or fetch the entire configuration set as an array. ```php use Modules\Settings\Models\Setting; // Get a value with default $siteName = Setting::get('site_name', 'LaraCoreKit'); // Get all settings as key-value array $all = Setting::getAll(); ``` -------------------------------- ### Clone the repository Source: https://github.com/programmernomad/laracorekit/blob/main/docs/contributing.md Initial step to obtain a local copy of the project after forking on GitHub. ```bash # Fork on GitHub first, then: git clone https://github.com/YOUR_USERNAME/LaraCoreKit.git cd LaraCoreKit ``` -------------------------------- ### Run Module Migrations Source: https://github.com/programmernomad/laracorekit/blob/main/docs/modules/create-module.md Execute the artisan command to apply database migrations for the module. ```bash php artisan migrate ``` -------------------------------- ### Customize Demo Settings Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/demo-setup.md Modify the config/demo.php file to adjust security, blocked actions, and UI appearance. ```php // config/demo.php 'allowed_hosts' => [ 'www.laracorekit.com', // Your demo domain 'localhost', '127.0.0.1', ], 'blocked_actions' => [ 'user.delete', 'role.delete', 'backup.run', // Add your custom actions ], 'banner' => [ 'background_color' => 'blue-50', // Change colors 'border_color' => 'blue-500', 'text_color' => 'blue-900', ], ``` -------------------------------- ### Configure Cache and Sessions in .env Source: https://github.com/programmernomad/laracorekit/blob/main/docs/configuration.md Defines drivers for caching, sessions, and queue management. ```env CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_CONNECTION=sync ``` -------------------------------- ### Benchmark Application Performance Source: https://github.com/programmernomad/laracorekit/blob/main/docs/deployment/optimization.md Commands for load testing using Apache Benchmark. ```bash # Install k6 for load testing # https://k6.io # Or use Apache Benchmark ab -n 1000 -c 10 https://www.laracorekit.com/blog ``` -------------------------------- ### Define Resource Directory Structure Source: https://github.com/programmernomad/laracorekit/blob/main/docs/admin/resources.md Standard path convention for placing resource files within a module. ```text modules/{Module}/src/Filament/Resources/ └── {Model}Resource.php ``` ```text modules/Blog/src/Filament/Resources/PostResource.php ```