### TastyIgniter Installation Guide Source: https://tastyigniter.com/docs/3.x/advanced/scheduling-tasks Comprehensive instructions for installing TastyIgniter, including prerequisites and setup steps. ```APIDOC Installation: - System requirements (PHP version, database, etc.). - Installation methods (e.g., Composer, manual). - Database configuration and setup. - Initial application setup and configuration. ``` -------------------------------- ### Run TastyIgniter Installation Source: https://tastyigniter.com/docs/master/installation Executes the interactive command-line setup for TastyIgniter. It guides the user through database configuration, application URL, and administrator details. ```php php artisan igniter:install ``` -------------------------------- ### Run TastyIgniter Installation Command Source: https://tastyigniter.com/docs/upgrade-guide Command to execute the TastyIgniter installation process after navigating into the new project directory. This handles database migrations and setup. ```bash cd mytasty-new php artisan igniter:install ``` -------------------------------- ### Run TastyIgniter Interactive Setup Source: https://tastyigniter.com/docs/installation Executes the TastyIgniter command-line setup tool to configure the application. This interactive process guides you through database setup, application URL, and administrator details. ```Shell php artisan igniter:install ``` -------------------------------- ### Setup Composer for Development Source: https://tastyigniter.com/docs/resources/contribution-guide Configure Composer to accept unstable releases and install project dependencies. This involves modifying the composer.json file and running installation commands. ```json { "minimum-stability": "dev" } ``` ```shell composer install ``` ```shell composer update "tastyigniter/*" --prefer-source ``` -------------------------------- ### Run TastyIgniter Installation Wizard Source: https://tastyigniter.com/docs/3.x/installation Execute the `php artisan igniter:install` command after project creation to run the interactive installation wizard. It prompts for essential configurations like database connection details, application URL, and administrator credentials. ```shell php artisan igniter:install ``` -------------------------------- ### TastyIgniter Upgrade Guide Source: https://tastyigniter.com/docs/3.x/advanced/scheduling-tasks Instructions for upgrading TastyIgniter installations from one version to another. ```APIDOC Upgrade Guide: - Steps for upgrading TastyIgniter core. - Handling database schema changes. - Updating dependencies and extensions. - Backward compatibility considerations. ``` -------------------------------- ### Install Pay Register Extension Source: https://tastyigniter.com/docs/extensions/payregister Installs the Pay Register extension via Composer and runs necessary database migrations to set up the extension. ```shell composer require tastyigniter/ti-ext-pages -W ``` ```shell php artisan igniter:up ``` -------------------------------- ### Clean up TastyIgniter Setup Files Source: https://tastyigniter.com/docs/3.x/installation After a successful installation, particularly when using the setup wizard, it is recommended to manually delete the setup files and directory for security reasons. This prevents unauthorized access to installation scripts. ```shell rm -rf setup/ rm -f setup.php ``` -------------------------------- ### Install Visitor Tracker Extension Source: https://tastyigniter.com/docs/extensions/visitortracker Installs the Visitor Tracker extension for TastyIgniter using Composer. The `-W` flag ensures all dependencies are installed. ```bash composer require igniterlabs/ti-ext-visitortracker -W ``` -------------------------------- ### Install Frontend Extension Source: https://tastyigniter.com/docs/extensions/frontend Installs the TastyIgniter Frontend extension using Composer. The `-W` flag ensures all dependencies are updated. ```bash composer require tastyigniter/ti-ext-frontend -W ``` -------------------------------- ### Install TastyIgniter Stand-alone via Composer Source: https://tastyigniter.com/docs/installation Installs the TastyIgniter platform as a new project using Composer. This command creates a new directory named 'tastyigniter' and downloads all necessary dependencies for a stand-alone installation. ```Shell composer create-project tastyigniter/tastyigniter tastyigniter ``` -------------------------------- ### File-Based Configuration Example Source: https://tastyigniter.com/docs/extend/extensions An example of a configuration file located within an extension's 'config' subdirectory. This file returns a PHP array containing configuration parameters, such as boolean flags or integer values. ```PHP true, 'cartSessionTtl' => 120 ]; ``` -------------------------------- ### Install TastyIgniter API Extension Source: https://tastyigniter.com/docs/extensions/api Installs the TastyIgniter API extension using Composer. The `-W` flag ensures all dependencies are installed, including optional ones. ```shell composer require tastyigniter/ti-ext-api -W ``` -------------------------------- ### Example Payment Gateway Class Implementation Source: https://tastyigniter.com/docs/3.x/extensions/payregister Provides an example of a payment gateway class that extends the base payment gateway. It includes methods for checking applicability based on order total and processing the payment form submission. ```php classCodextendsBasePaymentGateway { /** * Returns true if the payment type is applicable for a specified invoice amount * */ publicfunctionisApplicable($total, $host) { return $host->order_total <= $total; } /** * Processes payment using passed data. * * @paramarray $data * @param\Admin\Models\Payments_model $host * @param\Admin\Models\Orders_model $order * * @throws\Igniter\Flame\Exception\ApplicationException */ publicfunctionprocessPaymentForm($data, $host, $order) { if (!$paymentMethod = $order->payment) thrownewApplicationException('Payment method not found'); if (!$this->isApplicable($order->order_total, $host)) thrownewApplicationException(sprintf( lang('igniter.payregister::default.alert_min_order_total'), currency_format($host->order_total), $host->name )); $order->updateOrderStatus($host->order_status, ['notify'=>FALSE]); $order->markAsPaymentProcessed(); } } ``` -------------------------------- ### Install TastyIgniter using Composer Source: https://tastyigniter.com/docs/3.x/installation Use the `composer create-project` command to install TastyIgniter and its dependencies. This command sets up the project in a specified directory, creating a new project named 'mytasty' with the latest 3.7 version. ```shell composer create-project tastyigniter/tastyigniter:^3.7 mytasty ``` -------------------------------- ### Nginx Configuration for TastyIgniter Source: https://tastyigniter.com/docs/installation Provides the necessary Nginx configuration to serve a TastyIgniter application. This includes including the main configuration file and a complete server block example for a typical setup. ```nginx include /path/to/tastyigniter/.nginx.conf; ``` ```nginx server { listen 80; root /path/to/tastyigniter; index index.php; server_name mytastysite.com; gzip on; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css application/x-javascript application/json application/javascript image/x-icon image/png image/gif image/jpeg image/svg+xml; charset utf-8; access_log off; include /path/to/tastyigniter/.nginx.conf; } ``` -------------------------------- ### Install Automation Extension via Composer Source: https://tastyigniter.com/docs/extensions/automation Installs the TastyIgniter Automation extension using Composer. This command adds the extension to your project's dependencies and prepares it for installation. ```shell composer require tastyigniter/ti-ext-automation -W ``` -------------------------------- ### Install TastyIgniter v4.0 Source: https://tastyigniter.com/docs/upgrade-guide Command to create a new TastyIgniter v4.0 project using Composer. This is the first step in setting up the new version. ```bash composer create-project tastyigniter/tastyigniter mytasty-new ``` -------------------------------- ### Database Migration Example Source: https://tastyigniter.com/docs/extend/extensions An example of a database migration file for creating a table. It follows the standard Laravel migration structure, defining the `up` method to create the table schema and the `down` method to drop it. ```PHP use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up() { Schema::create('acme_helloworld_messages', function (Blueprint $table) { $table->increments('id'); $table->string('subject'); $table->text('message'); $table->timestamps(); }); } public function down() { Schema::dropIfExists('acme_helloworld_messages'); } }; ``` -------------------------------- ### Install Reservation Extension Source: https://tastyigniter.com/docs/extensions/reservation Installs the TastyIgniter Reservation extension using Composer and applies necessary database migrations via Artisan. ```bash composer require tastyigniter/ti-ext-reservation -W ``` ```bash php artisan igniter:up ``` -------------------------------- ### Run Database Migrations Source: https://tastyigniter.com/docs/extensions/coupons Executes database migrations to create the necessary tables for the Coupons extension. This command is essential after installation. ```bash php artisan igniter:up ``` -------------------------------- ### Perform Unattended TastyIgniter Installation Source: https://tastyigniter.com/docs/3.x/installation Run the `php artisan igniter:install --no-interaction` command for automated installations. This bypasses interactive prompts by utilizing configurations from the project's `.env` file, making it suitable for CI/CD pipelines and automated environments. ```shell php artisan igniter:install --no-interaction ``` -------------------------------- ### Install TastyIgniter Local Extension Source: https://tastyigniter.com/docs/extensions/local Installs the TastyIgniter Local extension via Composer. The `-W` flag ensures all dependencies are updated. ```shell composer require tastyigniter/ti-ext-local -W ``` -------------------------------- ### Install SEO Manager Extension Source: https://tastyigniter.com/docs/extensions/seomanager Installs the TastyIgniter SEO Manager extension using Composer after configuring repositories and authentication. ```bash composer require igniterlabs/ti-ext-seomanager -W ``` -------------------------------- ### Install S3 Flysystem Dependency Source: https://tastyigniter.com/docs/customize/media-manager Installs the necessary Flysystem adapter for AWS S3 v3 via Composer, enabling integration with S3-compatible storage services. ```Shell composer require league/flysystem-aws-s3-v3 "^3.0" --with-all-dependencies ``` -------------------------------- ### File-Based Configuration Example Source: https://tastyigniter.com/docs/3.x/extend/extensions Shows the structure of a file-based configuration file for an extension. This PHP script returns an array of configuration settings. ```php true, 'cartSessionTtl' => 120 ]; ``` -------------------------------- ### Run TastyIgniter Unattended Setup Source: https://tastyigniter.com/docs/installation Executes the TastyIgniter command-line setup tool in unattended mode for automated environments like Docker. All configuration options must be pre-defined in the project's .env file. ```Shell php artisan igniter:install --no-interaction ``` -------------------------------- ### Install Postmark Dependencies Source: https://tastyigniter.com/docs/advanced/mail Installs the necessary Symfony Postmark Mailer and HTTP client components for using the Postmark driver. This is a prerequisite for sending emails via Postmark. ```Shell composer require symfony/postmark-mailer symfony/http-client ``` -------------------------------- ### Copy Assets Media Directory Source: https://tastyigniter.com/docs/upgrade-guide Command to copy the assets/media directory from the old installation to the storage directory in the new installation to preserve media files. ```bash cp assets/media storage/ ``` -------------------------------- ### TastyIgniter Themes Guide Source: https://tastyigniter.com/docs/3.x/advanced/scheduling-tasks Information on developing and customizing themes for the TastyIgniter platform. ```APIDOC Themes: - Structure of a TastyIgniter theme. - Creating theme assets (views, CSS, JS). - Theme configuration and options. - Applying themes to the application. ``` -------------------------------- ### Nginx Server Block Configuration Example Source: https://tastyigniter.com/docs/3.x/installation An example of an Nginx server block configuration that includes the TastyIgniter-specific Nginx configuration file and sets up common directives like gzip and charset. ```nginx server { listen 80; root /path/to/tastyigniter; index index.php; server_name mytastysite.com; gzip on; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css application/x-javascript application/json application/javascript image/x-icon image/png image/gif image/jpeg image/svg+xml; charset utf-8; access_log off; include /path/to/tastyigniter/.nginx.conf; } ``` -------------------------------- ### Copy Configuration File Source: https://tastyigniter.com/docs/upgrade-guide Command to copy the existing .env configuration file from the old installation to the new one to ensure smooth configuration. ```bash cp mytasty/.env mytasty-new/ ``` -------------------------------- ### Install Stripe Connect Extension Source: https://tastyigniter.com/docs/extensions/stripe-connect Installs the TastyIgniter Stripe Connect extension using Composer. The `-W` flag ensures that dependencies are updated to their latest compatible versions. ```shell composer require igniterlabs/ti-ext-stripeconnect -W ``` -------------------------------- ### Extension Language File Example Source: https://tastyigniter.com/docs/extend/extensions An example of a language file (`default.php`) used for localization within an extension. It returns an array of language strings. ```php return [ 'label' => 'Hello World', 'description' => 'Say hello to the rest of the world.', ]; ``` -------------------------------- ### TastyIgniter Contribution Guide Source: https://tastyigniter.com/docs/3.x/advanced/scheduling-tasks Guidelines for developers who wish to contribute to the TastyIgniter project. ```APIDOC Contribution Guide: - How to set up a development environment. - Branching strategy and pull request process. - Coding standards and best practices for contributions. - Reporting bugs and suggesting features. ``` -------------------------------- ### TastyIgniter Controller Guide Source: https://tastyigniter.com/docs/3.x/advanced/scheduling-tasks Documentation on creating and using controllers within the TastyIgniter MVC architecture. ```APIDOC Controllers: - Role of controllers in handling requests and responses. - Creating controller classes and methods. - Passing data to views. - Interacting with models and services. ``` -------------------------------- ### Composer Authentication Setup Source: https://tastyigniter.com/docs/extensions/seomanager Creates an auth.json file to provide your TastyIgniter Marketplace credentials (email and carte key) for Composer authentication. ```json { "http-basic": { "satis.tastyigniter.com": { "username": "your-tastyigniter-account-email-address", "password": "your-tastyigniter-site-carte-key" } } } ``` -------------------------------- ### Nginx Server Block Example Source: https://tastyigniter.com/docs/master/installation An example of a complete Nginx server block configuration for hosting a TastyIgniter site. It includes directives for listening port, root directory, index files, server name, gzip compression, character set, and includes the application's specific Nginx configuration. ```nginx server { listen 80; root /path/to/tastyigniter; index index.php; server_name mytastysite.com; gzip on; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css application/x-javascript application/json application/javascript image/x-icon image/png image/gif image/jpeg image/svg+xml; charset utf-8; access_log off; include /path/to/tastyigniter/.nginx.conf; } ``` -------------------------------- ### PHP Facade Usage Source: https://tastyigniter.com/docs/resources/php-coding-guidelines Illustrates the correct way to use facades in PHP by referencing their fully qualified class names. The 'Good' example uses the complete namespace, promoting clarity and avoiding potential naming conflicts, whereas the 'Bad' example uses a shortened alias. ```php use Illuminate\Support\Facades\Config; ``` ```php use Config; ``` -------------------------------- ### Attach Component to Page/Layout Source: https://tastyigniter.com/docs/extend/components Example of attaching a component to a page or layout using front-matter configuration, including setting properties. ```yaml --- title: My first page permalink: "/page" '[helloBlock]': maxItems: 20 --- ``` -------------------------------- ### TastyIgniter Partials Guide Source: https://tastyigniter.com/docs/3.x/advanced/scheduling-tasks How to use and create partials for reusable view components in TastyIgniter. ```APIDOC Partials: - Creating reusable view snippets. - Including partials in main views. - Passing data to partials. - Benefits for code organization and DRY principle. ``` -------------------------------- ### TastyIgniter Layouts Guide Source: https://tastyigniter.com/docs/3.x/advanced/scheduling-tasks Documentation on defining and using layout templates for consistent page structure in TastyIgniter. ```APIDOC Layouts: - Creating master layouts for consistent page structure. - Defining content sections within layouts. - Rendering views within layout placeholders. - Example of a base layout file. ``` -------------------------------- ### Register Theme Page Menu Item Type Example Source: https://tastyigniter.com/docs/extensions/pages Provides a concrete example of registering a 'theme-page' menu item type and its associated information and resolution logic within the Pages extension. ```PHP Event::listen('pages.menuitem.listTypes', function () { return [ 'theme-page'=>'igniter::main.pages.text_theme_page', ]; }); Event::listen('pages.menuitem.getTypeInfo', function ($type) { returnPage::getMenuTypeInfo((string)$type); }); Event::listen('pages.menuitem.resolveItem', function ($item, $url, $theme) { if ($item->type =='theme-page'&& $theme) { returnPage::resolveMenuItem($item, $url, $theme); } }); ``` -------------------------------- ### Database Seeder Example Source: https://tastyigniter.com/docs/extend/extensions Demonstrates how to create a seeder file to populate database tables with sample data for an extension. Includes the namespace, class definition, and the run method for inserting data. ```php namespace Acme\HelloWorld\Database\Seeds; use Illuminate\Database\Seeder; class MessagesTableSeeder extends Seeder { public function run() { DB::table('acme_helloworld_messages')->insert([ 'subject' => 'Hello World', 'message' => 'Welcome to the world of TastyIgniter!', ]); } } ``` -------------------------------- ### Run Database Migrations Source: https://tastyigniter.com/docs/extensions/webhook After installation, run the Artisan command to apply the necessary database migrations for the Webhooks extension. ```php php artisan igniter:up ``` -------------------------------- ### Set up API Database Tables and Tokens Source: https://tastyigniter.com/docs/extensions/api Installs Laravel Sanctum and sets up necessary database tables and a personal access client for API authentication. This is an Artisan command for Laravel-based applications. ```php php artisan install:api ``` -------------------------------- ### Consume API Endpoints Source: https://tastyigniter.com/docs/extensions/api Demonstrates how to interact with the TastyIgniter API using cURL to retrieve resources. This example shows fetching all menu items via a GET request. ```shell curl -X GET https://your-tastyigniter-site.com/api/menus ``` -------------------------------- ### Access Component Property Value Source: https://tastyigniter.com/docs/extend/components Provides examples of how to retrieve component property values from within the component class, including getting a single value, a value with a default, or all properties. ```php // Get a single value $maxItems =$this->property('maxItems'); // Get a value and return a default value if it doesn't exist $maxItems =$this->property('maxItems', 8); // Get all properties as array $properties =$this->getProperties(); ``` -------------------------------- ### Using API Tokens Source: https://tastyigniter.com/docs/3.x/extensions/api Tokens should be passed in the `Authorization` header with every request to a restricted endpoint. This example shows how to make a GET request to the orders API with the necessary authorization header. ```curl curl -i -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer your-api-token" https://your.url/api/orders ``` -------------------------------- ### Handle AJAX Requests with Controller Methods Source: https://tastyigniter.com/docs/extend/controllers Defines controller methods that start with 'on' to process AJAX requests. These handlers can return data, throw exceptions, or redirect. The example shows a basic handler and how to trigger it from a view using data attributes. ```php publicfunctiononAction() { if (Request::input('someVar') !='someValue') { thrownewApplicationException('Invalid value'); } return ['data'=>'value']; } ``` ```html ``` -------------------------------- ### Run Database Migrations Source: https://tastyigniter.com/docs/extensions/frontend Applies the necessary database migrations for the Frontend extension to create required tables. ```bash php artisan igniter:up ``` -------------------------------- ### Install Socialite Extension Source: https://tastyigniter.com/docs/extensions/socialite Installs the TastyIgniter Socialite extension using Composer. The `-W` flag ensures compatible versions are installed. ```Shell composer require tastyigniter/ti-ext-socialite -W ``` -------------------------------- ### Install TastyIgniter User Extension Source: https://tastyigniter.com/docs/extensions/user Installs the TastyIgniter User extension via Composer. The -W flag ensures the latest stable version is installed. ```shell composer require tastyigniter/ti-ext-user -W ``` -------------------------------- ### TastyIgniter Core Documentation Sections Source: https://tastyigniter.com/docs/3.x/customize/pages A list of main documentation categories for TastyIgniter, covering initial setup, development guidelines, and system customization. ```APIDOC Core Documentation Sections: Getting Started: - Installation - Code Of Conduct - Upgrade Guide - Contribution Guide - PHP Coding Guidelines - Javascript Coding Guidelines Customize: - Themes - Pages - Layouts - Partials - Components - Media files - Permissions - Markup Guide Extend: - Form Requests - Extensions - Building a Component - Controllers - Creating a Widget Advanced: - Localization - Mail - Routing - Handling AJAX Requests - Scheduling Automated Tasks - Testing TastyIgniter ``` -------------------------------- ### Account Component - Account Details Page Source: https://tastyigniter.com/docs/3.x/extensions/user Shows how to set up a page for account details using the Account component. It includes frontmatter for page configuration and the component registration within the template. ```php --- title: 'Account Details' permalink: /account '[account]': { } --- ... @component('account') ... ``` -------------------------------- ### Install SMS Notify Extension via Composer Source: https://tastyigniter.com/docs/extensions/smsnotify Installs the TastyIgniter SMS Notify extension using Composer. This command adds the extension to your project's dependencies and prepares it for installation. ```bash composer require igniterlabs/ti-ext-smsnotify -W ``` -------------------------------- ### Install TastyIgniter Stand-alone Source: https://tastyigniter.com/docs/master/installation Use this Composer command to create a new TastyIgniter project in a specified directory. It downloads the latest version and sets up the project structure with all necessary dependencies for a stand-alone application. ```Composer composer create-project tastyigniter/tastyigniter tastyigniter ``` -------------------------------- ### Install TastyIgniter Cart Extension Source: https://tastyigniter.com/docs/extensions/cart Installs the TastyIgniter Cart extension using Composer. This command fetches and installs the latest version of the extension and its dependencies, including development versions if specified. ```bash composer require tastyigniter/ti-ext-cart -W ``` -------------------------------- ### Development Setup with Composer Path Repositories Source: https://tastyigniter.com/docs/3.x/contribution-guide Sets up the TastyIgniter project by cloning repositories and configuring Composer to use local packages via path repositories. This allows for development on core packages. ```shell git clone https://github.com/tastyigniter/TastyIgniter.git cd TastyIgniter # Set up a Composer path repository for TastyIgniter packages composer config repositories.0 path "packages/*" git clone https://github.com/tastyigniter/flame.git packages/flame git clone https://github.com/tastyigniter/ti-ext-frontend.git packages/frontend # etc # Adjust minimum-stability in composer.json to "dev" composer install ``` -------------------------------- ### Component Usage Example Source: https://tastyigniter.com/docs/3.x/extensions/frontend Demonstrates how to register and use various frontend components within a TastyIgniter page or layout, including configuration options. ```php --- '[banners bannerOne]': banner_id: 1 width: 960 height: 360 '[banners bannerTwo]': banner_id: 2 width: 960 height: 360 '[banners bannerThree]': banner_id: 3 width: 960 height: 360 --- ... @component('bannerOne') @component('bannerTwo') @component('bannerThree') ... ``` ```php --- title: 'Contact' permalink: /contact '[contact]': --- ... @component('contact') ... ``` -------------------------------- ### Naming Convention Examples (Controllers, Routes, Models) Source: https://tastyigniter.com/docs/resources/php-coding-guidelines Illustrates recommended naming conventions for Controllers (plural), Routes (plural), and Models (singular) in PHP applications. ```PHP // Controller ArticlesController // Good ArticleController // Bad // Route articles/1 // Good article/1 // Bad // Model User // Good Users // Bad ``` -------------------------------- ### Install Webhooks Extension Source: https://tastyigniter.com/docs/extensions/webhook Install the TastyIgniter Webhooks extension using Composer. The `-W` flag ensures that dependencies are also updated. ```php composer require igniterlabs/ti-ext-webhook -W ``` -------------------------------- ### Naming Convention Examples (Collections, Objects, Config/View Files) Source: https://tastyigniter.com/docs/resources/php-coding-guidelines Covers naming conventions for collections (descriptive, plural), objects (descriptive, singular), config/language file indexes (snake_case), and view/config file names (kebab-case). ```PHP // Collection $activeUsers = User::active()->get() // Good $active, $data // Bad // Object $activeUser = User::active()->first() // Good $users, $obj // Bad // Config and language files index articles_enabled // Good ArticlesEnabled, articles-enabled // Bad // View file name show-filtered.blade.php // Good showFiltered.blade.php, show_filtered.blade.php // Bad // Config file name google-calendar.php // Good googleCalendar.php, google_calendar.php // Bad ``` -------------------------------- ### Install Coupons Extension Source: https://tastyigniter.com/docs/extensions/coupons Installs the TastyIgniter Coupons extension via Composer. This command adds the extension to your project's dependencies. ```bash composer require tastyigniter/ti-ext-coupons -W ``` -------------------------------- ### Replace Old Installation with New Source: https://tastyigniter.com/docs/upgrade-guide Commands to replace the old TastyIgniter installation directory with the newly upgraded one. This involves renaming directories. ```bash cd .. mv mytasty mytasty-old mv mytasty-new mytasty ``` -------------------------------- ### Run Database Migrations Source: https://tastyigniter.com/docs/extensions/visitortracker Executes the necessary database migrations to create tables required by the Visitor Tracker extension using the TastyIgniter Artisan command. ```bash php artisan igniter:up ``` -------------------------------- ### Install Amazon SES Dependencies Source: https://tastyigniter.com/docs/advanced/mail Installs the AWS SDK for PHP, which is required to enable sending emails via the Amazon SES driver. ```Shell composer require aws/aws-sdk-php ``` -------------------------------- ### TastyIgniter Testing Guide Source: https://tastyigniter.com/docs/3.x/advanced/scheduling-tasks Guidance on how to write and run tests for TastyIgniter applications, covering unit, feature, and integration testing. ```APIDOC Testing TastyIgniter: - Setting up a testing environment. - Writing unit tests for classes and methods. - Performing feature tests that simulate user interactions. - Using testing frameworks and tools compatible with TastyIgniter. ``` -------------------------------- ### Run Database Migrations Source: https://tastyigniter.com/docs/extensions/user Executes Artisan commands to set up the necessary database tables for the User extension. ```shell php artisan igniter:up ``` -------------------------------- ### Install Orange Theme via Composer Source: https://tastyigniter.com/docs/themes/orange Installs the TastyIgniter Orange theme using Composer. This command downloads and sets up the theme in your TastyIgniter project. ```shell composer require tastyigniter/ti-theme-orange -W ``` -------------------------------- ### PHP Syntax: Using Helpers Instead of Facades Source: https://tastyigniter.com/docs/3.x/php-coding-guidelines Illustrates how to replace common Laravel facade syntax with more concise helper functions for improved readability and shorter code. ```php Common syntax | Shorter and more readable syntax ---|--- `Session::get('foo')` | `session('foo')` `$request->session()->get('foo')` | `session('foo')` `Session::put('foo', $data)` | `session(['foo' => $data])` `$request->input('name'),Request::get('name')` | `$request->name,request('name')` `return Redirect::back()` | `return redirect()->back()` `is_null($object->relation) ? $object->relation->id : null;` | `optional($object->relation)->id` `return view('index')->with('title', $title)->with('client', $client)` | `return view('index', compact('title', 'client'))` `$request->has('value') ? $request->value : 'default';` | `$request->get('value','default')` `Carbon::now(), Carbon::today()` | `now(), today()` `App::make('Class')` | `app('Class')` `->where('column', '=', 1)` | `->where('column', 1)` `->orderBy('created_at', 'desc')` | `->latest()` `->orderBy('age', 'desc')` | `->latest('age')` `->orderBy('created_at', 'asc')` | `->oldest()` `->select('id', 'name')->get()` | `->get(['id', 'name'])` `->first()->name` | `->value('name')` ``` -------------------------------- ### Install Debugbar Extension via Composer Source: https://tastyigniter.com/docs/extensions/debugbar Installs the Debugbar extension for TastyIgniter using Composer. This is the primary method for adding the debugging capabilities to your project. ```Shell composer require tastyigniter/ti-debugbar -W ``` -------------------------------- ### Redirect Syntax Source: https://tastyigniter.com/docs/resources/php-coding-guidelines Illustrates the preferred, shorter syntax for redirecting back using the `redirect()` helper compared to the `Redirect` facade. ```PHP return Redirect::back() // becomes return redirect()->back() ``` -------------------------------- ### Install Broadcast Extension Source: https://tastyigniter.com/docs/extensions/broadcast Install the TastyIgniter Broadcast extension via Composer. This command adds the extension to your project and may trigger post-install scripts. ```bash composer require tastyigniter/ti-ext-broadcast -W ``` -------------------------------- ### Backup MySQL Database Source: https://tastyigniter.com/docs/upgrade-guide Command to create a backup of your MySQL database. It prompts for the password and saves the output to a .sql file. ```bash mysqldump -u root -p database_name > tastyigniter_backup.sql ``` -------------------------------- ### Install TastyIgniter Pages Extension via Composer Source: https://tastyigniter.com/docs/extensions/pages Installs the TastyIgniter Pages extension using Composer. This command adds the extension package to your project dependencies. ```shell composer require tastyigniter/ti-ext-pages -W ``` -------------------------------- ### Session Helper Syntax Source: https://tastyigniter.com/docs/resources/php-coding-guidelines Shows how to use the `session()` helper function for getting and setting session data, offering a cleaner alternative to facade usage. ```PHP Session::get('foo') // becomes session('foo') Session::put('foo', $data) // becomes session(['foo' => $data]) ``` -------------------------------- ### Install Mailgun Dependencies Source: https://tastyigniter.com/docs/advanced/mail Installs the necessary Symfony Mailgun Mailer and HTTP client components for using the Mailgun driver. This is a prerequisite for sending emails via Mailgun. ```Shell composer require symfony/mailgun-mailer symfony/http-client ``` -------------------------------- ### Collection Usage Example Source: https://tastyigniter.com/docs/3.x/php-coding-guidelines Leverage Laravel Collections for cleaner and more expressive data manipulation compared to traditional PHP arrays. This example demonstrates using `firstWhere` for efficient searching. ```PHP $collection =collect([ ['name'=>'Regena', 'age'=>null], ['name'=>'Linda', 'age'=>14], ['name'=>'Diego', 'age'=>23], ['name'=>'Linda', 'age'=>84], ]); $collection->firstWhere('name', 'Linda'); ``` -------------------------------- ### Run Database Migrations Source: https://tastyigniter.com/docs/extensions/seomanager Executes Artisan commands to run database migrations, creating necessary tables for the SEO Manager extension. ```bash php artisan igniter:up ``` -------------------------------- ### Unattended TastyIgniter Installation Source: https://tastyigniter.com/docs/master/installation Performs an unattended installation of TastyIgniter, suitable for automated environments like Docker. Configuration options are provided via the .env file and the --no-interaction flag. ```php php artisan igniter:install --no-interaction ``` -------------------------------- ### Whitespace: Braces Formatting Source: https://tastyigniter.com/docs/3.x/php-coding-guidelines Specifies that no extra empty lines should be added between curly braces `{}`. The 'Good' example shows correct formatting, while the 'Bad' example includes an unnecessary empty line. ```php if ($foo) { $this->foo = $foo; } ``` ```php if ($foo) { $this->foo = $foo; } ``` -------------------------------- ### Basic Extension Registration File Source: https://tastyigniter.com/docs/3.x/extend/extensions Example of an `Extension.php` file structure for TastyIgniter extensions, defining the extension class, metadata, and basic registration/boot methods. It extends `SystemClassesBaseExtension`. ```PHP namespace Acme\HelloWord; class Extension extends \System\Classes\BaseExtension { public function extensionMeta() { return [ 'name' => 'The extension name', 'author' => 'The extension author name', 'description' => 'The extension description', 'icon' => 'The extension icon. Any FontAwesome icon name, for example: `fa-puzzle-piece`', ]; } public function register() { } public function boot() { } } ``` -------------------------------- ### Install Language Pack via CLI Source: https://tastyigniter.com/docs/advanced/localization Installs a language pack directly from the TastyIgniter Crowdin project page using the `igniter:language-install` Artisan command. Specify the language code as an argument. ```php php artisan igniter:language-install es ``` -------------------------------- ### Cart Library Event Listener Example Source: https://tastyigniter.com/docs/3.x/extensions/cart Shows how to hook into global events fired by the TastyIgniter Cart Library to perform actions when cart events occur. This example listens for the 'cart.updated' event. ```php Event::listen('cart.updated', function($cartItem) { // ... }); ``` -------------------------------- ### Naming Convention Examples (Tables, Keys, Columns) Source: https://tastyigniter.com/docs/resources/php-coding-guidelines Details naming conventions for database tables (plural), pivot tables (singular model names), table columns (snake_case), and foreign keys (singular_id). ```PHP // Table article_comments // Good article_comment, articleComments // Bad // Pivot table article_user // Good articles_users // Bad // Table column meta_title // Good MetaTitle, article_meta_title // Bad // Foreign key article_id // Good ArticleId, id_article, articles_id // Bad ``` -------------------------------- ### Install TastyIgniter Package for Laravel Source: https://tastyigniter.com/docs/master/installation Add TastyIgniter as a dependency to an existing Laravel application using this Composer command. It installs the core package and integrates it into your project, allowing you to leverage its features within your Laravel environment. ```Composer composer require tastyigniter/core ``` -------------------------------- ### Whitespace: Blank Lines Between Statements Source: https://tastyigniter.com/docs/3.x/php-coding-guidelines Advises on the use of blank lines to separate logical blocks of code, enhancing readability. The 'Good' example shows proper spacing, while the 'Bad' example illustrates code that is too cramped. ```php publicfunctiongetPage($url) { $page =$this->pages()->where('slug', $url)->first(); if (!$page) returnnull; if ($page['private'] &&!Auth::check()) returnnull; return $page; } ``` ```php // Everything's cramped together. publicfunctiongetPage($url) { $page =$this->pages()->where('slug', $url)->first(); if (!$page) returnnull; if ($page['private'] &&!Auth::check()) returnnull; return $page; } ``` -------------------------------- ### Comment Formatting: Single and Multi-line Source: https://tastyigniter.com/docs/3.x/php-coding-guidelines Provides guidelines for formatting comments in PHP. Single-line comments should have a space before the '//', and multi-line comments should start with a single asterisk on the first line, with subsequent lines also starting with an asterisk. ```php // There should be a space before a single line comment. ``` ```php /* * If you need to explain a lot you can use a comment block. Notice the * single * on the first line. Comment blocks don't need to be three * lines long or three characters shorter than the previous line. */ ```