### 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')