From f447ace5ba549c92222fba348c01a79aa7037ba0 Mon Sep 17 00:00:00 2001 From: devansh-webkul Date: Wed, 23 Oct 2024 08:17:17 +0000 Subject: [PATCH] deploy: 564848c4254bf9c5b4b807e57ebf7d9f70c52b2c --- 1.x/advanced/email-inbound-parse.html | 6 +- 1.x/advanced/events.html | 6 +- 1.x/advanced/helpers.html | 6 +- 1.x/advanced/index.html | 6 +- 1.x/advanced/override-core-model.html | 6 +- 1.x/advanced/render-event.html | 6 +- 1.x/advanced/security-practice.html | 6 +- 1.x/api/getting-started-with-the-api.html | 6 +- 1.x/api/index.html | 6 +- 1.x/architecture/index.html | 6 +- 1.x/architecture/modular-design.html | 6 +- 1.x/architecture/packages.html | 6 +- 1.x/architecture/repository-pattern.html | 6 +- 1.x/architecture/theme.html | 6 +- 1.x/custom-attributes/custom-attribute.html | 6 +- 1.x/custom-attributes/index.html | 6 +- 1.x/custom-attributes/uses.html | 6 +- 1.x/introduction/index.html | 6 +- 1.x/introduction/installation.html | 6 +- 1.x/introduction/requirements.html | 6 +- 1.x/packages/add-menu-in-admin.html | 6 +- 1.x/packages/assets.html | 6 +- 1.x/packages/controllers.html | 6 +- 1.x/packages/create-acl.html | 6 +- 1.x/packages/create-migrations.html | 6 +- 1.x/packages/create-models.html | 6 +- 1.x/packages/create-package.html | 6 +- 1.x/packages/datagrid.html | 6 +- 1.x/packages/index.html | 6 +- 1.x/packages/layouts.html | 6 +- 1.x/packages/localization.html | 6 +- 1.x/packages/routes.html | 6 +- .../store-data-through-repositories.html | 6 +- 1.x/packages/validation.html | 6 +- 1.x/packages/views.html | 6 +- 2.0/advanced/email-inbound-parse.html | 6 +- 2.0/advanced/events.html | 6 +- 2.0/advanced/helpers.html | 6 +- 2.0/advanced/index.html | 6 +- 2.0/advanced/override-core-model.html | 6 +- 2.0/advanced/render-event.html | 6 +- 2.0/advanced/security-practice.html | 6 +- 2.0/api/getting-started-with-the-api.html | 6 +- 2.0/api/index.html | 6 +- 2.0/architecture/index.html | 6 +- 2.0/architecture/modular-design.html | 6 +- 2.0/architecture/packages.html | 6 +- 2.0/architecture/repository-pattern.html | 6 +- 2.0/architecture/theme.html | 6 +- 2.0/custom-attributes/custom-attribute.html | 6 +- 2.0/custom-attributes/index.html | 6 +- 2.0/custom-attributes/uses.html | 6 +- 2.0/introduction/docker.html | 6 +- 2.0/introduction/index.html | 6 +- 2.0/introduction/installation.html | 6 +- 2.0/introduction/requirements.html | 6 +- 2.0/packages/add-menu-in-admin.html | 6 +- 2.0/packages/assets.html | 6 +- 2.0/packages/blade-components.html | 6 +- 2.0/packages/controllers.html | 6 +- 2.0/packages/create-acl.html | 6 +- 2.0/packages/create-migrations.html | 6 +- 2.0/packages/create-models.html | 6 +- 2.0/packages/create-package.html | 35 +- 2.0/packages/datagrid.html | 6 +- 2.0/packages/index.html | 6 +- 2.0/packages/layouts.html | 6 +- 2.0/packages/localization.html | 6 +- 2.0/packages/routes.html | 6 +- .../store-data-through-repositories.html | 6 +- 2.0/packages/validation.html | 6 +- 2.0/packages/views.html | 6 +- 2.0/prologue/contribution-guide.html | 6 +- 2.0/prologue/index.html | 6 +- 2.0/prologue/upgrade-guide.html | 6 +- 404.html | 4 +- .../js/{101.ccf514f9.js => 101.77311efb.js} | 2 +- .../js/{102.2c20d1a1.js => 102.e1553a76.js} | 2 +- .../js/{103.fa757a15.js => 103.5fdc006a.js} | 2 +- .../js/{104.60bbc19f.js => 104.443c33a8.js} | 2 +- .../js/{105.3c2413ea.js => 105.f3225838.js} | 2 +- .../js/{106.d7ca6d28.js => 106.a874ea9f.js} | 2 +- .../js/{109.4302de35.js => 109.c1095c4b.js} | 2 +- .../js/{110.a0acb63a.js => 110.ff4f253d.js} | 2 +- .../js/{112.060eb159.js => 112.96c922c5.js} | 2 +- .../js/{113.1952d0bb.js => 113.06871f12.js} | 2 +- .../js/{114.906f86a5.js => 114.9c404adf.js} | 2 +- .../js/{115.603d5a7e.js => 115.4b20159c.js} | 2 +- .../js/{116.0128b721.js => 116.cae4d1e4.js} | 2 +- .../js/{118.fd058827.js => 118.06a3a421.js} | 2 +- .../js/{119.b7dd1a03.js => 119.28d77664.js} | 2 +- .../js/{120.71f16f74.js => 120.5c6d5bdd.js} | 2 +- .../js/{121.3f79ddd5.js => 121.90e73262.js} | 2 +- .../js/{122.3bc5152f.js => 122.aa694a53.js} | 2 +- .../js/{124.bedc3890.js => 124.15cf7ffc.js} | 2 +- .../js/{125.7f3b45f6.js => 125.467e2c39.js} | 2 +- .../js/{126.aaf2e112.js => 126.59293cc7.js} | 2 +- .../js/{128.fa93a2fc.js => 128.2273311e.js} | 2 +- .../js/{129.b9e06943.js => 129.a9d67c77.js} | 2 +- .../js/{130.7de71edb.js => 130.ce891b0c.js} | 2 +- .../js/{131.79f85e75.js => 131.3f4fa5bd.js} | 2 +- .../js/{132.c68df1dc.js => 132.da6ced46.js} | 2 +- .../js/{133.29a043da.js => 133.d09bb0e6.js} | 2 +- .../js/{134.e2bdba24.js => 134.4af1c4e7.js} | 2 +- .../js/{135.c50bd19f.js => 135.86b91b5b.js} | 2 +- .../js/{136.397269c4.js => 136.8bf40b8d.js} | 2 +- .../js/{137.91fb202f.js => 137.6b578a62.js} | 2 +- assets/js/{22.31867b2d.js => 22.ca1708f8.js} | 2 +- assets/js/{24.1f970c73.js => 24.b07e5381.js} | 2 +- assets/js/{25.1eadac28.js => 25.c26ea879.js} | 2 +- assets/js/{26.5a2fc6eb.js => 26.2fb60aac.js} | 2 +- assets/js/{27.17d4b244.js => 27.96e132ef.js} | 2 +- assets/js/{30.c60eef57.js => 30.a55bd7ed.js} | 2 +- assets/js/{32.1d6f5457.js => 32.75d1191b.js} | 2 +- assets/js/{33.0c49f96e.js => 33.14770f0d.js} | 2 +- assets/js/{34.53cfff09.js => 34.020bbe1f.js} | 2 +- assets/js/{35.3a0a62f7.js => 35.3c934e4c.js} | 2 +- assets/js/{36.9ed4a8da.js => 36.eada2958.js} | 2 +- assets/js/{37.535f0081.js => 37.7bcf94b4.js} | 2 +- assets/js/{38.090e1365.js => 38.096775e1.js} | 2 +- assets/js/{40.d825ba44.js => 40.766df907.js} | 2 +- assets/js/{41.5fc35e6c.js => 41.2ea7de2b.js} | 2 +- assets/js/{77.fd54eac8.js => 42.fd442319.js} | 2 +- assets/js/{48.49f3055a.js => 48.f053d15c.js} | 2 +- assets/js/{49.f1928147.js => 49.f5d98cf0.js} | 2 +- assets/js/50.6c157082.js | 1 - assets/js/{86.bb5486b6.js => 50.a2610b5b.js} | 2 +- assets/js/{88.4bab3fd2.js => 52.6d72598d.js} | 2 +- assets/js/{53.ee0b5001.js => 53.7d71b23e.js} | 2 +- assets/js/{55.aece2883.js => 55.8f737083.js} | 2 +- assets/js/{56.af355d1f.js => 56.f124d80f.js} | 2 +- assets/js/{57.d6e07b44.js => 57.b6a66119.js} | 2 +- assets/js/{58.8682472a.js => 58.93cb57f4.js} | 2 +- assets/js/{59.75e6dc8a.js => 59.263f9a81.js} | 2 +- assets/js/{60.33991b7f.js => 60.77d06899.js} | 2 +- assets/js/{61.f5c51a34.js => 61.1f35a85e.js} | 2 +- assets/js/{62.95404c2c.js => 62.b74fca29.js} | 2 +- assets/js/{63.c0682281.js => 63.54f8fae5.js} | 2 +- assets/js/{64.125f82aa.js => 64.718ed29b.js} | 2 +- assets/js/{65.87bd1508.js => 65.b66a97a3.js} | 2 +- assets/js/{68.9fe6752f.js => 68.f2e0e0a4.js} | 2 +- assets/js/{69.ec41dd9b.js => 69.b403f4b3.js} | 2 +- assets/js/{71.46ad926a.js => 71.4791ea33.js} | 2 +- assets/js/{72.cc46b533.js => 72.5203476d.js} | 2 +- assets/js/{73.f8bfbb5f.js => 73.b5e98758.js} | 2 +- assets/js/{75.6cea3a14.js => 75.c829b61b.js} | 2 +- assets/js/{76.4f1c67f7.js => 76.9092b0de.js} | 2 +- assets/js/{42.7fa39424.js => 77.0970e185.js} | 2 +- assets/js/{78.77d81075.js => 78.0be53998.js} | 2 +- assets/js/{79.535aa00d.js => 79.bba635c4.js} | 2 +- assets/js/{80.9636be31.js => 80.0a433807.js} | 2 +- assets/js/{82.830c1ccd.js => 82.d05c3f26.js} | 2 +- assets/js/{84.4f0b2bb7.js => 84.54b6f5a1.js} | 2 +- assets/js/{85.a920e252.js => 85.2a3d5a8a.js} | 2 +- assets/js/86.f56488fd.js | 1 + assets/js/{87.6edfe556.js => 87.91be584e.js} | 2 +- assets/js/{52.d94ee6e4.js => 88.317319ac.js} | 2 +- assets/js/{89.f3215088.js => 89.8f0dc9b2.js} | 2 +- assets/js/{90.da3b29cf.js => 90.5199bce8.js} | 2 +- assets/js/{93.e70b4764.js => 93.f9bd3968.js} | 2 +- assets/js/{94.711741af.js => 94.3ca207f4.js} | 2 +- .../js/{app.630c4e21.js => app.3c95b0aa.js} | 4 +- index.html | 4 +- master/advanced/data-transfer.html | 6 +- master/advanced/email-inbound-parse.html | 6 +- master/advanced/events.html | 6 +- master/advanced/helpers.html | 6 +- master/advanced/index.html | 6 +- master/advanced/override-core-model.html | 6 +- master/advanced/render-event.html | 6 +- master/advanced/security-practice.html | 6 +- master/api/getting-started-with-the-api.html | 6 +- master/api/index.html | 6 +- master/architecture/index.html | 6 +- master/architecture/modular-design.html | 6 +- master/architecture/packages.html | 6 +- master/architecture/repository-pattern.html | 6 +- master/architecture/theme.html | 6 +- .../custom-attributes/custom-attribute.html | 6 +- master/custom-attributes/index.html | 6 +- master/custom-attributes/uses.html | 6 +- master/introduction/docker.html | 6 +- master/introduction/index.html | 6 +- master/introduction/installation.html | 6 +- master/introduction/requirements.html | 6 +- master/packages/add-menu-in-admin.html | 6 +- master/packages/assets.html | 6 +- master/packages/blade-components.html | 6 +- master/packages/controllers.html | 6 +- master/packages/create-acl.html | 6 +- master/packages/create-migrations.html | 6 +- master/packages/create-models.html | 6 +- master/packages/create-package.html | 6 +- master/packages/datagrid.html | 6 +- master/packages/index.html | 6 +- master/packages/layouts.html | 6 +- master/packages/localization.html | 6 +- master/packages/routes.html | 6 +- .../store-data-through-repositories.html | 6 +- master/packages/validation.html | 6 +- master/packages/views.html | 6 +- master/prologue/contribution-guide.html | 6 +- master/prologue/index.html | 6 +- master/prologue/upgrade-guide.html | 6 +- service-worker.js | 576 +++++++++--------- 205 files changed, 753 insertions(+), 728 deletions(-) rename assets/js/{101.ccf514f9.js => 101.77311efb.js} (99%) rename assets/js/{102.2c20d1a1.js => 102.e1553a76.js} (99%) rename assets/js/{103.fa757a15.js => 103.5fdc006a.js} (99%) rename assets/js/{104.60bbc19f.js => 104.443c33a8.js} (99%) rename assets/js/{105.3c2413ea.js => 105.f3225838.js} (97%) rename assets/js/{106.d7ca6d28.js => 106.a874ea9f.js} (98%) rename assets/js/{109.4302de35.js => 109.c1095c4b.js} (99%) rename assets/js/{110.a0acb63a.js => 110.ff4f253d.js} (98%) rename assets/js/{112.060eb159.js => 112.96c922c5.js} (90%) rename assets/js/{113.1952d0bb.js => 113.06871f12.js} (99%) rename assets/js/{114.906f86a5.js => 114.9c404adf.js} (98%) rename assets/js/{115.603d5a7e.js => 115.4b20159c.js} (99%) rename assets/js/{116.0128b721.js => 116.cae4d1e4.js} (99%) rename assets/js/{118.fd058827.js => 118.06a3a421.js} (98%) rename assets/js/{119.b7dd1a03.js => 119.28d77664.js} (98%) rename assets/js/{120.71f16f74.js => 120.5c6d5bdd.js} (99%) rename assets/js/{121.3f79ddd5.js => 121.90e73262.js} (99%) rename assets/js/{122.3bc5152f.js => 122.aa694a53.js} (99%) rename assets/js/{124.bedc3890.js => 124.15cf7ffc.js} (99%) rename assets/js/{125.7f3b45f6.js => 125.467e2c39.js} (99%) rename assets/js/{126.aaf2e112.js => 126.59293cc7.js} (99%) rename assets/js/{128.fa93a2fc.js => 128.2273311e.js} (99%) rename assets/js/{129.b9e06943.js => 129.a9d67c77.js} (98%) rename assets/js/{130.7de71edb.js => 130.ce891b0c.js} (99%) rename assets/js/{131.79f85e75.js => 131.3f4fa5bd.js} (99%) rename assets/js/{132.c68df1dc.js => 132.da6ced46.js} (99%) rename assets/js/{133.29a043da.js => 133.d09bb0e6.js} (99%) rename assets/js/{134.e2bdba24.js => 134.4af1c4e7.js} (99%) rename assets/js/{135.c50bd19f.js => 135.86b91b5b.js} (99%) rename assets/js/{136.397269c4.js => 136.8bf40b8d.js} (99%) rename assets/js/{137.91fb202f.js => 137.6b578a62.js} (99%) rename assets/js/{22.31867b2d.js => 22.ca1708f8.js} (99%) rename assets/js/{24.1f970c73.js => 24.b07e5381.js} (99%) rename assets/js/{25.1eadac28.js => 25.c26ea879.js} (97%) rename assets/js/{26.5a2fc6eb.js => 26.2fb60aac.js} (99%) rename assets/js/{27.17d4b244.js => 27.96e132ef.js} (99%) rename assets/js/{30.c60eef57.js => 30.a55bd7ed.js} (99%) rename assets/js/{32.1d6f5457.js => 32.75d1191b.js} (98%) rename assets/js/{33.0c49f96e.js => 33.14770f0d.js} (96%) rename assets/js/{34.53cfff09.js => 34.020bbe1f.js} (98%) rename assets/js/{35.3a0a62f7.js => 35.3c934e4c.js} (99%) rename assets/js/{36.9ed4a8da.js => 36.eada2958.js} (98%) rename assets/js/{37.535f0081.js => 37.7bcf94b4.js} (87%) rename assets/js/{38.090e1365.js => 38.096775e1.js} (90%) rename assets/js/{40.d825ba44.js => 40.766df907.js} (99%) rename assets/js/{41.5fc35e6c.js => 41.2ea7de2b.js} (99%) rename assets/js/{77.fd54eac8.js => 42.fd442319.js} (98%) rename assets/js/{48.49f3055a.js => 48.f053d15c.js} (99%) rename assets/js/{49.f1928147.js => 49.f5d98cf0.js} (99%) delete mode 100644 assets/js/50.6c157082.js rename assets/js/{86.bb5486b6.js => 50.a2610b5b.js} (99%) rename assets/js/{88.4bab3fd2.js => 52.6d72598d.js} (98%) rename assets/js/{53.ee0b5001.js => 53.7d71b23e.js} (99%) rename assets/js/{55.aece2883.js => 55.8f737083.js} (99%) rename assets/js/{56.af355d1f.js => 56.f124d80f.js} (99%) rename assets/js/{57.d6e07b44.js => 57.b6a66119.js} (99%) rename assets/js/{58.8682472a.js => 58.93cb57f4.js} (97%) rename assets/js/{59.75e6dc8a.js => 59.263f9a81.js} (99%) rename assets/js/{60.33991b7f.js => 60.77d06899.js} (99%) rename assets/js/{61.f5c51a34.js => 61.1f35a85e.js} (99%) rename assets/js/{62.95404c2c.js => 62.b74fca29.js} (99%) rename assets/js/{63.c0682281.js => 63.54f8fae5.js} (99%) rename assets/js/{64.125f82aa.js => 64.718ed29b.js} (97%) rename assets/js/{65.87bd1508.js => 65.b66a97a3.js} (98%) rename assets/js/{68.9fe6752f.js => 68.f2e0e0a4.js} (99%) rename assets/js/{69.ec41dd9b.js => 69.b403f4b3.js} (98%) rename assets/js/{71.46ad926a.js => 71.4791ea33.js} (90%) rename assets/js/{72.cc46b533.js => 72.5203476d.js} (99%) rename assets/js/{73.f8bfbb5f.js => 73.b5e98758.js} (98%) rename assets/js/{75.6cea3a14.js => 75.c829b61b.js} (99%) rename assets/js/{76.4f1c67f7.js => 76.9092b0de.js} (99%) rename assets/js/{42.7fa39424.js => 77.0970e185.js} (98%) rename assets/js/{78.77d81075.js => 78.0be53998.js} (98%) rename assets/js/{79.535aa00d.js => 79.bba635c4.js} (99%) rename assets/js/{80.9636be31.js => 80.0a433807.js} (99%) rename assets/js/{82.830c1ccd.js => 82.d05c3f26.js} (99%) rename assets/js/{84.4f0b2bb7.js => 84.54b6f5a1.js} (99%) rename assets/js/{85.a920e252.js => 85.2a3d5a8a.js} (99%) create mode 100644 assets/js/86.f56488fd.js rename assets/js/{87.6edfe556.js => 87.91be584e.js} (99%) rename assets/js/{52.d94ee6e4.js => 88.317319ac.js} (98%) rename assets/js/{89.f3215088.js => 89.8f0dc9b2.js} (99%) rename assets/js/{90.da3b29cf.js => 90.5199bce8.js} (99%) rename assets/js/{93.e70b4764.js => 93.f9bd3968.js} (99%) rename assets/js/{94.711741af.js => 94.3ca207f4.js} (99%) rename assets/js/{app.630c4e21.js => app.3c95b0aa.js} (58%) diff --git a/1.x/advanced/email-inbound-parse.html b/1.x/advanced/email-inbound-parse.html index 99b859d..b08e964 100644 --- a/1.x/advanced/email-inbound-parse.html +++ b/1.x/advanced/email-inbound-parse.html @@ -9,7 +9,7 @@ - + @@ -36,7 +36,7 @@ (opens new window)

# SendGrid Inbound Parse

Krayin CRM can be integrated with SendGrid’s Inbound Parse Webhook to handle incoming emails. This allows emails sent to a specific domain to be automatically processed by Krayin and displayed in the Mail > Inbox section.

# Overview

The Inbound Parse Webhook feature of SendGrid allows emails to be converted into HTTP POST requests and forwarded to a specified URL in your application. By integrating SendGrid with Krayin CRM, you can seamlessly receive and display incoming emails.

# Setting Up SendGrid Inbound Parse with Krayin CRM

  1. Create a Domain and Email in SendGrid

    • Log into your SendGrid account (opens new window).
    • Go to Settings > Inbound Parse.
    • Click Add Host & URL to configure a new Parse Webhook.
    • Add the domain from which you want to receive emails (e.g., example.com).
    • Under the URL field, specify your Krayin CRM webhook URL, which should be in the format:
      http://yourdomain.com/admin/mail/inbound-parse
       
      Replace yourdomain.com with your actual domain and ensure the endpoint matches your Krayin setup.
  2. Configure Krayin CRM to Receive Emails

    • Once the webhook is set up in SendGrid, all emails sent to the configured domain will be forwarded to the specified Krayin webhook.
    • Krayin CRM will handle the incoming email data, including:
      • From Address: The sender's email.
      • To Address: The recipient (your configured email).
      • Subject: Email subject.
      • Text/HTML Body: Email content in plain text or HTML.
      • Attachments: Any files attached to the email.
  3. Krayin Endpoint for Inbound Parse

    • Ensure that Krayin CRM is set up to receive the POST data from SendGrid. The email content will be sent to the following Krayin endpoint:
      http://yourdomain.com/admin/mail/inbound-parse
      -
    • Krayin will parse the data sent by SendGrid, store the email information in the database, and display it in the Mail > Inbox section.

# Handling Email Attachments

Krayin CRM is capable of handling attachments that are sent via email. These attachments will be forwarded from SendGrid to your endpoint as multipart/form-data. Make sure your server can process and store these files for later retrieval in the Mail > Inbox section of the CRM.

# Security Considerations

  • Verify the Request Origin: Ensure that incoming requests to your webhook are actually coming from SendGrid. You can verify the origin by checking headers or configuring an API key in SendGrid for additional security.
  • HTTPS: Always use an HTTPS endpoint for secure communication between SendGrid and your server.

# Debugging and Testing

  • SendGrid provides tools to simulate incoming emails, which can be used to test your webhook configuration.
  • Ensure that your server’s response time is efficient. SendGrid expects a response within 20 seconds. If the email processing takes longer (e.g., saving attachments), consider using asynchronous background tasks.

# Example Workflow

  1. A user sends an email to contact@example.com.
  2. SendGrid captures the email and forwards it to your Krayin webhook (http://yourdomain.com/admin/mail/inbound-parse).
  3. Krayin CRM processes the incoming email, stores the details, and displays the email in the Mail > Inbox section.
  • Krayin will parse the data sent by SendGrid, store the email information in the database, and display it in the Mail > Inbox section.
  • # Handling Email Attachments

    Krayin CRM is capable of handling attachments that are sent via email. These attachments will be forwarded from SendGrid to your endpoint as multipart/form-data. Make sure your server can process and store these files for later retrieval in the Mail > Inbox section of the CRM.

    # Security Considerations

    # Debugging and Testing

    # Example Workflow

    1. A user sends an email to contact@example.com.
    2. SendGrid captures the email and forwards it to your Krayin webhook (http://yourdomain.com/admin/mail/inbound-parse).
    3. Krayin CRM processes the incoming email, stores the details, and displays the email in the Mail > Inbox section.
    - + diff --git a/1.x/advanced/events.html b/1.x/advanced/events.html index e98a7d1..d472824 100644 --- a/1.x/advanced/events.html +++ b/1.x/advanced/events.html @@ -9,7 +9,7 @@ - + @@ -117,7 +117,7 @@ } }

    # Events Fired in Krayin

    In Krayin, there are several events fired throughout its operations, allowing developers to hook into specific points in the application's lifecycle to customize behavior or add functionality. Here's a list of events that are fired in Krayin, which you can listen to and handle as needed by creating event listeners:

    Events name Functionality
    activity.create.before This event will be fired before activity gets created.
    activity.create.after This event will be fired after activity gets created.
    activity.update.before This event will be fired before activity gets updated.
    activity.update.after This event will be fired after activity gets updated.
    activities.file.create.before This event will be fired before file gets uploaded.
    activities.file.create.after This event will be fired after file gets uploaded.
    activity.delete.before This event will be fired before activity gets deleted.
    activity.delete.after This event will be fired after activity gets deleted.
    core.configuration.save.before This event will be fired before configuration gets created.
    core.configuration.save.after This event will be fired after configuration gets created.
    contacts.organization.create.before This event will be fired before organization created.
    contacts.organization.create.after This event will be fired after organization created .
    contacts.organization.update.before This event will be fired before organization gets updated.
    contacts.organization.update.after This event will be fired after organization gets updated.
    contact.organization.delete.before This event will be fired before organization get deleted.
    contact.organization.delete.after This event will be fired after organization get deleted.
    contacts.person.create.before This events will be fired before contact person gets created.
    contacts.person.create.after This events will be fired after contact person gets created.
    contacts.person.updated.before This events will be fired before contact person gets updated.
    contacts.person.updated.after This events will be fired after contact person gets updated.
    contacts.person.delete.before This events will be fired before contact person gets deleted.
    contacts.person.delete.after This events will be fired after contact person gets deleted.
    lead.create.before This event will be fired before leads gets created.
    lead.create.after This event will be fired after leads gets created.
    lead.update.before This event will be fired before leads gets updated.
    lead.update.after This event will be fired after leads gets updated.
    lead.delete.before This event will be fired before leads gets deleted.
    lead.delete.after This event will be fired after leads gets deleted.
    leads.quote.create.before This event will be fired before quotes leads gets created
    leads.quote.create.after This event will be fired after quotes leads gets created
    leads.quote.delete.before This event will be fired before quotes leads gets deleted
    leads.quote.delete.after This event will be fired after quotes leads gets deleted
    leads.tag.create.before This event will be fired before tag leads created
    leads.tag.create.after This event will be fired after tag leads created
    leads.tag.delete.before This event will be fired before tag leads deleted
    leads.tag.delete.after This event will be fired after tag leads deleted
    email.create.before This event will be fired before email gets created
    email.create.after This event will be fired after email gets created
    email.update.before This event will be fired before email gets updated
    email.update.after This event will be fired after email gets updated
    email.delete.before This event will be fired before email gets deleted
    email.delete.after This event will be fired after email gets deleted
    product.create.before This event will be fired before products get created
    product.create.after This event will be fired after products get created
    product.update.before This event will be fired before products get updated
    product.update.after This event will be fired after products get updated
    product.delete.before This event will be fired before products get deleted
    product.update.after This event will be fired after products get deleted
    quote.create.before This event will be fired before quote get created
    quote.create.after This event will be fired after quote get created
    quote.update.before This event will be fired before quote get updated
    quote.update.after This event will be fired after quote get updated
    quote.delete.before This event will be fired before quote get deleted
    quote.delete.after This event will be fired after quote get deleted
    settings.attribute.create.before This event will be fired before attribute get created
    settings.attribute.create.after This event will be fired after attribute get created
    settings.attribute.update.before This event will be fired before attribute get updated
    settings.attribute.update.after This event will be fired after attribute get updated
    settings.attribute.delete.before This event will be fired before attribute get deleted
    settings.attribute.delete.after This event will be fired after attribute get deleted
    settings.email_templates.create.before This event will be fired before email template get created
    settings.email_templates.create.after This event will be fired after email template get created
    settings.email_templates.update.before This event will be fired before email template get updated
    settings.email_templates.update.after This event will be fired after email template get updated
    settings.email_templates.delete.before This event will be fired before email template get deleted
    settings.email_templates.delete.after This event will be fired after email template get deleted
    settings.group.create.before This event will be fired before group get created
    settings.group.create.after This event will be fired after group get created
    settings.group.update.before This event will be fired before group get updated
    settings.group.update.after This event will be fired after group get updated
    settings.group.delete.before This event will be fired before group get deleted
    settings.group.delete.after This event will be fired after group get deleted
    settings.pipeline.create.before This event will be fired before pipeline get created
    settings.pipeline.create.after This event will be fired after pipeline get created
    settings.pipeline.update.before This event will be fired before pipeline get updated
    settings.pipeline.update.after This event will be fired after pipeline get updated
    settings.pipeline.delete.before This event will be fired before pipeline get deleted
    settings.pipeline.delete.after This event will be fired after pipeline get deleted
    settings.role.create.before This event will be fired before role get created
    settings.role.create.after This event will be fired after role get created
    settings.role.update.before This event will be fired before role get updated
    settings.role.update.after This event will be fired after role get updated
    settings.role.delete.before This event will be fired before role get deleted
    settings.role.delete.after This event will be fired after role get deleted
    settings.source.create.before This event will be fired before source get created
    settings.source.create.after This event will be fired after source get created
    settings.source.update.before This event will be fired before source get updated
    settings.source.update.after This event will be fired after source get updated
    settings.source.delete.before This event will be fired before source get deleted
    settings.source.delete.after This event will be fired after source get deleted
    settings.source.create.before This event will be fired before source get created
    settings.source.create.after This event will be fired after source get created
    settings.source.update.before This event will be fired before source get updated
    settings.source.update.after This event will be fired after source get updated
    settings.source.delete.before This event will be fired before source get deleted
    settings.source.delete.after This event will be fired after source get deleted
    settings.tag.create.before This event will be fired before tag get created
    settings.tag.create.after This event will be fired after tag get created
    settings.tag.update.before This event will be fired before tag get updated
    settings.tag.update.after This event will be fired after tag get updated
    settings.tag.delete.before This event will be fired before tag get deleted
    settings.tag.delete.after This event will be fired after tag get deleted
    settings.type.create.before This event will be fired before type get created
    settings.type.create.after This event will be fired after type get created
    settings.type.update.before This event will be fired before type get updated
    settings.type.update.after This event will be fired after type get updated
    settings.type.delete.before This event will be fired before type get deleted
    settings.type.delete.after This event will be fired after type get deleted
    settings.user.create.before This event will be fired before user get created
    settings.user.create.after This event will be fired after user get created
    settings.user.update.before This event will be fired before user get updated
    settings.user.update.after This event will be fired after user get updated
    settings.user.delete.before This event will be fired before user get deleted
    settings.user.delete.after This event will be fired after user get deleted
    settings.workflow.create.before This event will be fired before workflow get created
    settings.workflow.create.after This event will be fired after workflow get created
    settings.workflow.update.before This event will be fired before workflow get updated
    settings.workflow.update.after This event will be fired after workflow get updated
    settings.workflow.delete.before This event will be fired before workflow get deleted
    settings.workflow.delete.after This event will be fired after workflow get deleted
    user.account.update-password This event will be fired after user password gets updated
    settings.web_forms.create.before This event will be fired before web form get created
    settings.web_forms.create.after This event will be fired after web form get created
    settings.web_forms.update.before This event will be fired before web form get updated
    settings.web_forms.update.after This event will be fired after web form get updated
    settings.web_forms.delete.before This event will be fired before web form get deleted
    settings.web_forms.delete.after This event will be fired after web form get deleted

    # Listening to Existing Events

    Krayin uses events and listeners to implement the observer pattern, allowing you to respond to various actions and events within the application. You can listen to specific events and execute custom code when those events are triggered.

    # Registering a Listener

    Open the EventServiceProvider.php file located in the Providers directory of your Krayin application. This file is where you register event listeners.

    Inside the boot() method of EventServiceProvider.php, use the Event::listen method to register your listener. This method takes the event name and a callback function or a class method that will handle the event.

    Event::listen('lead.create.before', 'Webkul\Admin\Listeners\Leads@linkToEmail');
    -

    In the example above, we are listening to the lead.create.before event and specifying the createOrder function from the Order listener class in the Webkul\Notification\Listeners namespace.

    Replace 'lead.create.before' with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.

    By registering the listener, you have associated the createOrder function with the lead.create.before event. Whenever this event is triggered, the specified function will be executed.

    You can modify the listener function according to your requirements to perform the desired operation.

    In the example above, we are listening to the lead.create.before event and specifying the createOrder function from the Order listener class in the Webkul\Notification\Listeners namespace.

    Replace 'lead.create.before' with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.

    By registering the listener, you have associated the createOrder function with the lead.create.before event. Whenever this event is triggered, the specified function will be executed.

    You can modify the listener function according to your requirements to perform the desired operation.

    - + diff --git a/1.x/advanced/helpers.html b/1.x/advanced/helpers.html index 235d48a..a5089a4 100644 --- a/1.x/advanced/helpers.html +++ b/1.x/advanced/helpers.html @@ -9,7 +9,7 @@ - + @@ -50,7 +50,7 @@

    # Format base price

    To format the price of provided price you can use the method core()->formatBasePrice()

    core()->formatBasePrice($price);
     

    # Get the config field

    To get the config field you can use the core()->getConfigField($fieldName)

    core()->getConfigField($fieldName);
     

    # Get the config data

    To retrieve the config data you can use the method core()->getConfigData($field)

    core()->getConfigData($field);
    -

    These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.

    These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.

    - + diff --git a/1.x/advanced/index.html b/1.x/advanced/index.html index 25f202c..f12524d 100644 --- a/1.x/advanced/index.html +++ b/1.x/advanced/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Digging Deeper

    Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.

    We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the Package Development section for a primer on creating and managing packages in Laravel.

    # Events and Event Handlers

    Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.

    # Helpers

    Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.

    # Overriding Core Models

    Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.

    - + (opens new window)

    # Digging Deeper

    Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.

    We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the Package Development section for a primer on creating and managing packages in Laravel.

    # Events and Event Handlers

    Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.

    # Helpers

    Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.

    # Overriding Core Models

    Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.

    + diff --git a/1.x/advanced/override-core-model.html b/1.x/advanced/override-core-model.html index 08bc3ca..a0eb87c 100644 --- a/1.x/advanced/override-core-model.html +++ b/1.x/advanced/override-core-model.html @@ -9,7 +9,7 @@ - + @@ -65,7 +65,7 @@ { // } -

    Once registered, you can use dependency injection or other Laravel mechanisms to reference the interface(Webkul\Product\Contracts\Product as ProductContract) throughout your application. Laravel's service container will automatically resolve your custom model implementation (Webkul\Category\Models\Product) where the interface is referenced.

    By following this approach, you can effectively extend and override core models within Krayin using Concord, maintaining modularity and flexibility in your application's architecture.

    Once registered, you can use dependency injection or other Laravel mechanisms to reference the interface(Webkul\Product\Contracts\Product as ProductContract) throughout your application. Laravel's service container will automatically resolve your custom model implementation (Webkul\Category\Models\Product) where the interface is referenced.

    By following this approach, you can effectively extend and override core models within Krayin using Concord, maintaining modularity and flexibility in your application's architecture.

    - + diff --git a/1.x/advanced/render-event.html b/1.x/advanced/render-event.html index 349ee3b..02e409f 100644 --- a/1.x/advanced/render-event.html +++ b/1.x/advanced/render-event.html @@ -9,7 +9,7 @@ - + @@ -58,7 +58,7 @@ }); } } -

    Replace 'path/to/before_content_template.blade.php' and 'path/to/after_content_template.blade.php' with the actual paths to the Blade template files you want to inject.

    WARNING

    Make sure that you have registered the EventServiceProvider in your own service provider.

    # Implementation Details

    # Considerations

    By following these steps, you can effectively leverage the view_render_event() function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.

    Replace 'path/to/before_content_template.blade.php' and 'path/to/after_content_template.blade.php' with the actual paths to the Blade template files you want to inject.

    WARNING

    Make sure that you have registered the EventServiceProvider in your own service provider.

    # Implementation Details

    # Considerations

    By following these steps, you can effectively leverage the view_render_event() function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.

    - + diff --git a/1.x/advanced/security-practice.html b/1.x/advanced/security-practice.html index ed52941..1e220be 100644 --- a/1.x/advanced/security-practice.html +++ b/1.x/advanced/security-practice.html @@ -9,7 +9,7 @@ - + @@ -51,7 +51,7 @@

    # Cross-Site Scripting Protection (X-XSS Protection)

    Set the X-XSS-Protection response header to enable browsers to detect and prevent cross-site scripting (XSS) attacks:

    X-XSS-Protection: 1; mode=block
     

    # X-Frame-Options​

    The X-Frame-Options response header protects applications against clickjacking. It specifies whether the content can be displayed within frames:

    X-Frame-Options: deny
     

    # X-Content-Type-Options​

    The X-Content-Type-Options response header forces the browser to disable MIME sniffing, preventing MIME sniffing vulnerabilities:

    X-Content-Type-Options: nosniff
    -

    # Content Security Policy (CSP)

    Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.

    # Continuous Logging And Monitoring

    Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.

    By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.

    # Content Security Policy (CSP)

    Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.

    # Continuous Logging And Monitoring

    Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.

    By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.

    - + diff --git a/1.x/api/getting-started-with-the-api.html b/1.x/api/getting-started-with-the-api.html index 5fc1954..f285e0f 100644 --- a/1.x/api/getting-started-with-the-api.html +++ b/1.x/api/getting-started-with-the-api.html @@ -9,7 +9,7 @@ - + @@ -48,11 +48,11 @@ use HasApiTokens; ... } -
    - + diff --git a/1.x/api/index.html b/1.x/api/index.html index be38387..fe9f560 100644 --- a/1.x/api/index.html +++ b/1.x/api/index.html @@ -9,7 +9,7 @@ - + @@ -35,7 +35,7 @@ Contact Us (opens new window)

    # Krayin APIs

    # REST API

    The Krayin REST API enables seamless integration and interaction with the Krayin CRM system. It follows the REST (Representational State Transfer) architecture, providing a robust set of endpoints for managing CRM-related data.

    Key Features

    • CRUD Operations: The API supports all basic CRUD (Create, Read, Update, Delete) operations, allowing for comprehensive management of CRM data including customers, leads, contacts, and more.

    • Pagination: To enhance performance and manage large datasets efficiently, the API includes support for pagination. This helps in retrieving data in chunks rather than loading large volumes of data at once.

    Integration Capabilities: The REST API is designed to integrate seamlessly with various external systems and applications, including:

    • PWA (Progressive Web Applications): Use the API to develop PWAs that interact with the CRM, offering a modern, app-like experience on the web. Mobile Applications: Integrate with mobile apps to enable functionalities such as customer management, lead tracking, and reporting directly from the mobile interface. -Data Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.
    - +Data Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.
    + diff --git a/1.x/architecture/index.html b/1.x/architecture/index.html index 8244412..ea2ba95 100644 --- a/1.x/architecture/index.html +++ b/1.x/architecture/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Architecture concepts

    Krayin is very easy framework to understand. The goal of this document to give you overview of how krayin works.

    We love to work with hot Opensource (opens new window) softwares so Krayin is built on technologies such as PHP (opens new window), Laravel (opens new window) and Vue.js (opens new window)

    As Krayin solution for SMEs and Enterprises for complete customer lifecycle management.

    Laravel packages are being used to separate each functionality such as Leads, Quotes, Mail, Activities, Contacts, Products Settings, etc.

    We developed and used built-in components of Vue.js

    Krayin registers useful events that are triggered on most of the pages which could enable to perform some custom operations in the application.

    - + (opens new window)

    # Architecture concepts

    Krayin is very easy framework to understand. The goal of this document to give you overview of how krayin works.

    We love to work with hot Opensource (opens new window) softwares so Krayin is built on technologies such as PHP (opens new window), Laravel (opens new window) and Vue.js (opens new window)

    As Krayin solution for SMEs and Enterprises for complete customer lifecycle management.

    Laravel packages are being used to separate each functionality such as Leads, Quotes, Mail, Activities, Contacts, Products Settings, etc.

    We developed and used built-in components of Vue.js

    Krayin registers useful events that are triggered on most of the pages which could enable to perform some custom operations in the application.

    + diff --git a/1.x/architecture/modular-design.html b/1.x/architecture/modular-design.html index 8f43044..db73233 100644 --- a/1.x/architecture/modular-design.html +++ b/1.x/architecture/modular-design.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Modular Design in Krayin

    Krayin is designed with a modular architecture to enhance flexibility, scalability, and maintainability. This approach allows developers to manage and extend the application more efficiently.

    # Key Benefits of Modular Design

    1. Separation of Concerns: Modules encapsulate specific functionality, promoting a clear separation between different parts of the application.
    2. Reusability: Modules can be reused across different projects, reducing duplication of effort and speeding up development.
    3. Maintainability: Isolated modules make it easier to identify and fix bugs, and to implement new features without affecting unrelated parts of the application.
    4. Scalability: Modular design supports scaling the application by enabling the addition of new modules without major changes to the existing codebase.

    # Module Structure in Krayin

    Each module in Krayin is organized into a well-defined structure, ensuring consistency and ease of management. A typical module contains the following directories:

    • Config: Configuration files specific to the module.
    • Database: Migrations, seeders, and factories related to the module.
    • Http: Controllers, middleware, and requests handling HTTP interactions.
    • Models: Eloquent models representing the data structures used by the module.
    • Repositories: Implementation of the Repository pattern for data access.
    • Resources: Views, language files, and other resources.
    • Routes: Module-specific routes.
    • Tests: Unit and feature tests for the module.

    The modular design in Krayin facilitates a clean, organized, and scalable development process. By adhering to the principles of modular architecture, developers can create robust and maintainable applications that are easy to extend and manage.

    - + diff --git a/1.x/architecture/packages.html b/1.x/architecture/packages.html index e426b65..e197892 100644 --- a/1.x/architecture/packages.html +++ b/1.x/architecture/packages.html @@ -9,7 +9,7 @@ - + @@ -43,7 +43,7 @@ Usage: Enables efficient inventory control, order processing, and reporting within the CRM.

  • Quantity: Represents the current stock level or available units of a particular product.

  • Price: Specifies the selling price or unit cost of the product. Usage: Determines the financial value of the product, aids in pricing strategies, and facilitates accurate sales transactions.

  • # Quote

    The Quote Package in Krayin CRM centralizes the management of sales quotes, encompassing essential details and functionalities to streamline the quotation process and facilitate accurate sales transactions. Here’s a detailed overview of its components and capabilities:

    Key Components Handled

    Financial Details Managed

    # Tag

    The Tag Package in Krayin CRM manages tags associated with various entities, providing essential functionalities to categorize and organize information effectively. Here's a concise overview of its key components and capabilities:

    Key Components Managed

    # UI

    The UI Package in Krayin CRM encompasses the entire user interface-related components and functionalities, managing Single File Components (SFCs) in Vue.js, as well as associated CSS and JavaScript resources. Here’s an overview of its comprehensive role in the CRM:

    Key Responsibilities

    SFC Vue Components:

    # User

    The User Package in Krayin CRM is instrumental for managing groups, roles, and user accounts within the system. Here’s an overview of its functionalities:

    # WebForm

    The WebForm feature in Krayin CRM enables users to create and manage customizable forms directly within the CRM environment. Here’s an overview of its functionalities and benefits:

    Customizable Form Creation: Users can design forms tailored to specific needs, incorporating fields such as text inputs, checkboxes, dropdowns, and file uploads.

    Integration with CRM Data: WebForms can be integrated with CRM data fields, allowing seamless capture and storage of information related to contacts, leads, or other entities.

    Automation and Notifications: Submission of WebForms can trigger automated actions such as sending notifications, creating new CRM records, or updating existing data.

    Accessibility and Embedding: Forms can be embedded on websites or shared via links, providing accessibility to external users and ensuring data collection efficiency.

    # Workflow

    Workflows in Krayin CRM automate business processes and streamline operations by defining a series of actions based on predefined triggers and conditions. Here’s how workflows enhance CRM functionality:

    Automated Task Execution: Workflows automate routine tasks such as sending follow-up emails, assigning tasks to team members, or updating CRM records based on specified criteria.

    Visual Workflow Builder: Users can visually design workflows using a drag-and-drop interface, making it easy to create complex automation scenarios without coding.

    Conditional Logic: Workflows support conditional logic to route processes dynamically, ensuring actions are triggered based on specific data conditions or user interactions.

    Performance Monitoring: Detailed analytics and reporting tools track workflow performance, providing insights into efficiency, bottlenecks, and process improvements.

    Integration and Extensibility: Workflows integrate with other CRM modules and external systems, extending automation capabilities across the organization’s ecosystem.

    Service provider enables features such as loading routes, migrations, languages or publishing views, etc so Krayin is developed considering these aspects.

    - + diff --git a/1.x/architecture/repository-pattern.html b/1.x/architecture/repository-pattern.html index f56b78c..2b423f7 100644 --- a/1.x/architecture/repository-pattern.html +++ b/1.x/architecture/repository-pattern.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Repository Pattern in Krayin

    Krayin employs the Repository Pattern to further enhance the flexibility and maintainability of its codebase.

    To add an additional layer of abstraction and promote better code organization, Krayin incorporates the Repository Pattern on top of the ORM.

    # Benefits of the Repository Pattern

    • Consistency: Restricts the use of raw queries throughout the application, ensuring a consistent approach to database operations.
    • Maintainability: Enhances code organization, making it easier to manage and maintain.
    • Flexibility: Facilitates the implementation of changes without affecting the rest of the codebase.

    # Implementation in Krayin

    Krayin utilizes the Prettus Repository (opens new window) package to facilitate the implementation of the Repository Pattern. This choice provides several benefits:

    • Standardization: Ensures a standardized approach to repository implementation.
    • Extensibility: Makes it easier to extend and customize the application as needed.
    • Separation of Concerns: Promotes a clear separation between business logic and data access logic.

    By adopting the Repository Pattern with the Prettus Repository package, Krayin enhances the overall architecture of the application, making it more robust and easier to evolve over time.

    # Eloquent ORM

    Eloquent (opens new window), the ORM (Object-Relational Mapping) in Laravel, provides a higher level of abstraction and simplifies database interactions. With Eloquent, developers can focus on manipulating objects rather than dealing with raw SQL queries, making database operations more convenient and intuitive.

    - + diff --git a/1.x/architecture/theme.html b/1.x/architecture/theme.html index 4e83b7c..1b12e3c 100644 --- a/1.x/architecture/theme.html +++ b/1.x/architecture/theme.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Theme

    CRM solution for SMEs and Enterprises, themes provides an elegant way to attract users.

    - + (opens new window)

    # Theme

    CRM solution for SMEs and Enterprises, themes provides an elegant way to attract users.

    + diff --git a/1.x/custom-attributes/custom-attribute.html b/1.x/custom-attributes/custom-attribute.html index 50f9da2..4a0a5e7 100644 --- a/1.x/custom-attributes/custom-attribute.html +++ b/1.x/custom-attributes/custom-attribute.html @@ -9,7 +9,7 @@ - + @@ -107,7 +107,7 @@ return $product; } -
    - + diff --git a/1.x/custom-attributes/index.html b/1.x/custom-attributes/index.html index 31b5e2b..7c08dfc 100644 --- a/1.x/custom-attributes/index.html +++ b/1.x/custom-attributes/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Custom Attribute Creation

    Attributes helps you to store data dynamically related to any item while creating such as Person, Organization, Product and Lead creation etc.

    - + (opens new window)

    # Custom Attribute Creation

    Attributes helps you to store data dynamically related to any item while creating such as Person, Organization, Product and Lead creation etc.

    + diff --git a/1.x/custom-attributes/uses.html b/1.x/custom-attributes/uses.html index 8dcf5ed..7887929 100644 --- a/1.x/custom-attributes/uses.html +++ b/1.x/custom-attributes/uses.html @@ -9,7 +9,7 @@ - + @@ -37,7 +37,7 @@ Navigate to Settings menu and search about Attributes click on it.

    attribute-list

    attribute-list

    attribute-list

    attribute-list

    - + diff --git a/1.x/introduction/index.html b/1.x/introduction/index.html index 248296e..65d3d3b 100644 --- a/1.x/introduction/index.html +++ b/1.x/introduction/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Introduction

    Krayin is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window), a PHP (opens new window) framework and Vue.js (opens new window), a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    To learn more about Krayin's features and try a demo (opens new window), check out our website Krayin (opens new window).

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    - + (opens new window)

    # Introduction

    Krayin is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window), a PHP (opens new window) framework and Vue.js (opens new window), a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    To learn more about Krayin's features and try a demo (opens new window), check out our website Krayin (opens new window).

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    + diff --git a/1.x/introduction/installation.html b/1.x/introduction/installation.html index 0283483..725e8d8 100644 --- a/1.x/introduction/installation.html +++ b/1.x/introduction/installation.html @@ -9,7 +9,7 @@ - + @@ -51,7 +51,7 @@

    # On Your Local Server

    To access Krayin on your local server, follow these steps:

    1. Configure your HTTP server to point to the public/ directory of the project.

    2. Run the following command:

      php artisan serve
       
    3. Open your browser and access the provided local server URL.

    # Login as an Admin

    To log in as an admin, visit https://example.com/admin/. If you used the php artisan krayin-crm:install command, use the following credentials:

    Email: admin@example.com
     Password: admin123
    -

    # Contributing

    Contributions are welcome! Follow the contribution guidelines to get started.

    # License

    Krayin is open-sourced software licensed under the MIT license.

    # Contributing

    Contributions are welcome! Follow the contribution guidelines to get started.

    # License

    Krayin is open-sourced software licensed under the MIT license.

    - + diff --git a/1.x/introduction/requirements.html b/1.x/introduction/requirements.html index 97e5003..ff369ac 100644 --- a/1.x/introduction/requirements.html +++ b/1.x/introduction/requirements.html @@ -9,7 +9,7 @@ - + @@ -36,11 +36,11 @@ (opens new window)

    # Requirements

    Before installing Krayin please make sure your server meets the following requirements,

    # Server configuration

    • SERVER: Apache 2 or NGINX
    • RAM: 4GB or higher
    • Node: v16.16.0 (LTS) or higher
    • PHP: 8.1 or higher
    • Composer: 2.5 or higher

    # PHP Extensions

    Ensure the following extensions are installed and enabled. You can check using the phpinfo() page or the php -m command.

    • php-intl extension: This extension is required for internationalization support in Krayin.

    • php-gd extension: The php-gd extension must be properly installed to ensure correct image functionality in the project. If not installed correctly, image-related features may not work as expected.

      Note

      It is important to ensure proper installation of the php-gd extension to avoid any issues with image manipulation in Krayin.

    # PHP Configuration

    Open your php.ini file and modify the following settings.

    • memory_limit: Set the memory_limit directive to 4G or higher to ensure sufficient memory allocation for the application.

    • max_execution_time: Adjust the max_execution_time directive to 360 or higher. This value determines the maximum time (in seconds) a script is allowed to run. Increasing this value ensures that longer operations, such as import/export processes, can be completed successfully.

    • date.timezone: Set the date.timezone directive to your specific timezone. For example, Asia/Kolkata. This ensures that date and time-related functions work accurately based on the specified timezone.

    memory_limit = 4G
     max_execution_time = 360
     date.timezone = Asia/Kolkata <- Change this to your own timezone.
    -

    Remember to restart your web server

    Whenever you make changes to the PHP configuration file, be sure to restart Apache or NGINX to apply the modifications.

    # Supported Database Servers

    Krayin supports the following database servers:

    • MySQL: Version 8.0.32 or higher is recommended for optimal performance and compatibility.

    • MariaDB: Version 10.3 or higher is recommended for optimal performance and compatibility.

    • Database Collation: The recommended collation for the database is utf8mb4_unicode_ci, which ensures proper handling of Unicode characters and multilingual support.

    # Supported Database Servers

    Krayin supports the following database servers:

    - + diff --git a/1.x/packages/add-menu-in-admin.html b/1.x/packages/add-menu-in-admin.html index 86bf07c..35e9d63 100644 --- a/1.x/packages/add-menu-in-admin.html +++ b/1.x/packages/add-menu-in-admin.html @@ -9,7 +9,7 @@ - + @@ -91,7 +91,7 @@ } }

    # Optimize Application

    Finally, run the following command to optimize your application:

    php artisan optimize:clear
    -

    After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.

    # Level of Menu

    In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:

    # First Level (Sidebar)

    This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.

    # Second Level (Hover Menu)

    When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.

    After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.

    # Level of Menu

    In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:

    # First Level (Sidebar)

    This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.

    # Second Level (Hover Menu)

    When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.

    - + diff --git a/1.x/packages/assets.html b/1.x/packages/assets.html index 93107dc..6ad9646 100644 --- a/1.x/packages/assets.html +++ b/1.x/packages/assets.html @@ -9,7 +9,7 @@ - + @@ -161,7 +161,7 @@ <script type="text/javascript" src="{{ asset('vendor/webkul/category/assets/js/category.js') }}"></script> <script type="text/javascript" src="{{ asset('vendor/webkul/ui/assets/js/ui.js') }}"></script> -
    - + diff --git a/1.x/packages/controllers.html b/1.x/packages/controllers.html index f55ac19..c2af1bf 100644 --- a/1.x/packages/controllers.html +++ b/1.x/packages/controllers.html @@ -9,7 +9,7 @@ - + @@ -98,7 +98,7 @@ ├── Controller.php └── Category └── CategoryController.php -

    By following these steps, you will have created the necessary structure and files for handling category within your "Category" package. You can now add the specific logic for each method to handle the functionality required for your category into the admin.

    By following these steps, you will have created the necessary structure and files for handling category within your "Category" package. You can now add the specific logic for each method to handle the functionality required for your category into the admin.

    - + diff --git a/1.x/packages/create-acl.html b/1.x/packages/create-acl.html index 9c16db0..27905b4 100644 --- a/1.x/packages/create-acl.html +++ b/1.x/packages/create-acl.html @@ -9,7 +9,7 @@ - + @@ -75,7 +75,7 @@ }

    Ensure that the path specified in mergeConfigFrom matches the location of your acl.php file.

    This will merge the ACL configuration with the existing configuration.

    # Clear Configuration Cache

    After making changes, clear the configuration cache to apply the latest ACL configuration:

    php artisan optimize
     

    # Verify in Admin Panel

    Check the updated ACL configuration within the admin panel to confirm that menu items are correctly displayed and sorted according to your configuration.

    This will ensure that the latest ACL configuration is used.

    # Checking Roles and Permissions

    To manage roles and permissions effectively:

    # Access Roles

    In the Admin model located in Webkul\User\Models, utilize the relationship with the Role model to manage roles associated with users.

    # Permission Checks

    Use the bouncer() helper function to verify if a user has specific permissions. Example usage:

    bouncer()->hasPermission($permission)
    -

    Replace $permission with the actual permission you want to check.

    By following these steps, you can seamlessly configure and manage Access Control List (ACL) settings in Krayin, ensuring secure and controlled access to administrative functionalities.

    Replace $permission with the actual permission you want to check.

    By following these steps, you can seamlessly configure and manage Access Control List (ACL) settings in Krayin, ensuring secure and controlled access to administrative functionalities.

    - + diff --git a/1.x/packages/create-migrations.html b/1.x/packages/create-migrations.html index 69ed5fe..2952ff9 100644 --- a/1.x/packages/create-migrations.html +++ b/1.x/packages/create-migrations.html @@ -9,7 +9,7 @@ - + @@ -97,7 +97,7 @@ } }

    # Creating Tables from Migrations

    Run the following command to create the Category table in your database.

    php artisan migrate
    -
    - + diff --git a/1.x/packages/create-models.html b/1.x/packages/create-models.html index b16e1a5..77a1384 100644 --- a/1.x/packages/create-models.html +++ b/1.x/packages/create-models.html @@ -9,7 +9,7 @@ - + @@ -138,7 +138,7 @@ \Webkul\Category\Providers\ModuleServiceProvider::class, ] ]; -
    - + diff --git a/1.x/packages/create-package.html b/1.x/packages/create-package.html index d6cc321..8475fb6 100644 --- a/1.x/packages/create-package.html +++ b/1.x/packages/create-package.html @@ -9,7 +9,7 @@ - + @@ -123,7 +123,7 @@ // ... ];

    # Run the Commands

    Run the following command to autoload your package:

       composer dump-autoload
    -

    Your package is now ready to use !

    Your package is now ready to use !

    - + diff --git a/1.x/packages/datagrid.html b/1.x/packages/datagrid.html index a05f292..6ef3dea 100644 --- a/1.x/packages/datagrid.html +++ b/1.x/packages/datagrid.html @@ -9,7 +9,7 @@ - + @@ -215,7 +215,7 @@ ]); } } -
    - + diff --git a/1.x/packages/index.html b/1.x/packages/index.html index bce480f..7971082 100644 --- a/1.x/packages/index.html +++ b/1.x/packages/index.html @@ -9,7 +9,7 @@ - + @@ -86,7 +86,7 @@ ├── index.blade.php ├── create.blade.php └── edit.blade.php -
    - +
    + diff --git a/1.x/packages/layouts.html b/1.x/packages/layouts.html index 7bdcb2e..20c1c1f 100644 --- a/1.x/packages/layouts.html +++ b/1.x/packages/layouts.html @@ -9,7 +9,7 @@ - + @@ -56,7 +56,7 @@ // </script> @endpush -
    Prop Name Description
    @extends('category::layouts.master') This @extends Blade directive to specify which layout the child view should "inherit"
    @section('page_title') This is used to define the title of the page.
    @section('content-wrapper') This is used to define the body of the page.
    @push('css') This is used to add additional css.
    @push('scripts') This is used to add additional javascript.

    WARNING

    Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in lang/app.php.

    If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside Resources\Views\Layouts\master.blade.php

    Prop Name Description
    @extends('category::layouts.master') This @extends Blade directive to specify which layout the child view should "inherit"
    @section('page_title') This is used to define the title of the page.
    @section('content-wrapper') This is used to define the body of the page.
    @push('css') This is used to add additional css.
    @push('scripts') This is used to add additional javascript.

    WARNING

    Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in lang/app.php.

    If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside Resources\Views\Layouts\master.blade.php

    - + diff --git a/1.x/packages/localization.html b/1.x/packages/localization.html index cdc166a..5819ca5 100644 --- a/1.x/packages/localization.html +++ b/1.x/packages/localization.html @@ -9,7 +9,7 @@ - + @@ -99,7 +99,7 @@ } }

    # Explanation

    # Use Translations in Blade Files

    In your Blade templates (.blade.php files), you can use the @lang helper function to retrieve translations. Use the namespace 'category' followed by the translation key. For example:

    @lang('category::categories.index.title')
    -

    # Explanation

    By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.

    # Explanation

    By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.

    - + diff --git a/1.x/packages/routes.html b/1.x/packages/routes.html index e35bc58..25a2486 100644 --- a/1.x/packages/routes.html +++ b/1.x/packages/routes.html @@ -9,7 +9,7 @@ - + @@ -91,7 +91,7 @@ Route::delete('categories/{id}', [CategoryController::class, 'destroy']);

    # PATCH

    The PATCH method is similar to PUT, but it is used to make partial updates to data on the server.

    // Define a route that responds to a PATCH request
     Route::patch('categories/{id}', [CategoryController::class, 'partialUpdate']);
    -
    - + diff --git a/1.x/packages/store-data-through-repositories.html b/1.x/packages/store-data-through-repositories.html index eb5a4a0..e55b275 100644 --- a/1.x/packages/store-data-through-repositories.html +++ b/1.x/packages/store-data-through-repositories.html @@ -9,7 +9,7 @@ - + @@ -76,7 +76,7 @@

    # FindWhere

    The findWhere method is called on the categoryRepository instance. This method adds a query constraint to filter the results based on a specified condition.

    $categories = $this->categoryRepository->findWhere([
         'status' => 'active',
     ]);
    -

    The model() method within CategoryRepository.php returns the path of your contract class (CategoryContract in this example). This method initializes the model instance used throughout the repository for database interactions.

    Your CategoryRepository is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.

    By utilizing the CategoryRepository, you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.

    The model() method within CategoryRepository.php returns the path of your contract class (CategoryContract in this example). This method initializes the model instance used throughout the repository for database interactions.

    Your CategoryRepository is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.

    By utilizing the CategoryRepository, you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.

    - + diff --git a/1.x/packages/validation.html b/1.x/packages/validation.html index 34d231a..faa6476 100644 --- a/1.x/packages/validation.html +++ b/1.x/packages/validation.html @@ -9,7 +9,7 @@ - + @@ -97,7 +97,7 @@ <input v-validate="'required|email'" name="email" type="text"> <input v-validate="'required|min:6'" type="password" name="password"> -
    - + diff --git a/1.x/packages/views.html b/1.x/packages/views.html index 6db59e6..2fd3866 100644 --- a/1.x/packages/views.html +++ b/1.x/packages/views.html @@ -9,7 +9,7 @@ - + @@ -102,7 +102,7 @@ return view('category::category.index', compact('categories')); } } -

    # Explanation

    # Blade File Naming Convention

    Krayin utilizes Blade templates to handle listing, creation, and updating operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.

    # Listing (Index Blade):

    # Creation (Create Blade):

    # Updating (Edit Blade):

    By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.

    # Explanation

    # Blade File Naming Convention

    Krayin utilizes Blade templates to handle listing, creation, and updating operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.

    # Listing (Index Blade):

    # Creation (Create Blade):

    # Updating (Edit Blade):

    By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.

    - + diff --git a/2.0/advanced/email-inbound-parse.html b/2.0/advanced/email-inbound-parse.html index 1ec336b..cf3c829 100644 --- a/2.0/advanced/email-inbound-parse.html +++ b/2.0/advanced/email-inbound-parse.html @@ -9,7 +9,7 @@ - + @@ -37,7 +37,7 @@

    This tells Krayin CRM to use the SendGrid package to handle incoming emails.

    # Setting Up SendGrid Inbound Parse with Krayin CRM

    1. Create a Domain and Email in SendGrid

      • Log into your SendGrid account (opens new window).
      • Go to Settings > Inbound Parse.
      • Click Add Host & URL to configure a new Parse Webhook.
      • Add the domain from which you want to receive emails (e.g., example.com).
      • Under the URL field, specify your Krayin CRM webhook URL, which should be in the format:
        http://yourdomain.com/admin/mail/inbound-parse
         
        Replace yourdomain.com with your actual domain and ensure the endpoint matches your Krayin setup.
    2. Configure Krayin CRM to Receive Emails

      • Once the webhook is set up in SendGrid, all emails sent to the configured domain will be forwarded to the specified Krayin webhook.
      • Krayin CRM will handle the incoming email data, including:
        • From Address: The sender's email.
        • To Address: The recipient (your configured email).
        • Subject: Email subject.
        • Text/HTML Body: Email content in plain text or HTML.
        • Attachments: Any files attached to the email.
    3. Krayin Endpoint for Inbound Parse

      • Ensure that Krayin CRM is set up to receive the POST data from SendGrid. The email content will be sent to the following Krayin endpoint:
        http://yourdomain.com/admin/mail/inbound-parse
        -
      • Krayin will parse the data sent by SendGrid, store the email information in the database, and display it in the Mail > Inbox section.

    # Handling Email Attachments

    Krayin CRM is capable of handling attachments that are sent via email. These attachments will be forwarded from SendGrid to your endpoint as multipart/form-data. Make sure your server can process and store these files for later retrieval in the Mail > Inbox section of the CRM.

    # Security Considerations

    # Debugging and Testing

    # Example Workflow

    1. A user sends an email to contact@example.com.
    2. SendGrid captures the email and forwards it to your Krayin webhook (http://yourdomain.com/admin/mail/inbound-parse).
    3. Krayin CRM processes the incoming email, stores the details, and displays the email in the Mail > Inbox section.
  • Krayin will parse the data sent by SendGrid, store the email information in the database, and display it in the Mail > Inbox section.
  • # Handling Email Attachments

    Krayin CRM is capable of handling attachments that are sent via email. These attachments will be forwarded from SendGrid to your endpoint as multipart/form-data. Make sure your server can process and store these files for later retrieval in the Mail > Inbox section of the CRM.

    # Security Considerations

    # Debugging and Testing

    # Example Workflow

    1. A user sends an email to contact@example.com.
    2. SendGrid captures the email and forwards it to your Krayin webhook (http://yourdomain.com/admin/mail/inbound-parse).
    3. Krayin CRM processes the incoming email, stores the details, and displays the email in the Mail > Inbox section.
    - + diff --git a/2.0/advanced/events.html b/2.0/advanced/events.html index 3855854..95518b1 100644 --- a/2.0/advanced/events.html +++ b/2.0/advanced/events.html @@ -9,7 +9,7 @@ - + @@ -117,7 +117,7 @@ } }

    # Events Fired in Krayin

    In Krayin, there are several events fired throughout its operations, allowing developers to hook into specific points in the application's lifecycle to customize behavior or add functionality. Here's a list of events that are fired in Krayin, which you can listen to and handle as needed by creating event listeners:

    Events name Functionality
    activity.create.before This event will be fired before activity gets created.
    activity.create.after This event will be fired after activity gets created.
    activity.update.before This event will be fired before activity gets updated.
    activity.update.after This event will be fired after activity gets updated.
    activities.file.create.before This event will be fired before file gets uploaded.
    activities.file.create.after This event will be fired after file gets uploaded.
    activity.delete.before This event will be fired before activity gets deleted.
    activity.delete.after This event will be fired after activity gets deleted.
    core.configuration.save.before This event will be fired before configuration gets created.
    core.configuration.save.after This event will be fired after configuration gets created.
    contacts.organization.create.before This event will be fired before organization created.
    contacts.organization.create.after This event will be fired after organization created .
    contacts.organization.update.before This event will be fired before organization gets updated.
    contacts.organization.update.after This event will be fired after organization gets updated.
    contact.organization.delete.before This event will be fired before organization get deleted.
    contact.organization.delete.after This event will be fired after organization get deleted.
    contacts.person.create.before This events will be fired before contact person gets created.
    contacts.person.create.after This events will be fired after contact person gets created.
    contacts.person.updated.before This events will be fired before contact person gets updated.
    contacts.person.updated.after This events will be fired after contact person gets updated.
    contacts.person.delete.before This events will be fired before contact person gets deleted.
    contacts.person.delete.after This events will be fired after contact person gets deleted.
    lead.create.before This event will be fired before leads gets created.
    lead.create.after This event will be fired after leads gets created.
    lead.update.before This event will be fired before leads gets updated.
    lead.update.after This event will be fired after leads gets updated.
    lead.delete.before This event will be fired before leads gets deleted.
    lead.delete.after This event will be fired after leads gets deleted.
    leads.quote.create.before This event will be fired before quotes leads gets created
    leads.quote.create.after This event will be fired after quotes leads gets created
    leads.quote.delete.before This event will be fired before quotes leads gets deleted
    leads.quote.delete.after This event will be fired after quotes leads gets deleted
    leads.tag.create.before This event will be fired before tag leads created
    leads.tag.create.after This event will be fired after tag leads created
    leads.tag.delete.before This event will be fired before tag leads deleted
    leads.tag.delete.after This event will be fired after tag leads deleted
    email.create.before This event will be fired before email gets created
    email.create.after This event will be fired after email gets created
    email.update.before This event will be fired before email gets updated
    email.update.after This event will be fired after email gets updated
    email.delete.before This event will be fired before email gets deleted
    email.delete.after This event will be fired after email gets deleted
    product.create.before This event will be fired before products get created
    product.create.after This event will be fired after products get created
    product.update.before This event will be fired before products get updated
    product.update.after This event will be fired after products get updated
    product.delete.before This event will be fired before products get deleted
    product.update.after This event will be fired after products get deleted
    quote.create.before This event will be fired before quote get created
    quote.create.after This event will be fired after quote get created
    quote.update.before This event will be fired before quote get updated
    quote.update.after This event will be fired after quote get updated
    quote.delete.before This event will be fired before quote get deleted
    quote.delete.after This event will be fired after quote get deleted
    settings.attribute.create.before This event will be fired before attribute get created
    settings.attribute.create.after This event will be fired after attribute get created
    settings.attribute.update.before This event will be fired before attribute get updated
    settings.attribute.update.after This event will be fired after attribute get updated
    settings.attribute.delete.before This event will be fired before attribute get deleted
    settings.attribute.delete.after This event will be fired after attribute get deleted
    settings.email_templates.create.before This event will be fired before email template get created
    settings.email_templates.create.after This event will be fired after email template get created
    settings.email_templates.update.before This event will be fired before email template get updated
    settings.email_templates.update.after This event will be fired after email template get updated
    settings.email_templates.delete.before This event will be fired before email template get deleted
    settings.email_templates.delete.after This event will be fired after email template get deleted
    settings.group.create.before This event will be fired before group get created
    settings.group.create.after This event will be fired after group get created
    settings.group.update.before This event will be fired before group get updated
    settings.group.update.after This event will be fired after group get updated
    settings.group.delete.before This event will be fired before group get deleted
    settings.group.delete.after This event will be fired after group get deleted
    settings.pipeline.create.before This event will be fired before pipeline get created
    settings.pipeline.create.after This event will be fired after pipeline get created
    settings.pipeline.update.before This event will be fired before pipeline get updated
    settings.pipeline.update.after This event will be fired after pipeline get updated
    settings.pipeline.delete.before This event will be fired before pipeline get deleted
    settings.pipeline.delete.after This event will be fired after pipeline get deleted
    settings.role.create.before This event will be fired before role get created
    settings.role.create.after This event will be fired after role get created
    settings.role.update.before This event will be fired before role get updated
    settings.role.update.after This event will be fired after role get updated
    settings.role.delete.before This event will be fired before role get deleted
    settings.role.delete.after This event will be fired after role get deleted
    settings.source.create.before This event will be fired before source get created
    settings.source.create.after This event will be fired after source get created
    settings.source.update.before This event will be fired before source get updated
    settings.source.update.after This event will be fired after source get updated
    settings.source.delete.before This event will be fired before source get deleted
    settings.source.delete.after This event will be fired after source get deleted
    settings.source.create.before This event will be fired before source get created
    settings.source.create.after This event will be fired after source get created
    settings.source.update.before This event will be fired before source get updated
    settings.source.update.after This event will be fired after source get updated
    settings.source.delete.before This event will be fired before source get deleted
    settings.source.delete.after This event will be fired after source get deleted
    settings.tag.create.before This event will be fired before tag get created
    settings.tag.create.after This event will be fired after tag get created
    settings.tag.update.before This event will be fired before tag get updated
    settings.tag.update.after This event will be fired after tag get updated
    settings.tag.delete.before This event will be fired before tag get deleted
    settings.tag.delete.after This event will be fired after tag get deleted
    settings.type.create.before This event will be fired before type get created
    settings.type.create.after This event will be fired after type get created
    settings.type.update.before This event will be fired before type get updated
    settings.type.update.after This event will be fired after type get updated
    settings.type.delete.before This event will be fired before type get deleted
    settings.type.delete.after This event will be fired after type get deleted
    settings.user.create.before This event will be fired before user get created
    settings.user.create.after This event will be fired after user get created
    settings.user.update.before This event will be fired before user get updated
    settings.user.update.after This event will be fired after user get updated
    settings.user.delete.before This event will be fired before user get deleted
    settings.user.delete.after This event will be fired after user get deleted
    settings.workflow.create.before This event will be fired before workflow get created
    settings.workflow.create.after This event will be fired after workflow get created
    settings.workflow.update.before This event will be fired before workflow get updated
    settings.workflow.update.after This event will be fired after workflow get updated
    settings.workflow.delete.before This event will be fired before workflow get deleted
    settings.workflow.delete.after This event will be fired after workflow get deleted
    user.account.update-password This event will be fired after user password gets updated
    settings.web_forms.create.before This event will be fired before web form get created
    settings.web_forms.create.after This event will be fired after web form get created
    settings.web_forms.update.before This event will be fired before web form get updated
    settings.web_forms.update.after This event will be fired after web form get updated
    settings.web_forms.delete.before This event will be fired before web form get deleted
    settings.web_forms.delete.after This event will be fired after web form get deleted

    # Listening to Existing Events

    Krayin uses events and listeners to implement the observer pattern, allowing you to respond to various actions and events within the application. You can listen to specific events and execute custom code when those events are triggered.

    # Registering a Listener

    Open the EventServiceProvider.php file located in the Providers directory of your Krayin application. This file is where you register event listeners.

    Inside the boot() method of EventServiceProvider.php, use the Event::listen method to register your listener. This method takes the event name and a callback function or a class method that will handle the event.

    Event::listen('lead.create.before', 'Webkul\Admin\Listeners\Leads@linkToEmail');
    -

    In the example above, we are listening to the lead.create.before event and specifying the createOrder function from the Order listener class in the Webkul\Notification\Listeners namespace.

    Replace 'lead.create.before' with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.

    By registering the listener, you have associated the createOrder function with the lead.create.before event. Whenever this event is triggered, the specified function will be executed.

    You can modify the listener function according to your requirements to perform the desired operation.

    In the example above, we are listening to the lead.create.before event and specifying the createOrder function from the Order listener class in the Webkul\Notification\Listeners namespace.

    Replace 'lead.create.before' with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.

    By registering the listener, you have associated the createOrder function with the lead.create.before event. Whenever this event is triggered, the specified function will be executed.

    You can modify the listener function according to your requirements to perform the desired operation.

    - + diff --git a/2.0/advanced/helpers.html b/2.0/advanced/helpers.html index 654d7ab..ec29992 100644 --- a/2.0/advanced/helpers.html +++ b/2.0/advanced/helpers.html @@ -9,7 +9,7 @@ - + @@ -47,7 +47,7 @@

    # Format base price

    To format the price of provided price you can use the method core()->formatBasePrice()

    core()->formatBasePrice($price);
     

    # Get the config field

    To get the config field you can use the core()->getConfigField($fieldName)

    core()->getConfigField($fieldName);
     

    # Get the config data

    To retrieve the config data you can use the method core()->getConfigData($field)

    core()->getConfigData($field);
    -

    These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.

    These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.

    - + diff --git a/2.0/advanced/index.html b/2.0/advanced/index.html index 2b8b9f0..6a70ec2 100644 --- a/2.0/advanced/index.html +++ b/2.0/advanced/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Digging Deeper

    Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.

    We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the Package Development section for a primer on creating and managing packages in Laravel.

    # Events and Event Handlers

    Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.

    # Helpers

    Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.

    # Overriding Core Models

    Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.

    - + (opens new window)

    # Digging Deeper

    Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.

    We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the Package Development section for a primer on creating and managing packages in Laravel.

    # Events and Event Handlers

    Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.

    # Helpers

    Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.

    # Overriding Core Models

    Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.

    + diff --git a/2.0/advanced/override-core-model.html b/2.0/advanced/override-core-model.html index 6f3f50a..aa9a2a3 100644 --- a/2.0/advanced/override-core-model.html +++ b/2.0/advanced/override-core-model.html @@ -9,7 +9,7 @@ - + @@ -65,7 +65,7 @@ { // } -

    Once registered, you can use dependency injection or other Laravel mechanisms to reference the interface(Webkul\Product\Contracts\Product as ProductContract) throughout your application. Laravel's service container will automatically resolve your custom model implementation (Webkul\Category\Models\Product) where the interface is referenced.

    By following this approach, you can effectively extend and override core models within Krayin using Concord, maintaining modularity and flexibility in your application's architecture.

    Once registered, you can use dependency injection or other Laravel mechanisms to reference the interface(Webkul\Product\Contracts\Product as ProductContract) throughout your application. Laravel's service container will automatically resolve your custom model implementation (Webkul\Category\Models\Product) where the interface is referenced.

    By following this approach, you can effectively extend and override core models within Krayin using Concord, maintaining modularity and flexibility in your application's architecture.

    - + diff --git a/2.0/advanced/render-event.html b/2.0/advanced/render-event.html index 39ad538..20b6971 100644 --- a/2.0/advanced/render-event.html +++ b/2.0/advanced/render-event.html @@ -9,7 +9,7 @@ - + @@ -58,7 +58,7 @@ }); } } -

    Replace 'path/to/before_content_template.blade.php' and 'path/to/after_content_template.blade.php' with the actual paths to the Blade template files you want to inject.

    WARNING

    Make sure that you have registered the EventServiceProvider in your own service provider.

    # Implementation Details

    # Considerations

    By following these steps, you can effectively leverage the view_render_event() function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.

    Replace 'path/to/before_content_template.blade.php' and 'path/to/after_content_template.blade.php' with the actual paths to the Blade template files you want to inject.

    WARNING

    Make sure that you have registered the EventServiceProvider in your own service provider.

    # Implementation Details

    # Considerations

    By following these steps, you can effectively leverage the view_render_event() function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.

    - + diff --git a/2.0/advanced/security-practice.html b/2.0/advanced/security-practice.html index 155a52c..040a455 100644 --- a/2.0/advanced/security-practice.html +++ b/2.0/advanced/security-practice.html @@ -9,7 +9,7 @@ - + @@ -51,7 +51,7 @@

    # Cross-Site Scripting Protection (X-XSS Protection)

    Set the X-XSS-Protection response header to enable browsers to detect and prevent cross-site scripting (XSS) attacks:

    X-XSS-Protection: 1; mode=block
     

    # X-Frame-Options​

    The X-Frame-Options response header protects applications against clickjacking. It specifies whether the content can be displayed within frames:

    X-Frame-Options: deny
     

    # X-Content-Type-Options​

    The X-Content-Type-Options response header forces the browser to disable MIME sniffing, preventing MIME sniffing vulnerabilities:

    X-Content-Type-Options: nosniff
    -

    # Content Security Policy (CSP)

    Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.

    # Continuous Logging And Monitoring

    Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.

    By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.

    # Content Security Policy (CSP)

    Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.

    # Continuous Logging And Monitoring

    Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.

    By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.

    - + diff --git a/2.0/api/getting-started-with-the-api.html b/2.0/api/getting-started-with-the-api.html index bbb67cb..96877a4 100644 --- a/2.0/api/getting-started-with-the-api.html +++ b/2.0/api/getting-started-with-the-api.html @@ -9,7 +9,7 @@ - + @@ -48,11 +48,11 @@ use HasApiTokens; ... } -
    - + diff --git a/2.0/api/index.html b/2.0/api/index.html index f052bf5..1e557cc 100644 --- a/2.0/api/index.html +++ b/2.0/api/index.html @@ -9,7 +9,7 @@ - + @@ -35,7 +35,7 @@ Contact Us (opens new window)

    # Krayin APIs

    # REST API

    The Krayin REST API enables seamless integration and interaction with the Krayin CRM system. It follows the REST (Representational State Transfer) architecture, providing a robust set of endpoints for managing CRM-related data.

    Key Features

    • CRUD Operations: The API supports all basic CRUD (Create, Read, Update, Delete) operations, allowing for comprehensive management of CRM data including customers, leads, contacts, and more.

    • Pagination: To enhance performance and manage large datasets efficiently, the API includes support for pagination. This helps in retrieving data in chunks rather than loading large volumes of data at once.

    Integration Capabilities: The REST API is designed to integrate seamlessly with various external systems and applications, including:

    • PWA (Progressive Web Applications): Use the API to develop PWAs that interact with the CRM, offering a modern, app-like experience on the web. Mobile Applications: Integrate with mobile apps to enable functionalities such as customer management, lead tracking, and reporting directly from the mobile interface. -Data Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.
    - +Data Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.
    + diff --git a/2.0/architecture/index.html b/2.0/architecture/index.html index 9551c84..d04fb3b 100644 --- a/2.0/architecture/index.html +++ b/2.0/architecture/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Architecture concepts

    Krayin is very easy framework to understand. The goal of this document to give you overview of how krayin works.

    We love to work with hot Opensource (opens new window) softwares so Krayin is built on technologies such as PHP (opens new window), Laravel (opens new window) and Vue.js (opens new window)

    As Krayin solution for SMEs and Enterprises for complete customer lifecycle management.

    Laravel packages are being used to separate each functionality such as Leads, Quotes, Mail, Activities, Contacts, Products Settings, etc.

    We developed and used built-in components of Vue.js

    Krayin registers useful events that are triggered on most of the pages which could enable to perform some custom operations in the application.

    - + (opens new window)

    # Architecture concepts

    Krayin is very easy framework to understand. The goal of this document to give you overview of how krayin works.

    We love to work with hot Opensource (opens new window) softwares so Krayin is built on technologies such as PHP (opens new window), Laravel (opens new window) and Vue.js (opens new window)

    As Krayin solution for SMEs and Enterprises for complete customer lifecycle management.

    Laravel packages are being used to separate each functionality such as Leads, Quotes, Mail, Activities, Contacts, Products Settings, etc.

    We developed and used built-in components of Vue.js

    Krayin registers useful events that are triggered on most of the pages which could enable to perform some custom operations in the application.

    + diff --git a/2.0/architecture/modular-design.html b/2.0/architecture/modular-design.html index 3c6c951..73c96e3 100644 --- a/2.0/architecture/modular-design.html +++ b/2.0/architecture/modular-design.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Modular Design in Krayin

    Krayin is designed with a modular architecture to enhance flexibility, scalability, and maintainability. This approach allows developers to manage and extend the application more efficiently.

    # Key Benefits of Modular Design

    1. Separation of Concerns: Modules encapsulate specific functionality, promoting a clear separation between different parts of the application.
    2. Reusability: Modules can be reused across different projects, reducing duplication of effort and speeding up development.
    3. Maintainability: Isolated modules make it easier to identify and fix bugs, and to implement new features without affecting unrelated parts of the application.
    4. Scalability: Modular design supports scaling the application by enabling the addition of new modules without major changes to the existing codebase.

    # Module Structure in Krayin

    Each module in Krayin is organized into a well-defined structure, ensuring consistency and ease of management. A typical module contains the following directories:

    • Config: Configuration files specific to the module.
    • Database: Migrations, seeders, and factories related to the module.
    • Http: Controllers, middleware, and requests handling HTTP interactions.
    • Models: Eloquent models representing the data structures used by the module.
    • Repositories: Implementation of the Repository pattern for data access.
    • Resources: Views, language files, and other resources.
    • Routes: Module-specific routes.
    • Tests: Unit and feature tests for the module.

    The modular design in Krayin facilitates a clean, organized, and scalable development process. By adhering to the principles of modular architecture, developers can create robust and maintainable applications that are easy to extend and manage.

    - + diff --git a/2.0/architecture/packages.html b/2.0/architecture/packages.html index 54b1d78..c3da5ad 100644 --- a/2.0/architecture/packages.html +++ b/2.0/architecture/packages.html @@ -9,7 +9,7 @@ - + @@ -49,7 +49,7 @@ Scheduled Actions: Set up actions to occur at a later date, such as sending a reminder email after a lead has been idle for a specific number of days. This keeps your team proactive and ensures no lead falls through the cracks.

    1. Webhooks

    Integration with External Systems: Webhooks allow Krayin CRM to communicate with other systems and applications in real-time. When a trigger event occurs, a webhook sends data to an external URL, enabling seamless integration with other tools like marketing platforms, analytics systems, or custom applications. Real-Time Updates: Automate the process of sending real-time updates to external systems when certain events happen within the CRM. For example, when a new contact is added or a deal is closed, the relevant data can be instantly pushed to other systems to keep all your tools in sync. Custom Actions: Utilize webhooks to define custom actions that go beyond the built-in capabilities of Krayin CRM. This flexibility allows you to tailor the CRM to fit the unique needs of your business.

    Service provider enables features such as loading routes, migrations, languages or publishing views, etc so Krayin is developed considering these aspects.

    # Datagrid

    The DataGrid package in Krayin empowers administrators with a versatile solution for displaying and managing tabular data within the admin panel. It incorporates crucial components like models, repositories, and database interactions to streamline data handling and enhance user experience.

    # Dynamic Data Presentation:

    # Warehouse

    The Warehouse Package in Krayin CRM is designed to manage warehouse information efficiently. It allows users to store and organize key details about each warehouse, including contact information, descriptions, and addresses. This package provides the necessary tools to handle warehouse-related data, which is crucial for managing inventory and logistics operations within the CRM.

    Key Features

    The package provides functionalities to create, update, and manage warehouses within the CRM. Each warehouse can be uniquely identified by its name and associated with specific contact information, such as email addresses, phone numbers, and physical addresses. -Contact Information Handling:

    The package supports storing multiple contact details for each warehouse, including names, emails, and phone numbers. This feature ensures that all relevant contact information is easily accessible for communication and coordination.

    The package allows you to store and manage the full address details of each warehouse, including street, city, state, and postal code. This is useful for ensuring that all logistical operations are correctly aligned with the physical locations of the warehouses.

    - + diff --git a/2.0/architecture/repository-pattern.html b/2.0/architecture/repository-pattern.html index 43c1c8c..d9d4bd6 100644 --- a/2.0/architecture/repository-pattern.html +++ b/2.0/architecture/repository-pattern.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Repository Pattern in Krayin

    Krayin employs the Repository Pattern to further enhance the flexibility and maintainability of its codebase.

    To add an additional layer of abstraction and promote better code organization, Krayin incorporates the Repository Pattern on top of the ORM.

    # Benefits of the Repository Pattern

    • Consistency: Restricts the use of raw queries throughout the application, ensuring a consistent approach to database operations.
    • Maintainability: Enhances code organization, making it easier to manage and maintain.
    • Flexibility: Facilitates the implementation of changes without affecting the rest of the codebase.

    # Implementation in Krayin

    Krayin utilizes the Prettus Repository (opens new window) package to facilitate the implementation of the Repository Pattern. This choice provides several benefits:

    • Standardization: Ensures a standardized approach to repository implementation.
    • Extensibility: Makes it easier to extend and customize the application as needed.
    • Separation of Concerns: Promotes a clear separation between business logic and data access logic.

    By adopting the Repository Pattern with the Prettus Repository package, Krayin enhances the overall architecture of the application, making it more robust and easier to evolve over time.

    # Eloquent ORM

    Eloquent (opens new window), the ORM (Object-Relational Mapping) in Laravel, provides a higher level of abstraction and simplifies database interactions. With Eloquent, developers can focus on manipulating objects rather than dealing with raw SQL queries, making database operations more convenient and intuitive.

    - + diff --git a/2.0/architecture/theme.html b/2.0/architecture/theme.html index 06d06db..9d02ab0 100644 --- a/2.0/architecture/theme.html +++ b/2.0/architecture/theme.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Theme

    CRM solution for SMEs and Enterprises, themes provides an elegant way to attract users.

    - + (opens new window)

    # Theme

    CRM solution for SMEs and Enterprises, themes provides an elegant way to attract users.

    + diff --git a/2.0/custom-attributes/custom-attribute.html b/2.0/custom-attributes/custom-attribute.html index 559e4e4..9113c80 100644 --- a/2.0/custom-attributes/custom-attribute.html +++ b/2.0/custom-attributes/custom-attribute.html @@ -9,7 +9,7 @@ - + @@ -107,7 +107,7 @@ return $product; } -
    - + diff --git a/2.0/custom-attributes/index.html b/2.0/custom-attributes/index.html index 9911a7a..b734c7a 100644 --- a/2.0/custom-attributes/index.html +++ b/2.0/custom-attributes/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Custom Attribute Creation

    Attributes helps you to store data dynamically related to any item while creating such as Person, Organization, Product and Lead creation etc.

    - + (opens new window)

    # Custom Attribute Creation

    Attributes helps you to store data dynamically related to any item while creating such as Person, Organization, Product and Lead creation etc.

    + diff --git a/2.0/custom-attributes/uses.html b/2.0/custom-attributes/uses.html index 0c36cc3..956817a 100644 --- a/2.0/custom-attributes/uses.html +++ b/2.0/custom-attributes/uses.html @@ -9,7 +9,7 @@ - + @@ -34,7 +34,7 @@ (opens new window) Contact Us (opens new window)

    # Create and using a new attribute

    Krayin CRM is a highly customizable, attribute-based CRM system that allows you to manage various entities such as leads, quotes, contacts, and more through the use of attributes. This flexibility enables you to tailor the system to meet your specific business needs.

    • Creating Attributes

    To create an attribute in Krayin, follow these steps:

    1. Navigate to the Settings:

      • In the main dashboard, go to Settings in the sidebar menu.
    2. Go to Attributes Section:

      • Under the Settings menu, select Attributes to manage existing attributes or create new ones.
    3. Create a New Attribute:

      • Click on the Create Attribute button.
      • Fill out the form with the necessary details, such as the name, code, and type of the attribute.
    4. Entity Type:

      • One of the key fields in the attribute creation form is the Entity Type. The Entity Type determines where the attribute will be applied in the system. The available entity types include: -
        1. Leads: Attributes created under this entity type will be associated with the Leads module.
        2. Person: Use this entity type to create attributes for the Person module, allowing you to manage individual contacts.
        3. Organization: Attributes for managing organizations and companies can be created under this entity type.
        4. Products: Attributes associated with products can be managed under this entity type.
        5. Quotes: If you want to manage quotes with specific attributes, select this entity type.
        6. Warehouses: This entity type is for managing warehouses and their specific attributes.
    5. Save the Attribute:

      • After filling in all the required fields, click Save. The attribute will now be available for the selected entity type.
    • Using Attributes

    Once you have created an attribute, it will appear in the respective module based on the entity type you selected during creation. For example:

    • If you created an attribute for Leads, it will be available when managing or viewing leads.
    • Similarly, attributes for Person, Organization, Products, Quotes, and Warehouses will be accessible within their corresponding entity type

    These attributes allow you to add custom fields, data types, and other specific requirements to the respective entities, making Krayin a powerful and flexible CRM solution for your business.

    • Summary

    Krayin’s attribute system provides extensive customization options, making it easy to manage various CRM entities according to your unique requirements. By selecting the appropriate Entity Type when creating an attribute, you ensure that the attribute is applied to the correct module within the CRM. This approach allows you to build a CRM system tailored to your business needs, with custom fields and data management options for leads, quotes, contacts, and more.

    - + diff --git a/2.0/introduction/docker.html b/2.0/introduction/docker.html index 9d18815..308eeb6 100644 --- a/2.0/introduction/docker.html +++ b/2.0/introduction/docker.html @@ -9,7 +9,7 @@ - + @@ -85,7 +85,7 @@

    # Accessing Krayin

    - + diff --git a/2.0/introduction/index.html b/2.0/introduction/index.html index 9df5b54..fb76e8d 100644 --- a/2.0/introduction/index.html +++ b/2.0/introduction/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Introduction

    Krayin is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window), a PHP (opens new window) framework and Vue.js (opens new window), a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    To learn more about Krayin's features and try a demo (opens new window), check out our website Krayin (opens new window).

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    - + (opens new window)

    # Introduction

    Krayin is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window), a PHP (opens new window) framework and Vue.js (opens new window), a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    To learn more about Krayin's features and try a demo (opens new window), check out our website Krayin (opens new window).

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    + diff --git a/2.0/introduction/installation.html b/2.0/introduction/installation.html index 1995a7c..4379d15 100644 --- a/2.0/introduction/installation.html +++ b/2.0/introduction/installation.html @@ -9,7 +9,7 @@ - + @@ -55,7 +55,7 @@

    # On Your Local Server

    To access Krayin on your local server, follow these steps:

    1. Configure your HTTP server to point to the public/ directory of the project.

    2. Run the following command:

      php artisan serve
       
    3. Open your browser and access the provided local server URL.

    # Login as an Admin

    To log in as an admin, visit https://example.com/admin/. If you used the php artisan krayin-crm:install command, use the following credentials:

    Email: admin@example.com
     Password: admin123
    -

    # Contributing

    Contributions are welcome! Follow the contribution guidelines to get started.

    # License

    Krayin is open-sourced software licensed under the MIT license.

    # Contributing

    Contributions are welcome! Follow the contribution guidelines to get started.

    # License

    Krayin is open-sourced software licensed under the MIT license.

    - + diff --git a/2.0/introduction/requirements.html b/2.0/introduction/requirements.html index 5630311..d610add 100644 --- a/2.0/introduction/requirements.html +++ b/2.0/introduction/requirements.html @@ -9,7 +9,7 @@ - + @@ -36,7 +36,7 @@ (opens new window)

    # Requirements

    Before installing Krayin please make sure your server meets the following requirements,

    # Server configuration

    • SERVER: Apache 2 or NGINX
    • RAM: 4GB or higher
    • Node: v16.16.0 (LTS) or higher
    • PHP: 8.1 or higher
    • Composer: 2.5 or higher

    # PHP Extensions

    Ensure the following extensions are installed and enabled. You can check using the phpinfo() page or the php -m command.

    • php-intl extension: This extension is required for internationalization support in Krayin.

    • php-gd extension: The php-gd extension must be properly installed to ensure correct image functionality in the project. If not installed correctly, image-related features may not work as expected.

      Note

      It is important to ensure proper installation of the php-gd extension to avoid any issues with image manipulation in Krayin.

    # PHP Configuration

    Open your php.ini file and modify the following settings.

    • memory_limit: Set the memory_limit directive to 4G or higher to ensure sufficient memory allocation for the application.

    • max_execution_time: Adjust the max_execution_time directive to 360 or higher. This value determines the maximum time (in seconds) a script is allowed to run. Increasing this value ensures that longer operations, such as import/export processes, can be completed successfully.

    • date.timezone: Set the date.timezone directive to your specific timezone. For example, Asia/Kolkata. This ensures that date and time-related functions work accurately based on the specified timezone.

    memory_limit = 4G
     max_execution_time = 360
     date.timezone = Asia/Kolkata <- Change this to your own timezone.
    -

    Remember to restart your web server

    Whenever you make changes to the PHP configuration file, be sure to restart Apache or NGINX to apply the modifications.

    # Supported Database Servers

    Krayin supports the following database servers:

    • MySQL: Version 8.0.32 or higher is recommended for optimal performance and compatibility.

    • MariaDB: Version 10.3 or higher is recommended for optimal performance and compatibility.

    • Database Collation: The recommended collation for the database is utf8mb4_unicode_ci, which ensures proper handling of Unicode characters and multilingual support.

    Remember to restart your web server

    Whenever you make changes to the PHP configuration file, be sure to restart Apache or NGINX to apply the modifications.

    # Supported Database Servers

    Krayin supports the following database servers:

    - + diff --git a/2.0/packages/add-menu-in-admin.html b/2.0/packages/add-menu-in-admin.html index 6abdd3a..4e5b348 100644 --- a/2.0/packages/add-menu-in-admin.html +++ b/2.0/packages/add-menu-in-admin.html @@ -9,7 +9,7 @@ - + @@ -91,7 +91,7 @@ } }

    # Optimize Application

    Finally, run the following command to optimize your application:

    php artisan optimize:clear
    -

    After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.

    # Level of Menu

    In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:

    # First Level (Sidebar)

    This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.

    # Second Level (Hover Menu)

    When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.

    After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.

    # Level of Menu

    In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:

    # First Level (Sidebar)

    This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.

    # Second Level (Hover Menu)

    When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.

    - + diff --git a/2.0/packages/assets.html b/2.0/packages/assets.html index 4133812..057d09c 100644 --- a/2.0/packages/assets.html +++ b/2.0/packages/assets.html @@ -9,7 +9,7 @@ - + @@ -161,7 +161,7 @@ <script type="text/javascript" src="{{ asset('vendor/webkul/category/assets/js/category.js') }}"></script> <script type="text/javascript" src="{{ asset('vendor/webkul/ui/assets/js/ui.js') }}"></script> -
    - + diff --git a/2.0/packages/blade-components.html b/2.0/packages/blade-components.html index a93b6f0..c6631fe 100644 --- a/2.0/packages/blade-components.html +++ b/2.0/packages/blade-components.html @@ -9,7 +9,7 @@ - + @@ -254,7 +254,7 @@ show-placeholders="true" :uploaded-images="$product->images" /> -
    - + diff --git a/2.0/packages/controllers.html b/2.0/packages/controllers.html index 060815f..26d221d 100644 --- a/2.0/packages/controllers.html +++ b/2.0/packages/controllers.html @@ -9,7 +9,7 @@ - + @@ -98,7 +98,7 @@ ├── Controller.php └── Category └── CategoryController.php -

    By following these steps, you will have created the necessary structure and files for handling category within your "Category" package. You can now add the specific logic for each method to handle the functionality required for your category into the admin.

    By following these steps, you will have created the necessary structure and files for handling category within your "Category" package. You can now add the specific logic for each method to handle the functionality required for your category into the admin.

    - + diff --git a/2.0/packages/create-acl.html b/2.0/packages/create-acl.html index 53704ca..7045710 100644 --- a/2.0/packages/create-acl.html +++ b/2.0/packages/create-acl.html @@ -9,7 +9,7 @@ - + @@ -75,7 +75,7 @@ }

    Ensure that the path specified in mergeConfigFrom matches the location of your acl.php file.

    This will merge the ACL configuration with the existing configuration.

    # Clear Configuration Cache

    After making changes, clear the configuration cache to apply the latest ACL configuration:

    php artisan optimize
     

    # Verify in Admin Panel

    Check the updated ACL configuration within the admin panel to confirm that menu items are correctly displayed and sorted according to your configuration.

    This will ensure that the latest ACL configuration is used.

    # Checking Roles and Permissions

    To manage roles and permissions effectively:

    # Access Roles

    In the Admin model located in Webkul\User\Models, utilize the relationship with the Role model to manage roles associated with users.

    # Permission Checks

    Use the bouncer() helper function to verify if a user has specific permissions. Example usage:

    bouncer()->hasPermission($permission)
    -

    Replace $permission with the actual permission you want to check.

    By following these steps, you can seamlessly configure and manage Access Control List (ACL) settings in Krayin, ensuring secure and controlled access to administrative functionalities.

    Replace $permission with the actual permission you want to check.

    By following these steps, you can seamlessly configure and manage Access Control List (ACL) settings in Krayin, ensuring secure and controlled access to administrative functionalities.

    - + diff --git a/2.0/packages/create-migrations.html b/2.0/packages/create-migrations.html index 2997477..c2b3e8c 100644 --- a/2.0/packages/create-migrations.html +++ b/2.0/packages/create-migrations.html @@ -9,7 +9,7 @@ - + @@ -97,7 +97,7 @@ } }

    # Creating Tables from Migrations

    Run the following command to create the Category table in your database.

    php artisan migrate
    -
    - + diff --git a/2.0/packages/create-models.html b/2.0/packages/create-models.html index 04287d1..18291cb 100644 --- a/2.0/packages/create-models.html +++ b/2.0/packages/create-models.html @@ -9,7 +9,7 @@ - + @@ -138,7 +138,7 @@ \Webkul\Category\Providers\ModuleServiceProvider::class, ] ]; -
    - + diff --git a/2.0/packages/create-package.html b/2.0/packages/create-package.html index 6fb666d..d1e753a 100644 --- a/2.0/packages/create-package.html +++ b/2.0/packages/create-package.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Getting Started

    # Introduction

    A package is a self-contained module that encapsulates specific features or functionality, allowing developers to add custom features without altering the core codebase. This approach not only preserves the integrity of the core system but also ensures that updates and maintenance can be carried out smoothly.

    By developing packages, you can introduce new functionalities, integrate third-party services, or customize existing features to better meet your business requirements. Each package is isolated, promoting clean code practices and enabling easier debugging and testing.

    This guide will take you through the process of creating a package for Krayin, from setting up the directory structure to defining configurations, routes, controllers, models, and views. By the end of this guide, you will have a solid understanding of how to develop and integrate packages into the Krayin platform, enhancing its capabilities while maintaining a robust and maintainable codebase.

    # Prerequisites

    • A working Krayin application
    • Composer installed

    # Using Krayin Package Generator

    To facilitate package development, you can use the Krayin Package Generator (opens new window). Follow the steps below to install it:

    • Install the Krayin Package Generator by running the following command in the root directory of your Krayin application:

      composer require krayin/krayin-package-generator
      +     (opens new window)     

      # Getting Started

      # Introduction

      A package is a self-contained module that encapsulates specific features or functionality, allowing developers to add custom features without altering the core codebase. This approach not only preserves the integrity of the core system but also ensures that updates and maintenance can be carried out smoothly.

      By developing packages, you can introduce new functionalities, integrate third-party services, or customize existing features to better meet your business requirements. Each package is isolated, promoting clean code practices and enabling easier debugging and testing.

      This guide will take you through the process of creating a package for Krayin, from setting up the directory structure to defining configurations, routes, controllers, models, and views. By the end of this guide, you will have a solid understanding of how to develop and integrate packages into the Krayin platform, enhancing its capabilities while maintaining a robust and maintainable codebase.

      # Prerequisites

      • A working Krayin application
      • Composer installed

      # Using Krayin Package Generator

      To facilitate package development, you can use the Krayin Package Generator (opens new window). Follow the steps below to install it:

      • Install the Krayin Package Generator by running the following command in the root directory of your Krayin application:

        composer require krayin/krayin-package-generator
         
      • Once installed, you can generate your package using the following command:

        We will assume that the package name is "Category".

        • If the package directory does not exist:
        php artisan package:make Webkul/Category
         
        • If the package directory already exists, you can use the --force option to overwrite it:
        php artisan package:make Webkul/Category --force
         

        This command will set up the necessary files and directories in the packages directory.

      # Registering Your Package

      To register your package, follow these steps:

      Add your package's namespace to the psr-4 section in the composer.json file located in the root directory of your Krayin application. Update it as follows:

       "autoload": {
      @@ -56,7 +56,32 @@
           
           // Other configuration options
       ];
      -

      # Run the Commands

      Run the following commands to autoload your package and publish its assets and configurations:

      composer dump-autoload
      +

      # Registering Your Package Using CLI

      # Step 1: Verify the composer.json File

      Before proceeding, ensure that your package has a valid composer.json file. This file defines your package's configuration and dependencies. Below is an example of what the composer.json file for krayin/laravel-admin should look like:

      {
      +    "name": "krayin/laravel-admin",
      +    "license": "MIT",
      +    "authors": [
      +        {
      +            "name": "Example",
      +            "email": "admin@example.com"
      +        }
      +    ],
      +    "autoload": {
      +        "psr-4": {
      +            "Webkul\\Admin\\": "src/"
      +        }
      +    },
      +    "extra": {
      +        "laravel": {
      +            "providers": [
      +                "Webkul\\Admin\\Providers\\AdminServiceProvider"
      +            ],
      +            "aliases": {}
      +        }
      +    },
      +    "minimum-stability": "dev"
      +}
      +

      # Key Elements of the composer.json File

      • Package Name: "krayin/laravel-admin" – The name of the package to be installed.
      • License: "MIT" – Defines the license for the package.
      • Authors: Information about the package authors, such as name and email.
      • Autoloading:
        • "psr-4" autoloading is used to map the Webkul\Admin namespace to the src/ directory.
      • Providers: The AdminServiceProvider is listed as a provider to be registered with Laravel automatically.
      • Minimum Stability: Set to "dev" to allow development versions of the package to be installed.

      # Step 2: Install the Package Locally

      Once the composer.json file is set up, you can install the package locally via Composer's command-line interface.

      Run the following command:

      composer require krayin/laravel-admin dev-master
      +

      This command tells Composer to require the krayin/laravel-admin package and install it along with any other dependencies listed in the package's composer.json.

      # Run the Commands

      Run the following commands to autoload your package and publish its assets and configurations:

      composer dump-autoload
       php artisan optimize
       php artisan vendor:publish --provider=Webkul\Category\Providers\CategoryServiceProvider
       

      When prompted to select which items to publish, choose the number corresponding to "Webkul\Category\Providers\CategoryServiceProvider" and press enter to publish all assets and configurations.

      Congratulations! Your package is now registered and ready to use. Start creating something cool!

      # Manual Setup of Files

      If you prefer to set up your package manually, follow these steps assuming you are familiar with package directory structures and workflows. We'll use the default package directory in Krayin as an example.

      # Create Package Directory

      Inside the packages/Webkul directory, create a directory with your package name. Your structure should look like this:

      └── packages
      @@ -123,7 +148,7 @@
           // ...
       ];
       

      # Run the Commands

      Run the following command to autoload your package:

         composer dump-autoload
      -

      Your package is now ready to use !

      Your package is now ready to use !

    - + diff --git a/2.0/packages/datagrid.html b/2.0/packages/datagrid.html index 181e6ee..a3f58b4 100644 --- a/2.0/packages/datagrid.html +++ b/2.0/packages/datagrid.html @@ -9,7 +9,7 @@ - + @@ -215,7 +215,7 @@ ]); } } -
    - + diff --git a/2.0/packages/index.html b/2.0/packages/index.html index 364fe99..eb5745b 100644 --- a/2.0/packages/index.html +++ b/2.0/packages/index.html @@ -9,7 +9,7 @@ - + @@ -86,7 +86,7 @@ ├── index.blade.php ├── create.blade.php └── edit.blade.php -
    - +
    + diff --git a/2.0/packages/layouts.html b/2.0/packages/layouts.html index 4cb4580..1766a56 100644 --- a/2.0/packages/layouts.html +++ b/2.0/packages/layouts.html @@ -9,7 +9,7 @@ - + @@ -56,7 +56,7 @@ // </script> @endpush -
    Prop Name Description
    @extends('category::layouts.master') This @extends Blade directive to specify which layout the child view should "inherit"
    @section('page_title') This is used to define the title of the page.
    @section('content-wrapper') This is used to define the body of the page.
    @push('css') This is used to add additional css.
    @push('scripts') This is used to add additional javascript.

    WARNING

    Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in lang/app.php.

    If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside Resources\Views\Layouts\master.blade.php

    Prop Name Description
    @extends('category::layouts.master') This @extends Blade directive to specify which layout the child view should "inherit"
    @section('page_title') This is used to define the title of the page.
    @section('content-wrapper') This is used to define the body of the page.
    @push('css') This is used to add additional css.
    @push('scripts') This is used to add additional javascript.

    WARNING

    Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in lang/app.php.

    If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside Resources\Views\Layouts\master.blade.php

    - + diff --git a/2.0/packages/localization.html b/2.0/packages/localization.html index 99664bd..48d567c 100644 --- a/2.0/packages/localization.html +++ b/2.0/packages/localization.html @@ -9,7 +9,7 @@ - + @@ -99,7 +99,7 @@ } }

    # Explanation

    # Use Translations in Blade Files

    In your Blade templates (.blade.php files), you can use the @lang helper function to retrieve translations. Use the namespace 'category' followed by the translation key. For example:

    @lang('category::categories.index.title')
    -

    # Explanation

    By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.

    # Explanation

    By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.

    - + diff --git a/2.0/packages/routes.html b/2.0/packages/routes.html index 1b10e1e..7723583 100644 --- a/2.0/packages/routes.html +++ b/2.0/packages/routes.html @@ -9,7 +9,7 @@ - + @@ -91,7 +91,7 @@ Route::delete('categories/{id}', [CategoryController::class, 'destroy']);

    # PATCH

    The PATCH method is similar to PUT, but it is used to make partial updates to data on the server.

    // Define a route that responds to a PATCH request
     Route::patch('categories/{id}', [CategoryController::class, 'partialUpdate']);
    -
    - + diff --git a/2.0/packages/store-data-through-repositories.html b/2.0/packages/store-data-through-repositories.html index 51820d6..4e1ef28 100644 --- a/2.0/packages/store-data-through-repositories.html +++ b/2.0/packages/store-data-through-repositories.html @@ -9,7 +9,7 @@ - + @@ -76,7 +76,7 @@

    # FindWhere

    The findWhere method is called on the categoryRepository instance. This method adds a query constraint to filter the results based on a specified condition.

    $categories = $this->categoryRepository->findWhere([
         'status' => 'active',
     ]);
    -

    The model() method within CategoryRepository.php returns the path of your contract class (CategoryContract in this example). This method initializes the model instance used throughout the repository for database interactions.

    Your CategoryRepository is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.

    By utilizing the CategoryRepository, you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.

    The model() method within CategoryRepository.php returns the path of your contract class (CategoryContract in this example). This method initializes the model instance used throughout the repository for database interactions.

    Your CategoryRepository is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.

    By utilizing the CategoryRepository, you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.

    - + diff --git a/2.0/packages/validation.html b/2.0/packages/validation.html index e5d4215..8d4ea34 100644 --- a/2.0/packages/validation.html +++ b/2.0/packages/validation.html @@ -9,7 +9,7 @@ - + @@ -97,7 +97,7 @@ <input v-validate="'required|email'" name="email" type="text"> <input v-validate="'required|min:6'" type="password" name="password"> -
    - + diff --git a/2.0/packages/views.html b/2.0/packages/views.html index df33156..e5a528e 100644 --- a/2.0/packages/views.html +++ b/2.0/packages/views.html @@ -9,7 +9,7 @@ - + @@ -103,7 +103,7 @@ return view('category::category.index', compact('categories')); } } -

    # Explanation

    # Blade File Naming Convention

    Krayin utilizes Blade templates to handle listing, creation, and updating operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.

    # Listing (Index Blade):

    # Creation (Create Blade):

    # Updating (Edit Blade):

    By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.

    # Explanation

    # Blade File Naming Convention

    Krayin utilizes Blade templates to handle listing, creation, and updating operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.

    # Listing (Index Blade):

    # Creation (Create Blade):

    # Updating (Edit Blade):

    By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.

    - + diff --git a/2.0/prologue/contribution-guide.html b/2.0/prologue/contribution-guide.html index c466321..765d5d2 100644 --- a/2.0/prologue/contribution-guide.html +++ b/2.0/prologue/contribution-guide.html @@ -9,7 +9,7 @@ - + @@ -45,7 +45,7 @@ { // } -
    - + diff --git a/2.0/prologue/index.html b/2.0/prologue/index.html index a95b3f1..f24234b 100644 --- a/2.0/prologue/index.html +++ b/2.0/prologue/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Prologue

    # Introduction to Krayin

    Krayin (opens new window) CRM is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window) (a PHP framework), Tailwind Css (opens new window) and Vue.js (opens new window) a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    We also have a forum for any type of concerns, feature requests, or discussions. Try our demo (opens new window) or you can visit: Krayin (opens new window)

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    - + (opens new window)

    # Prologue

    # Introduction to Krayin

    Krayin (opens new window) CRM is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window) (a PHP framework), Tailwind Css (opens new window) and Vue.js (opens new window) a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    We also have a forum for any type of concerns, feature requests, or discussions. Try our demo (opens new window) or you can visit: Krayin (opens new window)

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    + diff --git a/2.0/prologue/upgrade-guide.html b/2.0/prologue/upgrade-guide.html index b2e5ed5..7f11a92 100644 --- a/2.0/prologue/upgrade-guide.html +++ b/2.0/prologue/upgrade-guide.html @@ -9,7 +9,7 @@ - + @@ -44,11 +44,11 @@
  • Copy the contents of the previous version's dictory (e.g., old-project/storage/app/public) to the corresponding dictory in the latest version (e.g., new-project/storage/app/public).

    TIP

    If your existing project depends on local storage, has changed paths, or requires previous logs, ensure to include those as well.

  • Once the copying is complete, publish the new files by running the following command:

    php artisan vendor:publish --all
     

    WARNING

    Avoid using the --force flag, as it will reset all your views. Only use it if you understand the consequences.

  • Congratulations! Your project is now upgraded to the latest version of Krayin. However, keep in mind that if you have made significant customizations, ensure compatibility with the latest version.

  • # New Changes

    The following changes have been implemented in Krayin from version 1.3.0 to 2.0:

    For more information, please visit the Krayin changelog on GitHub (opens new window).

    # Changes in the latest release

    We are excited to announce the release of version 2.0 (opens new window) of Krayin, which includes numerous enhancements and improvements. To ensure a smooth transition to this latest version.

    # Composer Dependencies

    # Composer Dependencies

    This documentation compares the dependencies between the old and latest versions of a Laravel-based project and provides guidance on the differences and upgrade paths.

    # Differences in Composer Dependencies

    Here’s a detailed comparison between the two projects:

    Dependency Old Project Version Latest Project Version Difference/Notes
    PHP ^8.1 ^8.1 No change
    barryvdh/laravel-dompdf ^2.0.0 ^2.0.0 No change
    diglactic/laravel-breadcrumbs ^8.0 ^8.0 No change
    doctrine/dbal ^3.0 ^3.0 No change
    guzzlehttp/guzzle ^7.0.1 ^7.0.1 No change
    khaled.alshamaa/ar-php Not Present ^6.3 Newly added in the latest project.
    konekt/concord ^1.10 ^1.10 No change
    krayin/rest-api dev-master Removed The krayin/rest-api package is not included in the latest project.
    laravel/framework ^10.0 ^10.0 No change
    laravel/sanctum ^3.2 ^3.2 No change
    laravel/tinker ^2.5 ^2.5 No change
    laravel/ui ^4.0 ^4.5 Upgraded from ^4.0 to ^4.5
    maatwebsite/excel ^3.1 ^3.1 No change
    mpdf/mpdf Not Present ^8.2 Newly added in the latest project.
    prettus/l5-repository ^2.7.9 ^2.7.9 No change

    # Differences in Development Dependencies

    Dependency Old Project Version Latest Project Version Difference/Notes
    barryvdh/laravel-debugbar ^3.6 ^3.6 No change
    fakerphp/faker ^1.9.1 ^1.9.1 No change
    krayin/krayin-package-generator dev-master dev-master No change
    laravel/pint Not Present ^1.16 Newly added in the latest project.
    laravel/sail ^1.0.1 ^1.0.1 No change
    mockery/mockery ^1.4.2 ^1.4.2 No change
    nunomaduro/collision ^7.0 ^7.0 No change
    pestphp/pest ^2.6 ^2.6 No change
    pestphp/pest-plugin-laravel ^2.1 ^2.1 No change
    phpunit/phpunit ^10.0 ^10.0 No change
    spatie/laravel-ignition ^2.0 ^2.0 No change

    # Differences in Autoloading

    # Summary of Changes

    1. Removed Packages:

      • krayin/rest-api has been removed in the latest project.
    2. Added Packages:

      • khaled.alshamaa/ar-php was added in the latest project.
      • mpdf/mpdf was added in the latest project.
      • laravel/pint was added as a new development dependency.
    3. Updated Packages:

      • laravel/ui was upgraded from version ^4.0 to ^4.5.
    4. New Autoloaded Packages:

      • Added new autoload paths for Webkul\\Warehouse, Webkul\\Automation, and Webkul\\DataGrid.

    # Upgrade Instructions

    To upgrade your project to the latest dependencies, follow these steps:

    1. Update composer.json:

      • Replace the old package list with the updated one provided in the latest project.
    2. Run Composer Update:

      • Execute the following command to update your dependencies:
        composer update
         
    3. Verify Autoloading:

      • Ensure that the new autoload paths are properly configured by running:
        composer dump-autoload
        -
    4. Test Your Project:

      • After updating dependencies, thoroughly test your project to ensure that the changes do not introduce any issues.

    # Conclusion

    By following these instructions, your project will be updated to use the latest dependencies and autoload configurations. Ensure that you perform adequate testing after the update to confirm everything is functioning as expected.

  • Test Your Project:

    • After updating dependencies, thoroughly test your project to ensure that the changes do not introduce any issues.
  • # Conclusion

    By following these instructions, your project will be updated to use the latest dependencies and autoload configurations. Ensure that you perform adequate testing after the update to confirm everything is functioning as expected.

    - + diff --git a/404.html b/404.html index 78a23aa..f9ebce5 100644 --- a/404.html +++ b/404.html @@ -9,12 +9,12 @@ - +

    Page not found.

    ! WARNING Page Not Found
    This page does not exist for this version of Krayin but was found in other versions.
    - + diff --git a/assets/js/101.ccf514f9.js b/assets/js/101.77311efb.js similarity index 99% rename from assets/js/101.ccf514f9.js rename to assets/js/101.77311efb.js index bac7983..7d666df 100644 --- a/assets/js/101.ccf514f9.js +++ b/assets/js/101.77311efb.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[101],{402:function(e,t,s){"use strict";s.r(t);var a=s(10),r=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events"}},[e._v("#")]),e._v(" Events")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#creating-an-event-class"}},[e._v("Creating an Event Class")]),t("ul",[t("li",[t("a",{attrs:{href:"#using-package-generator"}},[e._v("Using Package Generator")])]),t("li",[t("a",{attrs:{href:"#manually-registering-events"}},[e._v("Manually Registering Events")])]),t("li",[t("a",{attrs:{href:"#manually-registering-listeners"}},[e._v("Manually Registering Listeners")])])])]),t("li",[t("a",{attrs:{href:"#specifying-events"}},[e._v("Specifying Events")])]),t("li",[t("a",{attrs:{href:"#events-fired-in-krayin"}},[e._v("Events Fired in Krayin")])]),t("li",[t("a",{attrs:{href:"#listening-to-existing-events"}},[e._v("Listening to Existing Events")]),t("ul",[t("li",[t("a",{attrs:{href:"#registering-a-listener"}},[e._v("Registering a Listener")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Event Listeners in Krayin are a way to implement the observer pattern, where listeners respond to events that occur in the application. Events can be thought of as announcements made by the application, and listeners are the actions taken in response to those announcements. All event classes in Krayin are stored in the "),t("code",[e._v("Providers")]),e._v(" directory, and the listeners are stored in the "),t("code",[e._v("Listeners")]),e._v(" directory.")]),e._v(" "),t("p",[e._v("In Krayin, events and listeners are organized in a clear and structured manner:")]),e._v(" "),t("ul",[t("li",[e._v("Events are typically stored in the Events directory.")]),e._v(" "),t("li",[e._v("Listeners are stored in the Listeners directory.")])]),e._v(" "),t("p",[e._v("This organization makes it easy to manage and locate the event-driven components of your application.")]),e._v(" "),t("p",[e._v("To learn in detail about Controllers, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/events",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"creating-an-event-class"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-an-event-class"}},[e._v("#")]),e._v(" Creating an Event Class")]),e._v(" "),t("h3",{attrs:{id:"using-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-package-generator"}},[e._v("#")]),e._v(" Using Package Generator")]),e._v(" "),t("p",[e._v("If you have the Krayin Package Generator installed, you can use the following command to create a new event class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category\n")])])]),t("p",[e._v("If the event class already exists, you can use the --force option to overwrite it:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--force")]),e._v("\n")])])]),t("p",[e._v("Alternatively, if you don't have the package generator, you can create the file manually by creating a new class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-events"}},[e._v("#")]),e._v(" Manually Registering Events")]),e._v(" "),t("p",[e._v("In Krayin, you register events manually in the "),t("code",[e._v("boot")]),e._v(" method of your "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file. Here is an example of how to register events:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Register any other events for your application.\n *\n * @return void\n */")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'event.name'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'path-upto-listener@function'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, "),t("code",[e._v("event.name")]),e._v(" is the name of the event, and "),t("code",[e._v("path-upto-listener@function")]),e._v(" is the listener method that will handle the event.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-listeners"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-listeners"}},[e._v("#")]),e._v(" Manually Registering Listeners")]),e._v(" "),t("p",[e._v("When registering events, you specify the listener function to be executed when an event is triggered. Here is an example of how to register a listener:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("EventServiceProvider")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ServiceProvider")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Bootstrap services.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, the "),t("code",[e._v("lead.create.after")]),e._v(" event will trigger the "),t("code",[e._v("linkToEmail")]),e._v(" method of the "),t("code",[e._v("Leads")]),e._v(" listener in the "),t("code",[e._v("Webkul\\Admin\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("h2",{attrs:{id:"specifying-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specifying-events"}},[e._v("#")]),e._v(" Specifying Events")]),e._v(" "),t("p",[e._v("In Krayin, events are typically fired before and after the execution of CRUD operations. This allows listeners to perform additional actions, such as logging, notifications, or data manipulation, at specific points in the lifecycle of an operation.")]),e._v(" "),t("p",[e._v("For example, you might have events fired during product creation, updating, or deletion. Here’s an example of firing events before and after saving an order:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("namespace")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Sales"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Repositories")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("use")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Admin"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Http"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Requests"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("LeadForm")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("LeadController")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Repository")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Create a new controller instance.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("__construct")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("protected")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadRepository")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$leadRepository")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'entity_type'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'leads'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Store a newly created resource in storage.\n * \n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("store")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadForm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("stageRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("findOrFail")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("lead_pipeline_id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("else")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("pipelineRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("getDefaultPipeline")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("stages")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("first")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("in_array")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("code")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'won'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lost'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'closed_at'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Carbon")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("now")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("leadRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("session")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("flash")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("trans")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin::app.leads.create-success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("redirect")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("route")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin.leads.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("h2",{attrs:{id:"events-fired-in-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-fired-in-krayin"}},[e._v("#")]),e._v(" Events Fired in Krayin")]),e._v(" "),t("p",[e._v("In Krayin, there are several events fired throughout its operations, allowing developers to hook into specific points in the application's lifecycle to customize behavior or add functionality. Here's a list of events that are fired in Krayin, which you can listen to and handle as needed by creating event listeners:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Events name")]),e._v(" "),t("th",[e._v("Functionality")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("activity.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.before")]),e._v(" "),t("td",[e._v("This event will be fired before configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.after")]),e._v(" "),t("td",[e._v("This event will be fired after configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization created .")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("user.account.update-password")]),e._v(" "),t("td",[e._v("This event will be fired after user password gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get deleted")])])])]),e._v(" "),t("h2",{attrs:{id:"listening-to-existing-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-existing-events"}},[e._v("#")]),e._v(" Listening to Existing Events")]),e._v(" "),t("p",[e._v("Krayin uses events and listeners to implement the observer pattern, allowing you to respond to various actions and events within the application. You can listen to specific events and execute custom code when those events are triggered.")]),e._v(" "),t("h3",{attrs:{id:"registering-a-listener"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#registering-a-listener"}},[e._v("#")]),e._v(" Registering a Listener")]),e._v(" "),t("p",[e._v("Open the "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file located in the "),t("code",[e._v("Providers")]),e._v(" directory of your Krayin application. This file is where you register event listeners.")]),e._v(" "),t("p",[e._v("Inside the "),t("code",[e._v("boot()")]),e._v(" method of "),t("code",[e._v("EventServiceProvider.php")]),e._v(", use the "),t("code",[e._v("Event::listen")]),e._v(" method to register your listener. This method takes the event name and a callback function or a class method that will handle the event.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])]),t("p",[e._v("In the example above, we are listening to the "),t("code",[e._v("lead.create.before")]),e._v(" event and specifying the "),t("code",[e._v("createOrder")]),e._v(" function from the "),t("code",[e._v("Order")]),e._v(" listener class in the "),t("code",[e._v("Webkul\\Notification\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("p",[e._v("Replace "),t("code",[e._v("'lead.create.before'")]),e._v(" with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.")]),e._v(" "),t("p",[e._v("By registering the listener, you have associated the "),t("strong",[t("code",[e._v("createOrder")])]),e._v(" function with the "),t("strong",[t("code",[e._v("lead.create.before")])]),e._v(" event. Whenever this event is triggered, the specified function will be executed.")]),e._v(" "),t("p",[e._v("You can modify the listener function according to your requirements to perform the desired operation.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[101],{399:function(e,t,s){"use strict";s.r(t);var a=s(10),r=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events"}},[e._v("#")]),e._v(" Events")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#creating-an-event-class"}},[e._v("Creating an Event Class")]),t("ul",[t("li",[t("a",{attrs:{href:"#using-package-generator"}},[e._v("Using Package Generator")])]),t("li",[t("a",{attrs:{href:"#manually-registering-events"}},[e._v("Manually Registering Events")])]),t("li",[t("a",{attrs:{href:"#manually-registering-listeners"}},[e._v("Manually Registering Listeners")])])])]),t("li",[t("a",{attrs:{href:"#specifying-events"}},[e._v("Specifying Events")])]),t("li",[t("a",{attrs:{href:"#events-fired-in-krayin"}},[e._v("Events Fired in Krayin")])]),t("li",[t("a",{attrs:{href:"#listening-to-existing-events"}},[e._v("Listening to Existing Events")]),t("ul",[t("li",[t("a",{attrs:{href:"#registering-a-listener"}},[e._v("Registering a Listener")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Event Listeners in Krayin are a way to implement the observer pattern, where listeners respond to events that occur in the application. Events can be thought of as announcements made by the application, and listeners are the actions taken in response to those announcements. All event classes in Krayin are stored in the "),t("code",[e._v("Providers")]),e._v(" directory, and the listeners are stored in the "),t("code",[e._v("Listeners")]),e._v(" directory.")]),e._v(" "),t("p",[e._v("In Krayin, events and listeners are organized in a clear and structured manner:")]),e._v(" "),t("ul",[t("li",[e._v("Events are typically stored in the Events directory.")]),e._v(" "),t("li",[e._v("Listeners are stored in the Listeners directory.")])]),e._v(" "),t("p",[e._v("This organization makes it easy to manage and locate the event-driven components of your application.")]),e._v(" "),t("p",[e._v("To learn in detail about Controllers, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/events",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"creating-an-event-class"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-an-event-class"}},[e._v("#")]),e._v(" Creating an Event Class")]),e._v(" "),t("h3",{attrs:{id:"using-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-package-generator"}},[e._v("#")]),e._v(" Using Package Generator")]),e._v(" "),t("p",[e._v("If you have the Krayin Package Generator installed, you can use the following command to create a new event class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category\n")])])]),t("p",[e._v("If the event class already exists, you can use the --force option to overwrite it:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--force")]),e._v("\n")])])]),t("p",[e._v("Alternatively, if you don't have the package generator, you can create the file manually by creating a new class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-events"}},[e._v("#")]),e._v(" Manually Registering Events")]),e._v(" "),t("p",[e._v("In Krayin, you register events manually in the "),t("code",[e._v("boot")]),e._v(" method of your "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file. Here is an example of how to register events:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Register any other events for your application.\n *\n * @return void\n */")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'event.name'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'path-upto-listener@function'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, "),t("code",[e._v("event.name")]),e._v(" is the name of the event, and "),t("code",[e._v("path-upto-listener@function")]),e._v(" is the listener method that will handle the event.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-listeners"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-listeners"}},[e._v("#")]),e._v(" Manually Registering Listeners")]),e._v(" "),t("p",[e._v("When registering events, you specify the listener function to be executed when an event is triggered. Here is an example of how to register a listener:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("EventServiceProvider")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ServiceProvider")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Bootstrap services.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, the "),t("code",[e._v("lead.create.after")]),e._v(" event will trigger the "),t("code",[e._v("linkToEmail")]),e._v(" method of the "),t("code",[e._v("Leads")]),e._v(" listener in the "),t("code",[e._v("Webkul\\Admin\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("h2",{attrs:{id:"specifying-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specifying-events"}},[e._v("#")]),e._v(" Specifying Events")]),e._v(" "),t("p",[e._v("In Krayin, events are typically fired before and after the execution of CRUD operations. This allows listeners to perform additional actions, such as logging, notifications, or data manipulation, at specific points in the lifecycle of an operation.")]),e._v(" "),t("p",[e._v("For example, you might have events fired during product creation, updating, or deletion. Here’s an example of firing events before and after saving an order:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("namespace")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Sales"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Repositories")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("use")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Admin"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Http"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Requests"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("LeadForm")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("LeadController")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Repository")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Create a new controller instance.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("__construct")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("protected")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadRepository")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$leadRepository")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'entity_type'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'leads'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Store a newly created resource in storage.\n * \n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("store")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadForm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("stageRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("findOrFail")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("lead_pipeline_id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("else")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("pipelineRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("getDefaultPipeline")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("stages")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("first")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("in_array")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("code")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'won'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lost'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'closed_at'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Carbon")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("now")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("leadRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("session")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("flash")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("trans")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin::app.leads.create-success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("redirect")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("route")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin.leads.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("h2",{attrs:{id:"events-fired-in-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-fired-in-krayin"}},[e._v("#")]),e._v(" Events Fired in Krayin")]),e._v(" "),t("p",[e._v("In Krayin, there are several events fired throughout its operations, allowing developers to hook into specific points in the application's lifecycle to customize behavior or add functionality. Here's a list of events that are fired in Krayin, which you can listen to and handle as needed by creating event listeners:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Events name")]),e._v(" "),t("th",[e._v("Functionality")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("activity.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.before")]),e._v(" "),t("td",[e._v("This event will be fired before configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.after")]),e._v(" "),t("td",[e._v("This event will be fired after configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization created .")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("user.account.update-password")]),e._v(" "),t("td",[e._v("This event will be fired after user password gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get deleted")])])])]),e._v(" "),t("h2",{attrs:{id:"listening-to-existing-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-existing-events"}},[e._v("#")]),e._v(" Listening to Existing Events")]),e._v(" "),t("p",[e._v("Krayin uses events and listeners to implement the observer pattern, allowing you to respond to various actions and events within the application. You can listen to specific events and execute custom code when those events are triggered.")]),e._v(" "),t("h3",{attrs:{id:"registering-a-listener"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#registering-a-listener"}},[e._v("#")]),e._v(" Registering a Listener")]),e._v(" "),t("p",[e._v("Open the "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file located in the "),t("code",[e._v("Providers")]),e._v(" directory of your Krayin application. This file is where you register event listeners.")]),e._v(" "),t("p",[e._v("Inside the "),t("code",[e._v("boot()")]),e._v(" method of "),t("code",[e._v("EventServiceProvider.php")]),e._v(", use the "),t("code",[e._v("Event::listen")]),e._v(" method to register your listener. This method takes the event name and a callback function or a class method that will handle the event.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])]),t("p",[e._v("In the example above, we are listening to the "),t("code",[e._v("lead.create.before")]),e._v(" event and specifying the "),t("code",[e._v("createOrder")]),e._v(" function from the "),t("code",[e._v("Order")]),e._v(" listener class in the "),t("code",[e._v("Webkul\\Notification\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("p",[e._v("Replace "),t("code",[e._v("'lead.create.before'")]),e._v(" with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.")]),e._v(" "),t("p",[e._v("By registering the listener, you have associated the "),t("strong",[t("code",[e._v("createOrder")])]),e._v(" function with the "),t("strong",[t("code",[e._v("lead.create.before")])]),e._v(" event. Whenever this event is triggered, the specified function will be executed.")]),e._v(" "),t("p",[e._v("You can modify the listener function according to your requirements to perform the desired operation.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/102.2c20d1a1.js b/assets/js/102.e1553a76.js similarity index 99% rename from assets/js/102.2c20d1a1.js rename to assets/js/102.e1553a76.js index ec643a1..969db0c 100644 --- a/assets/js/102.2c20d1a1.js +++ b/assets/js/102.e1553a76.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[102],{399:function(t,e,a){"use strict";a.r(e);var s=a(10),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"helpers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#helpers"}},[t._v("#")]),t._v(" Helpers")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#core-helpers"}},[t._v("Core Helpers")]),e("ul",[e("li",[e("a",{attrs:{href:"#get-the-lists-of-timezone"}},[t._v("Get the lists of timezone")])]),e("li",[e("a",{attrs:{href:"#get-the-list-of-available-locals"}},[t._v("Get the list of available locals")])]),e("li",[e("a",{attrs:{href:"#get-the-list-of-countries"}},[t._v("Get the list of countries")])]),e("li",[e("a",{attrs:{href:"#get-the-country-name"}},[t._v("Get the country name")])]),e("li",[e("a",{attrs:{href:"#get-the-available-states-associated-with-country-code"}},[t._v("Get the available states associated with country code")])]),e("li",[e("a",{attrs:{href:"#get-the-specified-state-name-associated-with-state-code"}},[t._v("Get the specified state name associated with state code")])]),e("li",[e("a",{attrs:{href:"#get-the-grouped-the-states-by-the-countries"}},[t._v("Get the Grouped the states by the countries")])]),e("li",[e("a",{attrs:{href:"#create-singleton-object-through-single-facade"}},[t._v("Create singleton object through single facade")])]),e("li",[e("a",{attrs:{href:"#format-date"}},[t._v("Format Date")])]),e("li",[e("a",{attrs:{href:"#return-currency-symbol-from-currency-code"}},[t._v("Return currency symbol from currency code")])]),e("li",[e("a",{attrs:{href:"#format-base-price"}},[t._v("Format base price")])]),e("li",[e("a",{attrs:{href:"#get-the-config-field"}},[t._v("Get the config field")])]),e("li",[e("a",{attrs:{href:"#get-the-config-data"}},[t._v("Get the config data")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Krayin provides a range of helper methods in its packages to streamline and simplify the development process. These helpers are designed to offer utility functions that facilitate common tasks, reducing the amount of boilerplate code developers need to write and enhancing overall productivity.")]),t._v(" "),e("h2",{attrs:{id:"core-helpers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#core-helpers"}},[t._v("#")]),t._v(" Core Helpers")]),t._v(" "),e("p",[t._v("The core helper methods are part of the Core class in the "),e("code",[t._v("Webkul\\Core")]),t._v(" namespace. These methods provide essential functionality that can be utilized across different parts of the application, making development more efficient and consistent. Let's explore some common methods:")]),t._v(" "),e("h3",{attrs:{id:"get-the-lists-of-timezone"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-lists-of-timezone"}},[t._v("#")]),t._v(" Get the lists of timezone")]),t._v(" "),e("p",[t._v("To retrieve a list of timezones in the CRM, you can use the "),e("code",[t._v("core()->timezones()")]),t._v(" method, which returns the list of timezones.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("timezones")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-list-of-available-locals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-list-of-available-locals"}},[t._v("#")]),t._v(" Get the list of available locals")]),t._v(" "),e("p",[t._v("To retrieve a list of available local in the CRM, you can use the "),e("code",[t._v("core()->locales()")]),t._v(" method, which return the list of available locales")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("locales")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-list-of-countries"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-list-of-countries"}},[t._v("#")]),t._v(" Get the list of countries")]),t._v(" "),e("p",[t._v("To retrieve a list of countries in the CRM, you can use the "),e("code",[t._v("core()->countries()")]),t._v(" method, which returns the list of all countries within the CRM.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("countries")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-country-name"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-country-name"}},[t._v("#")]),t._v(" Get the country name")]),t._v(" "),e("p",[t._v("To retrieve the country name by its country code, you can use the "),e("code",[t._v("core()->country_name($code)")]),t._v(" method, which returns the name of the country associated with the specified country code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("country_name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-available-states-associated-with-country-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-available-states-associated-with-country-code"}},[t._v("#")]),t._v(" Get the available states associated with country code")]),t._v(" "),e("p",[t._v("To retrieve a list of states associated with states in the CRM, you can use the "),e("code",[t._v("core()->states($countryCode)")]),t._v(" method, which returns the all states associated with the country code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("states")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$countryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-specified-state-name-associated-with-state-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-specified-state-name-associated-with-state-code"}},[t._v("#")]),t._v(" Get the specified state name associated with state code")]),t._v(" "),e("p",[t._v("To retrieve the state name by its state code, you can use the "),e("code",[t._v("core()->state_name($code)")]),t._v(" method, which returns the name of the state name associated with the specified state code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("state_name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-grouped-the-states-by-the-countries"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-grouped-the-states-by-the-countries"}},[t._v("#")]),t._v(" Get the Grouped the states by the countries")]),t._v(" "),e("p",[t._v("To retrieve the grouped the states by the countries, you can use the "),e("code",[t._v("core()->findStateByCountryCode($countryCode, $stateCode)")]),t._v(" which takes two argument "),e("code",[t._v("$countryCode")]),t._v(" and "),e("code",[t._v("$stateCode")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findStateByCountryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$countryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$stateCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"create-singleton-object-through-single-facade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-singleton-object-through-single-facade"}},[t._v("#")]),t._v(" Create singleton object through single facade")]),t._v(" "),e("p",[t._v("You can use the core method for singleton binding through the core helper methods.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSingletonInstance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$className")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("h3",{attrs:{id:"format-date"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#format-date"}},[t._v("#")]),t._v(" Format Date")]),t._v(" "),e("p",[t._v("You can use "),e("code",[t._v("core()->formatDate($date, $format = 'd M Y h:iA')")]),t._v(" method to format the provided date, you can modify the format date structure by passing second argument.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("formatDate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$date")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$format")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"return-currency-symbol-from-currency-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-currency-symbol-from-currency-code"}},[t._v("#")]),t._v(" Return currency symbol from currency code")]),t._v(" "),e("p",[t._v("To get the symbol of current currency int the crm you can use the method of core helper")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("currencySymbol")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"format-base-price"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#format-base-price"}},[t._v("#")]),t._v(" Format base price")]),t._v(" "),e("p",[t._v("To format the price of provided price you can use the method "),e("code",[t._v("core()->formatBasePrice()")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("formatBasePrice")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$price")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-config-field"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-config-field"}},[t._v("#")]),t._v(" Get the config field")]),t._v(" "),e("p",[t._v("To get the config field you can use the "),e("code",[t._v("core()->getConfigField($fieldName)")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConfigField")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$fieldName")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-config-data"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-config-data"}},[t._v("#")]),t._v(" Get the config data")]),t._v(" "),e("p",[t._v("To retrieve the config data you can use the method "),e("code",[t._v("core()->getConfigData($field)")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConfigData")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$field")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[102],{400:function(t,e,a){"use strict";a.r(e);var s=a(10),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"helpers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#helpers"}},[t._v("#")]),t._v(" Helpers")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#core-helpers"}},[t._v("Core Helpers")]),e("ul",[e("li",[e("a",{attrs:{href:"#get-the-lists-of-timezone"}},[t._v("Get the lists of timezone")])]),e("li",[e("a",{attrs:{href:"#get-the-list-of-available-locals"}},[t._v("Get the list of available locals")])]),e("li",[e("a",{attrs:{href:"#get-the-list-of-countries"}},[t._v("Get the list of countries")])]),e("li",[e("a",{attrs:{href:"#get-the-country-name"}},[t._v("Get the country name")])]),e("li",[e("a",{attrs:{href:"#get-the-available-states-associated-with-country-code"}},[t._v("Get the available states associated with country code")])]),e("li",[e("a",{attrs:{href:"#get-the-specified-state-name-associated-with-state-code"}},[t._v("Get the specified state name associated with state code")])]),e("li",[e("a",{attrs:{href:"#get-the-grouped-the-states-by-the-countries"}},[t._v("Get the Grouped the states by the countries")])]),e("li",[e("a",{attrs:{href:"#create-singleton-object-through-single-facade"}},[t._v("Create singleton object through single facade")])]),e("li",[e("a",{attrs:{href:"#format-date"}},[t._v("Format Date")])]),e("li",[e("a",{attrs:{href:"#return-currency-symbol-from-currency-code"}},[t._v("Return currency symbol from currency code")])]),e("li",[e("a",{attrs:{href:"#format-base-price"}},[t._v("Format base price")])]),e("li",[e("a",{attrs:{href:"#get-the-config-field"}},[t._v("Get the config field")])]),e("li",[e("a",{attrs:{href:"#get-the-config-data"}},[t._v("Get the config data")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Krayin provides a range of helper methods in its packages to streamline and simplify the development process. These helpers are designed to offer utility functions that facilitate common tasks, reducing the amount of boilerplate code developers need to write and enhancing overall productivity.")]),t._v(" "),e("h2",{attrs:{id:"core-helpers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#core-helpers"}},[t._v("#")]),t._v(" Core Helpers")]),t._v(" "),e("p",[t._v("The core helper methods are part of the Core class in the "),e("code",[t._v("Webkul\\Core")]),t._v(" namespace. These methods provide essential functionality that can be utilized across different parts of the application, making development more efficient and consistent. Let's explore some common methods:")]),t._v(" "),e("h3",{attrs:{id:"get-the-lists-of-timezone"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-lists-of-timezone"}},[t._v("#")]),t._v(" Get the lists of timezone")]),t._v(" "),e("p",[t._v("To retrieve a list of timezones in the CRM, you can use the "),e("code",[t._v("core()->timezones()")]),t._v(" method, which returns the list of timezones.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("timezones")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-list-of-available-locals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-list-of-available-locals"}},[t._v("#")]),t._v(" Get the list of available locals")]),t._v(" "),e("p",[t._v("To retrieve a list of available local in the CRM, you can use the "),e("code",[t._v("core()->locales()")]),t._v(" method, which return the list of available locales")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("locales")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-list-of-countries"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-list-of-countries"}},[t._v("#")]),t._v(" Get the list of countries")]),t._v(" "),e("p",[t._v("To retrieve a list of countries in the CRM, you can use the "),e("code",[t._v("core()->countries()")]),t._v(" method, which returns the list of all countries within the CRM.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("countries")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-country-name"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-country-name"}},[t._v("#")]),t._v(" Get the country name")]),t._v(" "),e("p",[t._v("To retrieve the country name by its country code, you can use the "),e("code",[t._v("core()->country_name($code)")]),t._v(" method, which returns the name of the country associated with the specified country code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("country_name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-available-states-associated-with-country-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-available-states-associated-with-country-code"}},[t._v("#")]),t._v(" Get the available states associated with country code")]),t._v(" "),e("p",[t._v("To retrieve a list of states associated with states in the CRM, you can use the "),e("code",[t._v("core()->states($countryCode)")]),t._v(" method, which returns the all states associated with the country code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("states")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$countryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-specified-state-name-associated-with-state-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-specified-state-name-associated-with-state-code"}},[t._v("#")]),t._v(" Get the specified state name associated with state code")]),t._v(" "),e("p",[t._v("To retrieve the state name by its state code, you can use the "),e("code",[t._v("core()->state_name($code)")]),t._v(" method, which returns the name of the state name associated with the specified state code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("state_name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-grouped-the-states-by-the-countries"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-grouped-the-states-by-the-countries"}},[t._v("#")]),t._v(" Get the Grouped the states by the countries")]),t._v(" "),e("p",[t._v("To retrieve the grouped the states by the countries, you can use the "),e("code",[t._v("core()->findStateByCountryCode($countryCode, $stateCode)")]),t._v(" which takes two argument "),e("code",[t._v("$countryCode")]),t._v(" and "),e("code",[t._v("$stateCode")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findStateByCountryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$countryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$stateCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"create-singleton-object-through-single-facade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-singleton-object-through-single-facade"}},[t._v("#")]),t._v(" Create singleton object through single facade")]),t._v(" "),e("p",[t._v("You can use the core method for singleton binding through the core helper methods.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSingletonInstance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$className")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("h3",{attrs:{id:"format-date"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#format-date"}},[t._v("#")]),t._v(" Format Date")]),t._v(" "),e("p",[t._v("You can use "),e("code",[t._v("core()->formatDate($date, $format = 'd M Y h:iA')")]),t._v(" method to format the provided date, you can modify the format date structure by passing second argument.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("formatDate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$date")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$format")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"return-currency-symbol-from-currency-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-currency-symbol-from-currency-code"}},[t._v("#")]),t._v(" Return currency symbol from currency code")]),t._v(" "),e("p",[t._v("To get the symbol of current currency int the crm you can use the method of core helper")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("currencySymbol")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"format-base-price"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#format-base-price"}},[t._v("#")]),t._v(" Format base price")]),t._v(" "),e("p",[t._v("To format the price of provided price you can use the method "),e("code",[t._v("core()->formatBasePrice()")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("formatBasePrice")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$price")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-config-field"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-config-field"}},[t._v("#")]),t._v(" Get the config field")]),t._v(" "),e("p",[t._v("To get the config field you can use the "),e("code",[t._v("core()->getConfigField($fieldName)")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConfigField")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$fieldName")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-config-data"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-config-data"}},[t._v("#")]),t._v(" Get the config data")]),t._v(" "),e("p",[t._v("To retrieve the config data you can use the method "),e("code",[t._v("core()->getConfigData($field)")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConfigData")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$field")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/103.fa757a15.js b/assets/js/103.5fdc006a.js similarity index 99% rename from assets/js/103.fa757a15.js rename to assets/js/103.5fdc006a.js index 29d1dfb..ae906cf 100644 --- a/assets/js/103.fa757a15.js +++ b/assets/js/103.5fdc006a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[103],{400:function(t,e,a){"use strict";a.r(e);var s=a(10),r=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"override-core-model"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#override-core-model"}},[t._v("#")]),t._v(" Override Core Model")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#overriding-a-model-class"}},[t._v("Overriding a Model Class")]),e("ul",[e("li",[e("a",{attrs:{href:"#define-an-interface-contract"}},[t._v("Define an Interface (Contract)")])]),e("li",[e("a",{attrs:{href:"#register-the-model-override"}},[t._v("Register the Model Override")])]),e("li",[e("a",{attrs:{href:"#implement-the-custom-model-class"}},[t._v("Implement the Custom Model Class")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Krayin utilizes Concord, a Laravel extension, for building modules on top of Laravel's built-in service providers. Concord introduces the concept of model proxies, which allow you to override and extend core models in a modular way.")]),t._v(" "),e("p",[t._v("Concord requires the existence of an interface, such as "),e("code",[t._v("Product")]),t._v(", which serves as a contract that can be bound to a concrete class using Concord's "),e("code",[t._v("registerModel()")]),t._v(" method.")]),t._v(" "),e("p",[t._v("By default, the "),e("code",[t._v("Models\\Product")]),t._v(" class is bound to the "),e("code",[t._v("Contracts\\Product")]),t._v(" interface within the module. If you want to extend or override this class, you can use Concord's "),e("code",[t._v("registerModel()")]),t._v(" method.")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("registerModel()")]),t._v(" method handles the binding of the interface and implementation in Laravel's service container, enabling you to easily type-hint the interface for automatic injection.")]),t._v(" "),e("p",[t._v("For more details, you can visit the "),e("a",{attrs:{href:"https://github.com/artkonekt/concord",target:"_blank",rel:"noopener noreferrer"}},[t._v("Concord GitHub repository"),e("OutboundLink")],1),t._v(" or refer to the "),e("a",{attrs:{href:"https://artkonekt.github.io/concord/#/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Concord documentation"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"overriding-a-model-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#overriding-a-model-class"}},[t._v("#")]),t._v(" Overriding a Model Class")]),t._v(" "),e("p",[t._v("To override a core model in Krayin using Concord, follow these steps:")]),t._v(" "),e("h3",{attrs:{id:"define-an-interface-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-an-interface-contract"}},[t._v("#")]),t._v(" Define an Interface (Contract)")]),t._v(" "),e("p",[t._v("In Krayin's modular structure, each Eloquent model typically corresponds to an interface. This interface acts as a contract that specifies the methods the model must implement.")]),t._v(" "),e("h3",{attrs:{id:"register-the-model-override"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#register-the-model-override"}},[t._v("#")]),t._v(" Register the Model Override")]),t._v(" "),e("p",[t._v("Use Concord's registerModel() method in your module's service provider (ServiceProvider) to bind your custom model implementation to the interface. Here’s how you can do it:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("app")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("concord")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("registerModel")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ProductContract")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("ul",[e("li",[t._v("Replace "),e("code",[t._v("Webkul\\Product\\Contracts\\Product as ProductContract")]),t._v(" with the interface you wish to override.")]),t._v(" "),e("li",[t._v("Replace "),e("code",[t._v("Webkul\\Category\\Models\\Product")]),t._v(" with the path to your custom model class that extends the core model you are overriding.")])]),t._v(" "),e("h3",{attrs:{id:"implement-the-custom-model-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implement-the-custom-model-class"}},[t._v("#")]),t._v(" Implement the Custom Model Class")]),t._v(" "),e("p",[t._v("Your custom model class (Product in this example) should extend the base core model ("),e("code",[t._v("ProductBaseModel")]),t._v("), ensuring it adheres to the contract specified by the interface. Here’s an example:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("app")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("concord")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("registerModel")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ProductContract")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("ul",[e("li",[t._v("Replace "),e("code",[t._v("Webkul\\Product\\Contracts\\Product as ProductContract")]),t._v(" with the interface you wish to override.")]),t._v(" "),e("li",[t._v("Replace "),e("code",[t._v("Webkul\\Category\\Models\\Product")]),t._v(" with the path to your custom model class that extends the core model you are overriding.")])]),t._v(" "),e("h3",{attrs:{id:"implement-the-custom-model-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implement-the-custom-model-class"}},[t._v("#")]),t._v(" Implement the Custom Model Class")]),t._v(" "),e("p",[t._v("Your custom model class (Product in this example) should extend the base core model ("),e("code",[t._v("ProductBaseModel")]),t._v("), ensuring it adheres to the contract specified by the interface. Here’s an example:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/before_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Event")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("listen")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.contacts.persons.create.header.after'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/after_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("p",[t._v("Replace "),e("code",[t._v("'path/to/before_content_template.blade.php'")]),t._v(" and "),e("code",[t._v("'path/to/after_content_template.blade.php'")]),t._v(" with the actual paths to the Blade template files you want to inject.")]),t._v(" "),e("div",{staticClass:"custom-block warning"},[e("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),e("p",[t._v("Make sure that you have registered the "),e("strong",[e("code",[t._v("EventServiceProvider")])]),t._v(" in your own service provider.")])]),t._v(" "),e("h3",{attrs:{id:"implementation-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[t._v("#")]),t._v(" Implementation Details")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("$viewRenderEventManager->addTemplate()")]),t._v(": This method adds the specified template file to the rendering queue for the corresponding event. When the event is triggered during template rendering, Krayin will include the specified template's content at the designated injection point.")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Event Handling")]),t._v(": Ensure that you properly handle the events within your application’s event flow. This involves registering listeners correctly in EventServiceProvider and ensuring that the templates being injected are structured and formatted according to your application's requirements.")])])]),t._v(" "),e("h3",{attrs:{id:"considerations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#considerations"}},[t._v("#")]),t._v(" Considerations")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("Integration")]),t._v(": Integrate this functionality carefully into your Krayin application to maintain coherence and readability of your codebase")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Customization")]),t._v(": Customize event names ("),e("code",[t._v("'admin.contacts.persons.create.header.before'")]),t._v(", "),e("code",[t._v("'admin.contacts.persons.create.header.after'")]),t._v(") and template paths according to your specific application needs and structure.")])])]),t._v(" "),e("p",[t._v("By following these steps, you can effectively leverage the "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[104],{403:function(t,e,n){"use strict";n.r(e);var a=n(10),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"view-render-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#view-render-event"}},[t._v("#")]),t._v(" View Render Event")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#render-view"}},[t._v("Render View")]),e("ul",[e("li",[e("a",{attrs:{href:"#listening-to-events"}},[t._v("Listening to Events")])]),e("li",[e("a",{attrs:{href:"#implementation-details"}},[t._v("Implementation Details")])]),e("li",[e("a",{attrs:{href:"#considerations"}},[t._v("Considerations")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin allows developers to inject content dynamically before or after the main content of a template. This functionality is useful for modifying template output without directly altering the template file itself, enhancing flexibility and maintainability in your application.")]),t._v(" "),e("h2",{attrs:{id:"render-view"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#render-view"}},[t._v("#")]),t._v(" Render View")]),t._v(" "),e("p",[t._v("To utilize the "),e("code",[t._v("view_render_event()")]),t._v(" function effectively, follow these steps:")]),t._v(" "),e("p",[t._v("In this example "),e("code",[t._v("admin.contacts.persons.create.header.before")]),t._v(" and "),e("code",[t._v("admin.contacts.persons.create.header.after")]),t._v(" are custom event names that denote where content should be injected before and after the page-header section, respectively inside the "),e("code",[t._v("packages/Webkul/Admin/src/Resources/views/contacts/persons/create.blade.php")]),t._v(" fie")]),t._v(" "),e("h3",{attrs:{id:"listening-to-events"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-events"}},[t._v("#")]),t._v(" Listening to Events")]),t._v(" "),e("p",[t._v("To handle these events and inject content dynamically, you need to listen to them in your application’s event system (typically in the "),e("code",[t._v("EventServiceProvider")]),t._v(").")]),t._v(" "),e("p",[t._v("Open your "),e("code",[t._v("EventServiceProvider.php")]),t._v(" file located in "),e("code",[t._v("app/Providers")]),t._v(" or similar directory.")]),t._v(" "),e("p",[t._v("In the "),e("code",[t._v("boot()")]),t._v(" method of your "),e("code",[t._v("EventServiceProvider")]),t._v(", add event listeners as follows:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/before_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Event")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("listen")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.contacts.persons.create.header.after'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/after_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("p",[t._v("Replace "),e("code",[t._v("'path/to/before_content_template.blade.php'")]),t._v(" and "),e("code",[t._v("'path/to/after_content_template.blade.php'")]),t._v(" with the actual paths to the Blade template files you want to inject.")]),t._v(" "),e("div",{staticClass:"custom-block warning"},[e("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),e("p",[t._v("Make sure that you have registered the "),e("strong",[e("code",[t._v("EventServiceProvider")])]),t._v(" in your own service provider.")])]),t._v(" "),e("h3",{attrs:{id:"implementation-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[t._v("#")]),t._v(" Implementation Details")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("$viewRenderEventManager->addTemplate()")]),t._v(": This method adds the specified template file to the rendering queue for the corresponding event. When the event is triggered during template rendering, Krayin will include the specified template's content at the designated injection point.")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Event Handling")]),t._v(": Ensure that you properly handle the events within your application’s event flow. This involves registering listeners correctly in EventServiceProvider and ensuring that the templates being injected are structured and formatted according to your application's requirements.")])])]),t._v(" "),e("h3",{attrs:{id:"considerations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#considerations"}},[t._v("#")]),t._v(" Considerations")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("Integration")]),t._v(": Integrate this functionality carefully into your Krayin application to maintain coherence and readability of your codebase")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Customization")]),t._v(": Customize event names ("),e("code",[t._v("'admin.contacts.persons.create.header.before'")]),t._v(", "),e("code",[t._v("'admin.contacts.persons.create.header.after'")]),t._v(") and template paths according to your specific application needs and structure.")])])]),t._v(" "),e("p",[t._v("By following these steps, you can effectively leverage the "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/105.3c2413ea.js b/assets/js/105.f3225838.js similarity index 97% rename from assets/js/105.3c2413ea.js rename to assets/js/105.f3225838.js index 8e16c6a..a6ac8c7 100644 --- a/assets/js/105.3c2413ea.js +++ b/assets/js/105.f3225838.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[105],{404:function(e,a,t){"use strict";t.r(a);var n=t(10),i=Object(n.a)({},(function(){var e=this,a=e._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"krayin-apis"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#krayin-apis"}},[e._v("#")]),e._v(" Krayin APIs")]),e._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#rest-api"}},[e._v("REST API")])])])]),a("p"),e._v(" "),a("h2",{attrs:{id:"rest-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rest-api"}},[e._v("#")]),e._v(" REST API")]),e._v(" "),a("p",[e._v("The Krayin REST API enables seamless integration and interaction with the Krayin CRM system. It follows the REST (Representational State Transfer) architecture, providing a robust set of endpoints for managing CRM-related data.")]),e._v(" "),a("p",[e._v("Key Features")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("CRUD Operations: The API supports all basic CRUD (Create, Read, Update, Delete) operations, allowing for comprehensive management of CRM data including customers, leads, contacts, and more.")])]),e._v(" "),a("li",[a("p",[e._v("Pagination: To enhance performance and manage large datasets efficiently, the API includes support for pagination. This helps in retrieving data in chunks rather than loading large volumes of data at once.")])])]),e._v(" "),a("p",[e._v("Integration Capabilities: The REST API is designed to integrate seamlessly with various external systems and applications, including:")]),e._v(" "),a("ul",[a("li",[e._v("PWA (Progressive Web Applications): Use the API to develop PWAs that interact with the CRM, offering a modern, app-like experience on the web.\nMobile Applications: Integrate with mobile apps to enable functionalities such as customer management, lead tracking, and reporting directly from the mobile interface.\nData Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.")])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[105],{402:function(e,a,t){"use strict";t.r(a);var n=t(10),i=Object(n.a)({},(function(){var e=this,a=e._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"krayin-apis"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#krayin-apis"}},[e._v("#")]),e._v(" Krayin APIs")]),e._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#rest-api"}},[e._v("REST API")])])])]),a("p"),e._v(" "),a("h2",{attrs:{id:"rest-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rest-api"}},[e._v("#")]),e._v(" REST API")]),e._v(" "),a("p",[e._v("The Krayin REST API enables seamless integration and interaction with the Krayin CRM system. It follows the REST (Representational State Transfer) architecture, providing a robust set of endpoints for managing CRM-related data.")]),e._v(" "),a("p",[e._v("Key Features")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("CRUD Operations: The API supports all basic CRUD (Create, Read, Update, Delete) operations, allowing for comprehensive management of CRM data including customers, leads, contacts, and more.")])]),e._v(" "),a("li",[a("p",[e._v("Pagination: To enhance performance and manage large datasets efficiently, the API includes support for pagination. This helps in retrieving data in chunks rather than loading large volumes of data at once.")])])]),e._v(" "),a("p",[e._v("Integration Capabilities: The REST API is designed to integrate seamlessly with various external systems and applications, including:")]),e._v(" "),a("ul",[a("li",[e._v("PWA (Progressive Web Applications): Use the API to develop PWAs that interact with the CRM, offering a modern, app-like experience on the web.\nMobile Applications: Integrate with mobile apps to enable functionalities such as customer management, lead tracking, and reporting directly from the mobile interface.\nData Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.")])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/106.d7ca6d28.js b/assets/js/106.a874ea9f.js similarity index 98% rename from assets/js/106.d7ca6d28.js rename to assets/js/106.a874ea9f.js index 2a2bdbc..0b33571 100644 --- a/assets/js/106.d7ca6d28.js +++ b/assets/js/106.a874ea9f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[106],{405:function(a,t,e){"use strict";e.r(t);var s=e(10),n=Object(s.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"krayin-apis"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#krayin-apis"}},[a._v("#")]),a._v(" Krayin APIs")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#rest-api"}},[a._v("REST API")])]),t("li",[t("a",{attrs:{href:"#explore-rest-api-demo"}},[a._v("Explore REST API Demo")])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"rest-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rest-api"}},[a._v("#")]),a._v(" REST API")]),a._v(" "),t("p",[a._v("Krayin REST API is a medium to use the features of the core Krayin System. By using Krayin REST API, you can integrate your application to serve the default content of Krayin.")]),a._v(" "),t("h2",{attrs:{id:"explore-rest-api-demo"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explore-rest-api-demo"}},[a._v("#")]),a._v(" Explore REST API Demo")]),a._v(" "),t("p",[a._v("Welcome to our API demo! Dive into the interactive showcase of our API functionalities to get a hands-on experience of how our platform works. Click the Link below to access the demo:")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://apidoc.krayincrm.com/api/documentation",target:"_blank",rel:"noopener noreferrer"}},[a._v("Access API Demo"),t("OutboundLink")],1)]),a._v(" "),t("h4",{attrs:{id:"click-the-link-below-to-access-admin-api-documentation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#click-the-link-below-to-access-admin-api-documentation"}},[a._v("#")]),a._v(" Click the Link below to access Admin API documentation")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://apidoc.krayincrm.com/admin/login",target:"_blank",rel:"noopener noreferrer"}},[a._v("Admin"),t("OutboundLink")],1)]),a._v(" "),t("h4",{attrs:{id:"installation-of-rest-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installation-of-rest-api"}},[a._v("#")]),a._v(" Installation of REST API")]),a._v(" "),t("p",[a._v("To install Krayin REST API, you need to follow some steps.")]),a._v(" "),t("ul",[t("li",[a._v("To install Krayin REST API from your console:")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("composer require krayin/rest-api\n")])])]),t("ul",[t("li",[a._v("Add below options in the .env file (i.e. http://localhost/public your domain):")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("SANCTUM_STATEFUL_DOMAINS=http://localhost/public\n")])])]),t("ul",[t("li",[a._v("To configure the REST API L5-Swagger Documentation run below command:")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("php artisan krayin-rest-api:install\n")])])]),t("ul",[t("li",[a._v("To check the Admin end API documentation:")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("http://localhost/public/api/admin/documentation\n")])])]),t("ul",[t("li",[a._v("You can check the "),t("a",{attrs:{href:"https://github.com/DarkaOnLine/L5-Swagger"}},[a._v(" L5-Swagger ")]),a._v(" guidelines too regarding the configuration the API documentation.")])]),a._v(" "),t("ul",[t("li",[a._v("For admin login, add Laravel Sanctum's API token to the Admin model follow the given path.")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("packages/Webkul/User/src/Models/Admin.php\n")])])]),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'repository'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Webkul\\Category\\Repositories\\CategoryRepository'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])])]),s("ol",{attrs:{start:"3"}},[s("li",[t._v("Register the Configuration File:")])]),t._v(" "),s("p",[t._v("In the CategoryServiceProvider, register the configuration file inside the register method of the provider.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register services.\n *\n * @return void\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("register")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeConfigFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/Config/attribute_entity_types.php'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'attribute_entity_types'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Now you can use the "),s("code",[t._v("CustomAttribute")]),t._v(" traits, which allows any model to be customized with attributes.")]),t._v(" "),s("p",[t._v("Example Are Give below.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("For Example.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Create the new Resource.\n * \n * @param array $data\n * @return \\Webkul\\Product\\Contracts\\Product\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("array")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword static-context"}},[t._v("parent")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Update the new existing Resource.\n * \n * @param array $data\n * @param int $id\n * @param string $attribute\n * @return \\Webkul\\Product\\Contracts\\Product\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("update")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("array")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword static-context"}},[t._v("parent")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("update")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[113],{411:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"use-model-with-custom-attributes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#use-model-with-custom-attributes"}},[t._v("#")]),t._v(" Use model with custom Attributes")]),t._v(" "),s("p",[t._v("Before using the CustomAttribute trait, you need to set it up.")]),t._v(" "),s("ol",[s("li",[t._v("Create a configuration file inside the Category package's Config directory named attribute_entity_types.php.")]),t._v(" "),s("li",[t._v("Add the following code snippet to the configuration file:")])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'repository'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Webkul\\Category\\Repositories\\CategoryRepository'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])])]),s("ol",{attrs:{start:"3"}},[s("li",[t._v("Register the Configuration File:")])]),t._v(" "),s("p",[t._v("In the CategoryServiceProvider, register the configuration file inside the register method of the provider.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register services.\n *\n * @return void\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("register")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeConfigFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/Config/attribute_entity_types.php'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'attribute_entity_types'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Now you can use the "),s("code",[t._v("CustomAttribute")]),t._v(" traits, which allows any model to be customized with attributes.")]),t._v(" "),s("p",[t._v("Example Are Give below.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("For Example.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Create the new Resource.\n * \n * @param array $data\n * @return \\Webkul\\Product\\Contracts\\Product\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("array")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword static-context"}},[t._v("parent")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Update the new existing Resource.\n * \n * @param array $data\n * @param int $id\n * @param string $attribute\n * @return \\Webkul\\Product\\Contracts\\Product\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("update")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("array")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword static-context"}},[t._v("parent")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("update")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/114.906f86a5.js b/assets/js/114.9c404adf.js similarity index 98% rename from assets/js/114.906f86a5.js rename to assets/js/114.9c404adf.js index 335ba60..c72212d 100644 --- a/assets/js/114.906f86a5.js +++ b/assets/js/114.9c404adf.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[114],{412:function(t,e,i){"use strict";i.r(e);var a=i(10),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"create-and-using-a-new-attribute"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-and-using-a-new-attribute"}},[t._v("#")]),t._v(" Create and using a new attribute")]),t._v(" "),e("p",[t._v("Krayin CRM is a highly customizable, attribute-based CRM system that allows you to manage various entities such as leads, quotes, contacts, and more through the use of attributes. This flexibility enables you to tailor the system to meet your specific business needs.")]),t._v(" "),e("ul",[e("li",[t._v("Creating Attributes")])]),t._v(" "),e("p",[t._v("To create an attribute in Krayin, follow these steps:")]),t._v(" "),e("ol",[e("li",[e("p",[e("strong",[t._v("Navigate to the Settings")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("In the main dashboard, go to "),e("code",[t._v("Settings")]),t._v(" in the sidebar menu.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Go to Attributes Section")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("Under the "),e("code",[t._v("Settings")]),t._v(" menu, select "),e("code",[t._v("Attributes")]),t._v(" to manage existing attributes or create new ones.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Create a New Attribute")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("Click on the "),e("code",[t._v("Create Attribute")]),t._v(" button.")]),t._v(" "),e("li",[t._v("Fill out the form with the necessary details, such as the name, code, and type of the attribute.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Entity Type")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("One of the key fields in the attribute creation form is the "),e("code",[t._v("Entity Type")]),t._v(". The "),e("code",[t._v("Entity Type")]),t._v(" determines where the attribute will be applied in the system. The available entity types include:\n"),e("ol",[e("li",[e("strong",[t._v("Leads")]),t._v(": Attributes created under this entity type will be associated with the "),e("code",[t._v("Leads")]),t._v(" module.")]),t._v(" "),e("li",[e("strong",[t._v("Person")]),t._v(": Use this entity type to create attributes for the "),e("code",[t._v("Person")]),t._v(" module, allowing you to manage individual contacts.")]),t._v(" "),e("li",[e("strong",[t._v("Organization")]),t._v(": Attributes for managing organizations and companies can be created under this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Products")]),t._v(": Attributes associated with products can be managed under this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Quotes")]),t._v(": If you want to manage quotes with specific attributes, select this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Warehouses")]),t._v(": This entity type is for managing warehouses and their specific attributes.")])])])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Save the Attribute")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("After filling in all the required fields, click "),e("code",[t._v("Save")]),t._v(". The attribute will now be available for the selected entity type.")])])])]),t._v(" "),e("ul",[e("li",[t._v("Using Attributes")])]),t._v(" "),e("p",[t._v("Once you have created an attribute, it will appear in the respective module based on the entity type you selected during creation. For example:")]),t._v(" "),e("ul",[e("li",[t._v("If you created an attribute for "),e("code",[t._v("Leads")]),t._v(", it will be available when managing or viewing leads.")]),t._v(" "),e("li",[t._v("Similarly, attributes for "),e("code",[t._v("Person")]),t._v(", "),e("code",[t._v("Organization")]),t._v(", "),e("code",[t._v("Products")]),t._v(", "),e("code",[t._v("Quotes")]),t._v(", and "),e("code",[t._v("Warehouses")]),t._v(" will be accessible within their corresponding entity type")])]),t._v(" "),e("p",[t._v("These attributes allow you to add custom fields, data types, and other specific requirements to the respective entities, making Krayin a powerful and flexible CRM solution for your business.")]),t._v(" "),e("ul",[e("li",[t._v("Summary")])]),t._v(" "),e("p",[t._v("Krayin’s attribute system provides extensive customization options, making it easy to manage various CRM entities according to your unique requirements. By selecting the appropriate "),e("code",[t._v("Entity Type")]),t._v(" when creating an attribute, you ensure that the attribute is applied to the correct module within the CRM. This approach allows you to build a CRM system tailored to your business needs, with custom fields and data management options for leads, quotes, contacts, and more.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[114],{413:function(t,e,i){"use strict";i.r(e);var a=i(10),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"create-and-using-a-new-attribute"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-and-using-a-new-attribute"}},[t._v("#")]),t._v(" Create and using a new attribute")]),t._v(" "),e("p",[t._v("Krayin CRM is a highly customizable, attribute-based CRM system that allows you to manage various entities such as leads, quotes, contacts, and more through the use of attributes. This flexibility enables you to tailor the system to meet your specific business needs.")]),t._v(" "),e("ul",[e("li",[t._v("Creating Attributes")])]),t._v(" "),e("p",[t._v("To create an attribute in Krayin, follow these steps:")]),t._v(" "),e("ol",[e("li",[e("p",[e("strong",[t._v("Navigate to the Settings")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("In the main dashboard, go to "),e("code",[t._v("Settings")]),t._v(" in the sidebar menu.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Go to Attributes Section")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("Under the "),e("code",[t._v("Settings")]),t._v(" menu, select "),e("code",[t._v("Attributes")]),t._v(" to manage existing attributes or create new ones.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Create a New Attribute")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("Click on the "),e("code",[t._v("Create Attribute")]),t._v(" button.")]),t._v(" "),e("li",[t._v("Fill out the form with the necessary details, such as the name, code, and type of the attribute.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Entity Type")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("One of the key fields in the attribute creation form is the "),e("code",[t._v("Entity Type")]),t._v(". The "),e("code",[t._v("Entity Type")]),t._v(" determines where the attribute will be applied in the system. The available entity types include:\n"),e("ol",[e("li",[e("strong",[t._v("Leads")]),t._v(": Attributes created under this entity type will be associated with the "),e("code",[t._v("Leads")]),t._v(" module.")]),t._v(" "),e("li",[e("strong",[t._v("Person")]),t._v(": Use this entity type to create attributes for the "),e("code",[t._v("Person")]),t._v(" module, allowing you to manage individual contacts.")]),t._v(" "),e("li",[e("strong",[t._v("Organization")]),t._v(": Attributes for managing organizations and companies can be created under this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Products")]),t._v(": Attributes associated with products can be managed under this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Quotes")]),t._v(": If you want to manage quotes with specific attributes, select this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Warehouses")]),t._v(": This entity type is for managing warehouses and their specific attributes.")])])])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Save the Attribute")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("After filling in all the required fields, click "),e("code",[t._v("Save")]),t._v(". The attribute will now be available for the selected entity type.")])])])]),t._v(" "),e("ul",[e("li",[t._v("Using Attributes")])]),t._v(" "),e("p",[t._v("Once you have created an attribute, it will appear in the respective module based on the entity type you selected during creation. For example:")]),t._v(" "),e("ul",[e("li",[t._v("If you created an attribute for "),e("code",[t._v("Leads")]),t._v(", it will be available when managing or viewing leads.")]),t._v(" "),e("li",[t._v("Similarly, attributes for "),e("code",[t._v("Person")]),t._v(", "),e("code",[t._v("Organization")]),t._v(", "),e("code",[t._v("Products")]),t._v(", "),e("code",[t._v("Quotes")]),t._v(", and "),e("code",[t._v("Warehouses")]),t._v(" will be accessible within their corresponding entity type")])]),t._v(" "),e("p",[t._v("These attributes allow you to add custom fields, data types, and other specific requirements to the respective entities, making Krayin a powerful and flexible CRM solution for your business.")]),t._v(" "),e("ul",[e("li",[t._v("Summary")])]),t._v(" "),e("p",[t._v("Krayin’s attribute system provides extensive customization options, making it easy to manage various CRM entities according to your unique requirements. By selecting the appropriate "),e("code",[t._v("Entity Type")]),t._v(" when creating an attribute, you ensure that the attribute is applied to the correct module within the CRM. This approach allows you to build a CRM system tailored to your business needs, with custom fields and data management options for leads, quotes, contacts, and more.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/115.603d5a7e.js b/assets/js/115.4b20159c.js similarity index 99% rename from assets/js/115.603d5a7e.js rename to assets/js/115.4b20159c.js index 50c3316..77460bf 100644 --- a/assets/js/115.603d5a7e.js +++ b/assets/js/115.4b20159c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[115],{414:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[t("strong",[e._v("Krayin")]),e._v(" is a hand tailored CRM framework built on some of the hottest opensource technologies such as "),t("a",{attrs:{href:"https://laravel.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("Laravel"),t("OutboundLink")],1),e._v(", a "),t("a",{attrs:{href:"https://php.net",target:"_blank",rel:"noopener noreferrer"}},[e._v("PHP"),t("OutboundLink")],1),e._v(" framework and "),t("a",{attrs:{href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Vue.js"),t("OutboundLink")],1),e._v(", a progressive Javascript framework.")]),e._v(" "),t("p",[e._v("Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.")]),e._v(" "),t("p",[e._v("To learn more about "),t("strong",[e._v("Krayin's")]),e._v(" features and try a "),t("a",{attrs:{href:"https://demo.krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("demo"),t("OutboundLink")],1),e._v(", check out our website "),t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"key-features-of-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features-of-krayin"}},[e._v("#")]),e._v(" Key Features of Krayin")]),e._v(" "),t("p",[e._v("Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.")]),e._v(" "),t("h3",{attrs:{id:"crm-dashboard"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#crm-dashboard"}},[e._v("#")]),e._v(" CRM Dashboard")]),e._v(" "),t("p",[e._v("Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.")]),e._v(" "),t("h3",{attrs:{id:"convert-opportunities-into-revenue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#convert-opportunities-into-revenue"}},[e._v("#")]),e._v(" Convert Opportunities into Revenue")]),e._v(" "),t("p",[e._v("Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.")]),e._v(" "),t("h3",{attrs:{id:"manage-interaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manage-interaction"}},[e._v("#")]),e._v(" Manage Interaction")]),e._v(" "),t("p",[e._v("Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.")]),e._v(" "),t("h3",{attrs:{id:"access-control-list-acl"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-control-list-acl"}},[e._v("#")]),e._v(" Access Control List (ACL)")]),e._v(" "),t("p",[e._v("Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.")]),e._v(" "),t("h3",{attrs:{id:"activities-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#activities-management"}},[e._v("#")]),e._v(" Activities Management")]),e._v(" "),t("p",[e._v("Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.")]),e._v(" "),t("h3",{attrs:{id:"kanban-visual-leads"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#kanban-visual-leads"}},[e._v("#")]),e._v(" Kanban Visual Leads")]),e._v(" "),t("p",[e._v("The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.")]),e._v(" "),t("h3",{attrs:{id:"unlimited-custom-fields"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#unlimited-custom-fields"}},[e._v("#")]),e._v(" Unlimited Custom Fields")]),e._v(" "),t("p",[e._v("Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.")]),e._v(" "),t("h3",{attrs:{id:"product-creation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#product-creation"}},[e._v("#")]),e._v(" Product Creation")]),e._v(" "),t("p",[e._v("Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.")]),e._v(" "),t("h3",{attrs:{id:"contact-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#contact-management"}},[e._v("#")]),e._v(" Contact Management")]),e._v(" "),t("p",[e._v("Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.")]),e._v(" "),t("h3",{attrs:{id:"modular-design"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#modular-design"}},[e._v("#")]),e._v(" Modular Design")]),e._v(" "),t("p",[e._v("Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.")]),e._v(" "),t("h2",{attrs:{id:"community-and-support"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-and-support"}},[e._v("#")]),e._v(" Community and Support")]),e._v(" "),t("p",[e._v("Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Explore Krayin")]),e._v(": Visit our website at "),t("a",{attrs:{href:"https://krayincrm.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" to discover more about Krayin's features and experience a demo.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("GitHub Repository")]),e._v(": Access the Krayin repository on "),t("a",{attrs:{href:"https://github.com/krayin/laravel-crm",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub"),t("OutboundLink")],1),e._v(" with over 8.8K+ stars, reflecting its popularity and community support.")])])]),e._v(" "),t("p",[e._v("Join the Krayin community today and manage your customer relationships with ease.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[115],{415:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[t("strong",[e._v("Krayin")]),e._v(" is a hand tailored CRM framework built on some of the hottest opensource technologies such as "),t("a",{attrs:{href:"https://laravel.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("Laravel"),t("OutboundLink")],1),e._v(", a "),t("a",{attrs:{href:"https://php.net",target:"_blank",rel:"noopener noreferrer"}},[e._v("PHP"),t("OutboundLink")],1),e._v(" framework and "),t("a",{attrs:{href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Vue.js"),t("OutboundLink")],1),e._v(", a progressive Javascript framework.")]),e._v(" "),t("p",[e._v("Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.")]),e._v(" "),t("p",[e._v("To learn more about "),t("strong",[e._v("Krayin's")]),e._v(" features and try a "),t("a",{attrs:{href:"https://demo.krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("demo"),t("OutboundLink")],1),e._v(", check out our website "),t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"key-features-of-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features-of-krayin"}},[e._v("#")]),e._v(" Key Features of Krayin")]),e._v(" "),t("p",[e._v("Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.")]),e._v(" "),t("h3",{attrs:{id:"crm-dashboard"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#crm-dashboard"}},[e._v("#")]),e._v(" CRM Dashboard")]),e._v(" "),t("p",[e._v("Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.")]),e._v(" "),t("h3",{attrs:{id:"convert-opportunities-into-revenue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#convert-opportunities-into-revenue"}},[e._v("#")]),e._v(" Convert Opportunities into Revenue")]),e._v(" "),t("p",[e._v("Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.")]),e._v(" "),t("h3",{attrs:{id:"manage-interaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manage-interaction"}},[e._v("#")]),e._v(" Manage Interaction")]),e._v(" "),t("p",[e._v("Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.")]),e._v(" "),t("h3",{attrs:{id:"access-control-list-acl"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-control-list-acl"}},[e._v("#")]),e._v(" Access Control List (ACL)")]),e._v(" "),t("p",[e._v("Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.")]),e._v(" "),t("h3",{attrs:{id:"activities-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#activities-management"}},[e._v("#")]),e._v(" Activities Management")]),e._v(" "),t("p",[e._v("Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.")]),e._v(" "),t("h3",{attrs:{id:"kanban-visual-leads"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#kanban-visual-leads"}},[e._v("#")]),e._v(" Kanban Visual Leads")]),e._v(" "),t("p",[e._v("The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.")]),e._v(" "),t("h3",{attrs:{id:"unlimited-custom-fields"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#unlimited-custom-fields"}},[e._v("#")]),e._v(" Unlimited Custom Fields")]),e._v(" "),t("p",[e._v("Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.")]),e._v(" "),t("h3",{attrs:{id:"product-creation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#product-creation"}},[e._v("#")]),e._v(" Product Creation")]),e._v(" "),t("p",[e._v("Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.")]),e._v(" "),t("h3",{attrs:{id:"contact-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#contact-management"}},[e._v("#")]),e._v(" Contact Management")]),e._v(" "),t("p",[e._v("Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.")]),e._v(" "),t("h3",{attrs:{id:"modular-design"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#modular-design"}},[e._v("#")]),e._v(" Modular Design")]),e._v(" "),t("p",[e._v("Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.")]),e._v(" "),t("h2",{attrs:{id:"community-and-support"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-and-support"}},[e._v("#")]),e._v(" Community and Support")]),e._v(" "),t("p",[e._v("Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Explore Krayin")]),e._v(": Visit our website at "),t("a",{attrs:{href:"https://krayincrm.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" to discover more about Krayin's features and experience a demo.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("GitHub Repository")]),e._v(": Access the Krayin repository on "),t("a",{attrs:{href:"https://github.com/krayin/laravel-crm",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub"),t("OutboundLink")],1),e._v(" with over 8.8K+ stars, reflecting its popularity and community support.")])])]),e._v(" "),t("p",[e._v("Join the Krayin community today and manage your customer relationships with ease.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/116.0128b721.js b/assets/js/116.cae4d1e4.js similarity index 99% rename from assets/js/116.0128b721.js rename to assets/js/116.cae4d1e4.js index 3c03d8b..7805e2b 100644 --- a/assets/js/116.0128b721.js +++ b/assets/js/116.cae4d1e4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[116],{415:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"docker"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker"}},[t._v("#")]),t._v(" Docker")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")]),a("ul",[a("li",[a("a",{attrs:{href:"#docker-setup-for-krayin"}},[t._v("Docker Setup for Krayin")])]),a("li",[a("a",{attrs:{href:"#_1-using-krayin-docker-image-from-docker-hub"}},[t._v("1. Using Krayin Docker Image from Docker Hub")])]),a("li",[a("a",{attrs:{href:"#_2-using-krayin-github-docker-repository"}},[t._v("2. Using Krayin GitHub Docker Repository")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.docker.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker"),a("OutboundLink")],1),t._v(" is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. Docker can also be used for defining and running multi-container Docker applications using the Docker Compose tool.")]),t._v(" "),a("p",[t._v("With the help of Docker Compose, you can define containers to be built, their configuration, links, volumes, ports, etc., in a single file, and it gets launched by a single command. You can also add multiple servers and services just by adding them to the Docker Compose configuration file. This configuration file is in "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/YAML",target:"_blank",rel:"noopener noreferrer"}},[t._v("YAML"),a("OutboundLink")],1),t._v(" format.")]),t._v(" "),a("h4",{attrs:{id:"application-data-and-database-volume-persistence"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#application-data-and-database-volume-persistence"}},[t._v("#")]),t._v(" Application Data and Database Volume Persistence")]),t._v(" "),a("p",[t._v("It is recommended to keep your application files and database data volume on the Docker host and mount them on the running container. This ensures that the application and database data persistence even in the case of containers' failure or termination. In this way, even if you destroy containers, your data won't get lost unless you remove them forcefully.\nThis compose configuration file mounts the application directory "),a("strong",[a("code",[t._v("app")])]),t._v(" and database volume "),a("strong",[a("code",[t._v("dbvolume")])]),t._v(" from the host to running Docker containers at the time of containers' launch.")]),t._v(" "),a("h3",{attrs:{id:"docker-setup-for-krayin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker-setup-for-krayin"}},[t._v("#")]),t._v(" Docker Setup for Krayin")]),t._v(" "),a("p",[t._v("You can configure Krayin using Docker in two different ways:")]),t._v(" "),a("ol",[a("li",[a("strong",[t._v("Using Krayin Docker Image from Docker Hub")])]),t._v(" "),a("li",[a("strong",[t._v("Using Krayin GitHub Docker Repository")])])]),t._v(" "),a("p",[t._v("Both approaches allow you to set up the application quickly, managing all system requirements like Apache, MySQL, and PHPMyAdmin within isolated containers. Below is a detailed guide for each method.")]),t._v(" "),a("h3",{attrs:{id:"_1-using-krayin-docker-image-from-docker-hub"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-using-krayin-docker-image-from-docker-hub"}},[t._v("#")]),t._v(" 1. "),a("strong",[t._v("Using Krayin Docker Image from Docker Hub")])]),t._v(" "),a("p",[t._v("Follow the steps below to set up Krayin using Docker Hub. This approach provides a pre-configured Docker image of Krayin, allowing for a quick and easy installation.")]),t._v(" "),a("h4",{attrs:{id:"step-1-pull-krayin-docker-image"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-1-pull-krayin-docker-image"}},[t._v("#")]),t._v(" Step 1: Pull Krayin Docker Image")]),t._v(" "),a("p",[t._v("To pull the Krayin Docker image from Docker Hub, use the following command:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" pull webkul/krayin:2.0.1\n")])])]),a("h4",{attrs:{id:"step-2-run-a-new-container"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-2-run-a-new-container"}},[t._v("#")]),t._v(" Step 2: Run a New Container")]),t._v(" "),a("p",[t._v("Once the image is pulled, you can run a new Docker container using the command below. This will bind your local port 80 to the container’s port 80, so Krayin can be accessed via the browser.")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-it")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-d")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-p")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),t._v(":80 webkul/krayin:2.0.1\n")])])]),a("blockquote",[a("p",[a("strong",[t._v("Note:")]),t._v("\nIf port 80 is already in use, you can try using a different port. For example, you can map port 8082 on your local machine to port 80 in the container by running the following command:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-it")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-d")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-p")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8082")]),t._v(":80 webkul/krayin:2.0.1\n")])])]),a("p",[t._v("After this, you can access the application at "),a("code",[t._v("http://localhost:8082/")]),t._v(" instead of "),a("code",[t._v("http://localhost:80")])])]),t._v(" "),a("h4",{attrs:{id:"step-3-access-krayin-in-your-browser"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-3-access-krayin-in-your-browser"}},[t._v("#")]),t._v(" Step 3: Access Krayin in Your Browser")]),t._v(" "),a("p",[t._v("After the container is up and running, open your browser and navigate to "),a("code",[t._v("http://localhost")]),t._v(". This will load the Krayin setup.")]),t._v(" "),a("h4",{attrs:{id:"step-4-admin-login-credentials"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-4-admin-login-credentials"}},[t._v("#")]),t._v(" Step 4: Admin Login Credentials")]),t._v(" "),a("p",[t._v("Use the following credentials to log in to the Krayin admin panel:")]),t._v(" "),a("ul",[a("li",[a("strong",[t._v("Admin Username")]),t._v(": "),a("code",[t._v("admin@example.com")])]),t._v(" "),a("li",[a("strong",[t._v("Admin Password")]),t._v(": "),a("code",[t._v("admin123")])])]),t._v(" "),a("h3",{attrs:{id:"_2-using-krayin-github-docker-repository"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-using-krayin-github-docker-repository"}},[t._v("#")]),t._v(" 2. "),a("strong",[t._v("Using Krayin GitHub Docker Repository")])]),t._v(" "),a("h4",{attrs:{id:"system-requirements"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#system-requirements"}},[t._v("#")]),t._v(" System Requirements")]),t._v(" "),a("p",[t._v("The Krayin GitHub Docker repository automatically handles the system requirements for running Krayin, including the necessary Apache and MySQL configurations. Before proceeding, ensure that you have the latest version of "),a("strong",[t._v("Docker")]),t._v(" and "),a("strong",[t._v("Docker Compose")]),t._v(" installed. You can find installation instructions for your operating system at the following links:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://docs.docker.com/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker Installation Guide"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://docs.docker.com/compose/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker Compose Installation Guide"),a("OutboundLink")],1)])]),t._v(" "),a("h4",{attrs:{id:"docker-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker-configuration"}},[t._v("#")]),t._v(" Docker Configuration")]),t._v(" "),a("ol",[a("li",[a("p",[a("strong",[t._v("Adjust Ports and Paths")]),a("br"),t._v("\nOpen the "),a("code",[t._v("docker-compose.yml")]),t._v(" file and configure the ports for Apache, MySQL, and PHPMyAdmin. You can also specify the volumes and MySQL credentials. Here's an example configuration:")]),t._v(" "),a("div",{staticClass:"language-yaml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-yaml"}},[a("code",[a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("version")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'3.1'")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("services")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-php-apache")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("args")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("container_project_path")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" /var/www/html/\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("uid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# add your uid here")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("user")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" $USER\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("context")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" .\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("dockerfile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" ./Dockerfile\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" krayin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("php"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("apache\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token datetime number"}},[t._v("80:80")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" ./workspace/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("/var/www/html/\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-mysql")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" mysql"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("command")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("default"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("authentication"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("plugin=mysql_native_password\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("restart")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" always\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("environment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("MYSQL_ROOT_HOST")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'%'")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("MYSQL_ROOT_PASSWORD")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" 3306"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3306")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" ./.configs/mysql"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("/var/lib/mysql/\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-phpmyadmin")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" phpmyadmin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("latest\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("restart")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" always\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("environment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_HOST")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" krayin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("mysql\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_USER")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_PASSWORD")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" 8080"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("mysql-data")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Running the Setup")]),a("br"),t._v("\nAfter adjusting the configurations, execute the following command to start the Docker containers:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sh")]),t._v(" setup.sh\n")])])])])]),t._v(" "),a("h4",{attrs:{id:"accessing-krayin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#accessing-krayin"}},[t._v("#")]),t._v(" Accessing Krayin")]),t._v(" "),a("ul",[a("li",[a("p",[a("strong",[t._v("Admin Panel")]),a("br"),t._v("\nAccess the admin panel at:"),a("br"),t._v(" "),a("code",[t._v("http(s)://your_server_endpoint/admin/login")]),a("br"),t._v("\nUse the default credentials:")]),t._v(" "),a("ul",[a("li",[a("strong",[t._v("Email")]),t._v(": "),a("code",[t._v("admin@example.com")])]),t._v(" "),a("li",[a("strong",[t._v("Password")]),t._v(": "),a("code",[t._v("admin123")])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Customer Registration")]),a("br"),t._v("\nRegister and log in as a customer at:"),a("br"),t._v(" "),a("code",[t._v("http(s)://your_server_endpoint/customer/register")])])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[116],{414:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"docker"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker"}},[t._v("#")]),t._v(" Docker")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")]),a("ul",[a("li",[a("a",{attrs:{href:"#docker-setup-for-krayin"}},[t._v("Docker Setup for Krayin")])]),a("li",[a("a",{attrs:{href:"#_1-using-krayin-docker-image-from-docker-hub"}},[t._v("1. Using Krayin Docker Image from Docker Hub")])]),a("li",[a("a",{attrs:{href:"#_2-using-krayin-github-docker-repository"}},[t._v("2. Using Krayin GitHub Docker Repository")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.docker.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker"),a("OutboundLink")],1),t._v(" is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. Docker can also be used for defining and running multi-container Docker applications using the Docker Compose tool.")]),t._v(" "),a("p",[t._v("With the help of Docker Compose, you can define containers to be built, their configuration, links, volumes, ports, etc., in a single file, and it gets launched by a single command. You can also add multiple servers and services just by adding them to the Docker Compose configuration file. This configuration file is in "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/YAML",target:"_blank",rel:"noopener noreferrer"}},[t._v("YAML"),a("OutboundLink")],1),t._v(" format.")]),t._v(" "),a("h4",{attrs:{id:"application-data-and-database-volume-persistence"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#application-data-and-database-volume-persistence"}},[t._v("#")]),t._v(" Application Data and Database Volume Persistence")]),t._v(" "),a("p",[t._v("It is recommended to keep your application files and database data volume on the Docker host and mount them on the running container. This ensures that the application and database data persistence even in the case of containers' failure or termination. In this way, even if you destroy containers, your data won't get lost unless you remove them forcefully.\nThis compose configuration file mounts the application directory "),a("strong",[a("code",[t._v("app")])]),t._v(" and database volume "),a("strong",[a("code",[t._v("dbvolume")])]),t._v(" from the host to running Docker containers at the time of containers' launch.")]),t._v(" "),a("h3",{attrs:{id:"docker-setup-for-krayin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker-setup-for-krayin"}},[t._v("#")]),t._v(" Docker Setup for Krayin")]),t._v(" "),a("p",[t._v("You can configure Krayin using Docker in two different ways:")]),t._v(" "),a("ol",[a("li",[a("strong",[t._v("Using Krayin Docker Image from Docker Hub")])]),t._v(" "),a("li",[a("strong",[t._v("Using Krayin GitHub Docker Repository")])])]),t._v(" "),a("p",[t._v("Both approaches allow you to set up the application quickly, managing all system requirements like Apache, MySQL, and PHPMyAdmin within isolated containers. Below is a detailed guide for each method.")]),t._v(" "),a("h3",{attrs:{id:"_1-using-krayin-docker-image-from-docker-hub"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-using-krayin-docker-image-from-docker-hub"}},[t._v("#")]),t._v(" 1. "),a("strong",[t._v("Using Krayin Docker Image from Docker Hub")])]),t._v(" "),a("p",[t._v("Follow the steps below to set up Krayin using Docker Hub. This approach provides a pre-configured Docker image of Krayin, allowing for a quick and easy installation.")]),t._v(" "),a("h4",{attrs:{id:"step-1-pull-krayin-docker-image"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-1-pull-krayin-docker-image"}},[t._v("#")]),t._v(" Step 1: Pull Krayin Docker Image")]),t._v(" "),a("p",[t._v("To pull the Krayin Docker image from Docker Hub, use the following command:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" pull webkul/krayin:2.0.1\n")])])]),a("h4",{attrs:{id:"step-2-run-a-new-container"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-2-run-a-new-container"}},[t._v("#")]),t._v(" Step 2: Run a New Container")]),t._v(" "),a("p",[t._v("Once the image is pulled, you can run a new Docker container using the command below. This will bind your local port 80 to the container’s port 80, so Krayin can be accessed via the browser.")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-it")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-d")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-p")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),t._v(":80 webkul/krayin:2.0.1\n")])])]),a("blockquote",[a("p",[a("strong",[t._v("Note:")]),t._v("\nIf port 80 is already in use, you can try using a different port. For example, you can map port 8082 on your local machine to port 80 in the container by running the following command:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-it")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-d")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-p")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8082")]),t._v(":80 webkul/krayin:2.0.1\n")])])]),a("p",[t._v("After this, you can access the application at "),a("code",[t._v("http://localhost:8082/")]),t._v(" instead of "),a("code",[t._v("http://localhost:80")])])]),t._v(" "),a("h4",{attrs:{id:"step-3-access-krayin-in-your-browser"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-3-access-krayin-in-your-browser"}},[t._v("#")]),t._v(" Step 3: Access Krayin in Your Browser")]),t._v(" "),a("p",[t._v("After the container is up and running, open your browser and navigate to "),a("code",[t._v("http://localhost")]),t._v(". This will load the Krayin setup.")]),t._v(" "),a("h4",{attrs:{id:"step-4-admin-login-credentials"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-4-admin-login-credentials"}},[t._v("#")]),t._v(" Step 4: Admin Login Credentials")]),t._v(" "),a("p",[t._v("Use the following credentials to log in to the Krayin admin panel:")]),t._v(" "),a("ul",[a("li",[a("strong",[t._v("Admin Username")]),t._v(": "),a("code",[t._v("admin@example.com")])]),t._v(" "),a("li",[a("strong",[t._v("Admin Password")]),t._v(": "),a("code",[t._v("admin123")])])]),t._v(" "),a("h3",{attrs:{id:"_2-using-krayin-github-docker-repository"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-using-krayin-github-docker-repository"}},[t._v("#")]),t._v(" 2. "),a("strong",[t._v("Using Krayin GitHub Docker Repository")])]),t._v(" "),a("h4",{attrs:{id:"system-requirements"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#system-requirements"}},[t._v("#")]),t._v(" System Requirements")]),t._v(" "),a("p",[t._v("The Krayin GitHub Docker repository automatically handles the system requirements for running Krayin, including the necessary Apache and MySQL configurations. Before proceeding, ensure that you have the latest version of "),a("strong",[t._v("Docker")]),t._v(" and "),a("strong",[t._v("Docker Compose")]),t._v(" installed. You can find installation instructions for your operating system at the following links:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://docs.docker.com/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker Installation Guide"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://docs.docker.com/compose/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker Compose Installation Guide"),a("OutboundLink")],1)])]),t._v(" "),a("h4",{attrs:{id:"docker-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker-configuration"}},[t._v("#")]),t._v(" Docker Configuration")]),t._v(" "),a("ol",[a("li",[a("p",[a("strong",[t._v("Adjust Ports and Paths")]),a("br"),t._v("\nOpen the "),a("code",[t._v("docker-compose.yml")]),t._v(" file and configure the ports for Apache, MySQL, and PHPMyAdmin. You can also specify the volumes and MySQL credentials. Here's an example configuration:")]),t._v(" "),a("div",{staticClass:"language-yaml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-yaml"}},[a("code",[a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("version")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'3.1'")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("services")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-php-apache")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("args")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("container_project_path")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" /var/www/html/\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("uid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# add your uid here")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("user")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" $USER\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("context")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" .\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("dockerfile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" ./Dockerfile\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" krayin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("php"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("apache\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token datetime number"}},[t._v("80:80")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" ./workspace/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("/var/www/html/\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-mysql")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" mysql"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("command")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("default"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("authentication"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("plugin=mysql_native_password\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("restart")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" always\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("environment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("MYSQL_ROOT_HOST")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'%'")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("MYSQL_ROOT_PASSWORD")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" 3306"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3306")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" ./.configs/mysql"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("/var/lib/mysql/\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-phpmyadmin")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" phpmyadmin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("latest\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("restart")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" always\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("environment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_HOST")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" krayin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("mysql\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_USER")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_PASSWORD")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" 8080"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("mysql-data")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Running the Setup")]),a("br"),t._v("\nAfter adjusting the configurations, execute the following command to start the Docker containers:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sh")]),t._v(" setup.sh\n")])])])])]),t._v(" "),a("h4",{attrs:{id:"accessing-krayin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#accessing-krayin"}},[t._v("#")]),t._v(" Accessing Krayin")]),t._v(" "),a("ul",[a("li",[a("p",[a("strong",[t._v("Admin Panel")]),a("br"),t._v("\nAccess the admin panel at:"),a("br"),t._v(" "),a("code",[t._v("http(s)://your_server_endpoint/admin/login")]),a("br"),t._v("\nUse the default credentials:")]),t._v(" "),a("ul",[a("li",[a("strong",[t._v("Email")]),t._v(": "),a("code",[t._v("admin@example.com")])]),t._v(" "),a("li",[a("strong",[t._v("Password")]),t._v(": "),a("code",[t._v("admin123")])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Customer Registration")]),a("br"),t._v("\nRegister and log in as a customer at:"),a("br"),t._v(" "),a("code",[t._v("http(s)://your_server_endpoint/customer/register")])])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/118.fd058827.js b/assets/js/118.06a3a421.js similarity index 98% rename from assets/js/118.fd058827.js rename to assets/js/118.06a3a421.js index ef49c6d..8df4c43 100644 --- a/assets/js/118.fd058827.js +++ b/assets/js/118.06a3a421.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[118],{420:function(e,t,s){"use strict";s.r(t);var r=s(10),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"requirements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[e._v("#")]),e._v(" Requirements")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#server-configuration"}},[e._v("Server configuration")])]),t("li",[t("a",{attrs:{href:"#php-extensions"}},[e._v("PHP Extensions")])]),t("li",[t("a",{attrs:{href:"#php-configuration"}},[e._v("PHP Configuration")])]),t("li",[t("a",{attrs:{href:"#supported-database-servers"}},[e._v("Supported Database Servers")])])])]),t("p"),e._v(" "),t("p",[e._v("Before installing Krayin please make sure your server meets the following requirements,")]),e._v(" "),t("h2",{attrs:{id:"server-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#server-configuration"}},[e._v("#")]),e._v(" Server configuration")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("SERVER")]),e._v(": Apache 2 or NGINX")]),e._v(" "),t("li",[t("strong",[e._v("RAM")]),e._v(": 4GB or higher")]),e._v(" "),t("li",[t("strong",[e._v("Node")]),e._v(": v16.16.0 (LTS) or higher")]),e._v(" "),t("li",[t("strong",[e._v("PHP")]),e._v(": 8.1 or higher")]),e._v(" "),t("li",[t("strong",[e._v("Composer")]),e._v(": 2.5 or higher")])]),e._v(" "),t("h2",{attrs:{id:"php-extensions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#php-extensions"}},[e._v("#")]),e._v(" PHP Extensions")]),e._v(" "),t("p",[e._v("Ensure the following extensions are installed and enabled. You can check using the "),t("strong",[t("code",[e._v("phpinfo()")])]),e._v(" page or the "),t("strong",[t("code",[e._v("php -m")])]),e._v(" command.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("php-intl extension")]),e._v(": This extension is required for internationalization support in Krayin.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("php-gd extension")]),e._v(": The "),t("strong",[t("code",[e._v("php-gd")])]),e._v(" extension must be properly installed to ensure correct image functionality in the project. If not installed correctly, image-related features may not work as expected.")]),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Note")]),e._v(" "),t("p",[e._v("It is important to ensure proper installation of the "),t("strong",[t("code",[e._v("php-gd")])]),e._v(" extension to avoid any issues with image manipulation in Krayin.")])])])]),e._v(" "),t("h2",{attrs:{id:"php-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#php-configuration"}},[e._v("#")]),e._v(" PHP Configuration")]),e._v(" "),t("p",[e._v("Open your "),t("strong",[t("code",[e._v("php.ini")])]),e._v(" file and modify the following settings.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("memory_limit")]),e._v(": Set the "),t("strong",[t("code",[e._v("memory_limit")])]),e._v(" directive to "),t("strong",[t("code",[e._v("4G")])]),e._v(" or higher to ensure sufficient memory allocation for the application.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("max_execution_time")]),e._v(": Adjust the "),t("strong",[t("code",[e._v("max_execution_time")])]),e._v(" directive to "),t("strong",[t("code",[e._v("360")])]),e._v(" or higher. This value determines the maximum time (in seconds) a script is allowed to run. Increasing this value ensures that longer operations, such as import/export processes, can be completed successfully.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("date.timezone")]),e._v(": Set the "),t("strong",[t("code",[e._v("date.timezone")])]),e._v(" directive to your specific timezone. For example, "),t("strong",[t("code",[e._v("Asia/Kolkata")])]),e._v(". This ensures that date and time-related functions work accurately based on the specified timezone.")])])]),e._v(" "),t("div",{staticClass:"language-ini extra-class"},[t("pre",{pre:!0,attrs:{class:"language-ini"}},[t("code",[t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("memory_limit")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("4G")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("max_execution_time")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("360")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("date.timezone")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("Asia/Kolkata <- Change this to your own timezone.")]),e._v("\n")])])]),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Remember to restart your web server")]),e._v(" "),t("p",[e._v("Whenever you make changes to the PHP configuration file, be sure to restart Apache or NGINX to apply the modifications.")])]),e._v(" "),t("h2",{attrs:{id:"supported-database-servers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supported-database-servers"}},[e._v("#")]),e._v(" Supported Database Servers")]),e._v(" "),t("p",[e._v("Krayin supports the following database servers:")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("MySQL")]),e._v(": Version 8.0.32 or higher is recommended for optimal performance and compatibility.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("MariaDB")]),e._v(": Version 10.3 or higher is recommended for optimal performance and compatibility.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Database Collation")]),e._v(": The recommended collation for the database is "),t("strong",[t("code",[e._v("utf8mb4_unicode_ci")])]),e._v(", which ensures proper handling of Unicode characters and multilingual support.")])])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[118],{417:function(e,t,s){"use strict";s.r(t);var r=s(10),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"requirements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[e._v("#")]),e._v(" Requirements")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#server-configuration"}},[e._v("Server configuration")])]),t("li",[t("a",{attrs:{href:"#php-extensions"}},[e._v("PHP Extensions")])]),t("li",[t("a",{attrs:{href:"#php-configuration"}},[e._v("PHP Configuration")])]),t("li",[t("a",{attrs:{href:"#supported-database-servers"}},[e._v("Supported Database Servers")])])])]),t("p"),e._v(" "),t("p",[e._v("Before installing Krayin please make sure your server meets the following requirements,")]),e._v(" "),t("h2",{attrs:{id:"server-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#server-configuration"}},[e._v("#")]),e._v(" Server configuration")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("SERVER")]),e._v(": Apache 2 or NGINX")]),e._v(" "),t("li",[t("strong",[e._v("RAM")]),e._v(": 4GB or higher")]),e._v(" "),t("li",[t("strong",[e._v("Node")]),e._v(": v16.16.0 (LTS) or higher")]),e._v(" "),t("li",[t("strong",[e._v("PHP")]),e._v(": 8.1 or higher")]),e._v(" "),t("li",[t("strong",[e._v("Composer")]),e._v(": 2.5 or higher")])]),e._v(" "),t("h2",{attrs:{id:"php-extensions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#php-extensions"}},[e._v("#")]),e._v(" PHP Extensions")]),e._v(" "),t("p",[e._v("Ensure the following extensions are installed and enabled. You can check using the "),t("strong",[t("code",[e._v("phpinfo()")])]),e._v(" page or the "),t("strong",[t("code",[e._v("php -m")])]),e._v(" command.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("php-intl extension")]),e._v(": This extension is required for internationalization support in Krayin.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("php-gd extension")]),e._v(": The "),t("strong",[t("code",[e._v("php-gd")])]),e._v(" extension must be properly installed to ensure correct image functionality in the project. If not installed correctly, image-related features may not work as expected.")]),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Note")]),e._v(" "),t("p",[e._v("It is important to ensure proper installation of the "),t("strong",[t("code",[e._v("php-gd")])]),e._v(" extension to avoid any issues with image manipulation in Krayin.")])])])]),e._v(" "),t("h2",{attrs:{id:"php-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#php-configuration"}},[e._v("#")]),e._v(" PHP Configuration")]),e._v(" "),t("p",[e._v("Open your "),t("strong",[t("code",[e._v("php.ini")])]),e._v(" file and modify the following settings.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("memory_limit")]),e._v(": Set the "),t("strong",[t("code",[e._v("memory_limit")])]),e._v(" directive to "),t("strong",[t("code",[e._v("4G")])]),e._v(" or higher to ensure sufficient memory allocation for the application.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("max_execution_time")]),e._v(": Adjust the "),t("strong",[t("code",[e._v("max_execution_time")])]),e._v(" directive to "),t("strong",[t("code",[e._v("360")])]),e._v(" or higher. This value determines the maximum time (in seconds) a script is allowed to run. Increasing this value ensures that longer operations, such as import/export processes, can be completed successfully.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("date.timezone")]),e._v(": Set the "),t("strong",[t("code",[e._v("date.timezone")])]),e._v(" directive to your specific timezone. For example, "),t("strong",[t("code",[e._v("Asia/Kolkata")])]),e._v(". This ensures that date and time-related functions work accurately based on the specified timezone.")])])]),e._v(" "),t("div",{staticClass:"language-ini extra-class"},[t("pre",{pre:!0,attrs:{class:"language-ini"}},[t("code",[t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("memory_limit")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("4G")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("max_execution_time")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("360")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("date.timezone")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("Asia/Kolkata <- Change this to your own timezone.")]),e._v("\n")])])]),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Remember to restart your web server")]),e._v(" "),t("p",[e._v("Whenever you make changes to the PHP configuration file, be sure to restart Apache or NGINX to apply the modifications.")])]),e._v(" "),t("h2",{attrs:{id:"supported-database-servers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supported-database-servers"}},[e._v("#")]),e._v(" Supported Database Servers")]),e._v(" "),t("p",[e._v("Krayin supports the following database servers:")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("MySQL")]),e._v(": Version 8.0.32 or higher is recommended for optimal performance and compatibility.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("MariaDB")]),e._v(": Version 10.3 or higher is recommended for optimal performance and compatibility.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Database Collation")]),e._v(": The recommended collation for the database is "),t("strong",[t("code",[e._v("utf8mb4_unicode_ci")])]),e._v(", which ensures proper handling of Unicode characters and multilingual support.")])])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/119.b7dd1a03.js b/assets/js/119.28d77664.js similarity index 98% rename from assets/js/119.b7dd1a03.js rename to assets/js/119.28d77664.js index 8abd08d..978c31a 100644 --- a/assets/js/119.b7dd1a03.js +++ b/assets/js/119.28d77664.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[119],{417:function(e,n,a){"use strict";a.r(n);var t=a(10),o=Object(t.a)({},(function(){var e=this,n=e._self._c;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h2",{attrs:{id:"package-development"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#package-development"}},[e._v("#")]),e._v(" Package Development")]),e._v(" "),n("p",[e._v("If you are looking to extend the functionalities of Krayin CRM platform, creating a package is the way to go. A package is a self-contained module that adds specific features to the platform. It allows developers to add custom functionality to the platform without modifying the core codebase.")]),e._v(" "),n("p",[e._v("This guide will walk you through the process of developing a package for Krayin.")]),e._v(" "),n("p",[e._v("In Krayin, we have created numerous packages located at "),n("strong",[n("code",[e._v("packages/Webkul/")])]),e._v(". Below is a basic tree structure of a package:")]),e._v(" "),n("div",{staticClass:"language-directory-structure extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("└── Webkul\n └── Category\n └── src\n ├── Config\n │ ├── acl.php\n │ ├── admin-menu.php\n │ └── system.php\n ├── Console\n │ └── Commands\n ├── Contracts\n │ └── Category.php\n ├── Database\n │ ├── Migrations\n │ │ └── 2023_04_21_173057_create_categories_table.php\n │ └── Seeders\n ├── Events\n ├── Http\n │ ├── Controllers\n │ │ └── Admin\n │ │ └── CategoryController.php\n │ ├── Middleware\n │ └── Requests\n │ └── CategoryRequest.php\n ├── Listeners\n ├── Mail\n ├── Models\n │ ├── Category.php\n │ └── CategoryProxy.php\n ├── Providers\n │ ├── CategoryServiceProvider.php\n │ └── ModuleServiceProvider.php\n ├── Routes\n │ └── admin-routes.php\n ├── Repositories\n │ └── CategoryRepository.php\n └── Resources\n ├── assets\n │ ├── images\n │ │ └── category-icon.png\n │ ├── js\n │ │ └── app.js\n │ └── css\n │ └── app.css\n ├── lang\n │ ├── ar.php\n │ └── en.php\n └── views\n ├── admin\n │ └── layouts\n │ └── style.blade.php\n ├── index.blade.php\n ├── create.blade.php\n └── edit.blade.php\n")])])])])}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[119],{418:function(e,n,a){"use strict";a.r(n);var t=a(10),o=Object(t.a)({},(function(){var e=this,n=e._self._c;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h2",{attrs:{id:"package-development"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#package-development"}},[e._v("#")]),e._v(" Package Development")]),e._v(" "),n("p",[e._v("If you are looking to extend the functionalities of Krayin CRM platform, creating a package is the way to go. A package is a self-contained module that adds specific features to the platform. It allows developers to add custom functionality to the platform without modifying the core codebase.")]),e._v(" "),n("p",[e._v("This guide will walk you through the process of developing a package for Krayin.")]),e._v(" "),n("p",[e._v("In Krayin, we have created numerous packages located at "),n("strong",[n("code",[e._v("packages/Webkul/")])]),e._v(". Below is a basic tree structure of a package:")]),e._v(" "),n("div",{staticClass:"language-directory-structure extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("└── Webkul\n └── Category\n └── src\n ├── Config\n │ ├── acl.php\n │ ├── admin-menu.php\n │ └── system.php\n ├── Console\n │ └── Commands\n ├── Contracts\n │ └── Category.php\n ├── Database\n │ ├── Migrations\n │ │ └── 2023_04_21_173057_create_categories_table.php\n │ └── Seeders\n ├── Events\n ├── Http\n │ ├── Controllers\n │ │ └── Admin\n │ │ └── CategoryController.php\n │ ├── Middleware\n │ └── Requests\n │ └── CategoryRequest.php\n ├── Listeners\n ├── Mail\n ├── Models\n │ ├── Category.php\n │ └── CategoryProxy.php\n ├── Providers\n │ ├── CategoryServiceProvider.php\n │ └── ModuleServiceProvider.php\n ├── Routes\n │ └── admin-routes.php\n ├── Repositories\n │ └── CategoryRepository.php\n └── Resources\n ├── assets\n │ ├── images\n │ │ └── category-icon.png\n │ ├── js\n │ │ └── app.js\n │ └── css\n │ └── app.css\n ├── lang\n │ ├── ar.php\n │ └── en.php\n └── views\n ├── admin\n │ └── layouts\n │ └── style.blade.php\n ├── index.blade.php\n ├── create.blade.php\n └── edit.blade.php\n")])])])])}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/120.71f16f74.js b/assets/js/120.5c6d5bdd.js similarity index 99% rename from assets/js/120.71f16f74.js rename to assets/js/120.5c6d5bdd.js index 3ba1236..972ae33 100644 --- a/assets/js/120.71f16f74.js +++ b/assets/js/120.5c6d5bdd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[120],{418:function(t,e,s){"use strict";s.r(e);var a=s(10),n=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#menu"}},[t._v("#")]),t._v(" Menu")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#configure-the-menu"}},[t._v("Configure the menu")]),e("ul",[e("li",[e("a",{attrs:{href:"#create-configuration-file"}},[t._v("Create Configuration File")])]),e("li",[e("a",{attrs:{href:"#define-menu-items"}},[t._v("Define Menu Items")])]),e("li",[e("a",{attrs:{href:"#define-routes"}},[t._v("Define Routes")])]),e("li",[e("a",{attrs:{href:"#add-menu-icon"}},[t._v("Add Menu Icon")])]),e("li",[e("a",{attrs:{href:"#merge-configuration"}},[t._v("Merge Configuration")])]),e("li",[e("a",{attrs:{href:"#optimize-application"}},[t._v("Optimize Application")])])])]),e("li",[e("a",{attrs:{href:"#level-of-menu"}},[t._v("Level of Menu")]),e("ul",[e("li",[e("a",{attrs:{href:"#first-level-sidebar"}},[t._v("First Level (Sidebar)")])]),e("li",[e("a",{attrs:{href:"#second-level-hover-menu"}},[t._v("Second Level (Hover Menu)")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("The menu in Krayin allows developers to customize and extend the default menu items within the admin panel. By adding custom menu items, you can provide easy access to various sections and features specific to your package. This guide will walk you through the process of configuring the menu for your custom package.")]),t._v(" "),e("h2",{attrs:{id:"configure-the-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configure-the-menu"}},[t._v("#")]),t._v(" Configure the menu")]),t._v(" "),e("p",[t._v("To ensure that the menu includes the necessary configuration, follow these steps:")]),t._v(" "),e("h3",{attrs:{id:"create-configuration-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-file"}},[t._v("#")]),t._v(" Create Configuration File")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("Navigate to your package's source directory, typically located at "),e("code",[t._v("packages/Webkul/Category/src")]),t._v(".")])]),t._v(" "),e("li",[e("p",[t._v("Create a new directory named "),e("code",[t._v("Config")]),t._v(" if it doesn't already exist.")])]),t._v(" "),e("li",[e("p",[t._v("Inside the "),e("code",[t._v("Config")]),t._v(" directory, create a file "),e("code",[t._v("named menu.php")]),t._v(".")])])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Config\n └── menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),e("h3",{attrs:{id:"define-menu-items"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-menu-items"}},[t._v("#")]),t._v(" Define Menu Items")]),t._v(" "),e("p",[t._v("Open "),e("code",[t._v("menu.php")]),t._v(" and define your menu items using an array structure. Each item should include:")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("key")]),t._v(" Unique identifier for the menu item.")]),t._v(" "),e("li",[e("code",[t._v("name")]),t._v(" Display name of the menu item.")]),t._v(" "),e("li",[e("code",[t._v("route")]),t._v(" Laravel route name corresponding to the menu item.")]),t._v(" "),e("li",[e("code",[t._v("sort")]),t._v(" Optional. Sort order for menu items.")]),t._v(" "),e("li",[e("code",[t._v("icon")]),t._v(" Optional. CSS class for an icon associated with the menu item.")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category.admin.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sort'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon-category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),e("h3",{attrs:{id:"define-routes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-routes"}},[t._v("#")]),t._v(" Define Routes")]),t._v(" "),e("p",[t._v("In your package's "),e("code",[t._v("routes.php")]),t._v(" file, define the named route used in "),e("code",[t._v("menu.php")]),t._v(" as follows.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category.admin.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("In this step, we define the route that corresponds to the menu item added in the previous step.")]),t._v(" "),e("h3",{attrs:{id:"add-menu-icon"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-menu-icon"}},[t._v("#")]),t._v(" Add Menu Icon")]),t._v(" "),e("p",[t._v("You can add menu icon by creating the file icons.scss, follow the below provided directory structure.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── assets\n ├── css\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("css\n ├── js\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("js\n └── images\n \n")])])]),e("p",[t._v("Here the example how you can add menu icon.")]),t._v(" "),e("div",{staticClass:"language-scss extra-class"},[e("pre",{pre:!0,attrs:{class:"language-scss"}},[e("code",[e("span",{pre:!0,attrs:{class:"token selector"}},[t._v(".icon-category ")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-position")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" -371px -2px"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-image")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token url"}},[t._v("url")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../images/sprite-main.svg"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h3",{attrs:{id:"merge-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#merge-configuration"}},[t._v("#")]),t._v(" Merge Configuration")]),t._v(" "),e("p",[t._v("In your package's service provider ("),e("code",[t._v("CategoryServiceProvider")]),t._v("), use "),e("code",[t._v("mergeConfigFrom()")]),t._v(" to integrate your "),e("code",[t._v("menu.php")]),t._v(" configuration with the core menu.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeConfigFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/Config/menu.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'menu.admin'")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("h3",{attrs:{id:"optimize-application"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#optimize-application"}},[t._v("#")]),t._v(" Optimize Application")]),t._v(" "),e("p",[t._v("Finally, run the following command to optimize your application:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("php artisan optimize:clear\n")])])]),e("p",[t._v("After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.")]),t._v(" "),e("h2",{attrs:{id:"level-of-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#level-of-menu"}},[t._v("#")]),t._v(" Level of Menu")]),t._v(" "),e("p",[t._v("In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:")]),t._v(" "),e("h3",{attrs:{id:"first-level-sidebar"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#first-level-sidebar"}},[t._v("#")]),t._v(" First Level (Sidebar)")]),t._v(" "),e("p",[t._v("This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.")]),t._v(" "),e("h3",{attrs:{id:"second-level-hover-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#second-level-hover-menu"}},[t._v("#")]),t._v(" Second Level (Hover Menu)")]),t._v(" "),e("p",[t._v('When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.')])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[120],{419:function(t,e,s){"use strict";s.r(e);var a=s(10),n=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#menu"}},[t._v("#")]),t._v(" Menu")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#configure-the-menu"}},[t._v("Configure the menu")]),e("ul",[e("li",[e("a",{attrs:{href:"#create-configuration-file"}},[t._v("Create Configuration File")])]),e("li",[e("a",{attrs:{href:"#define-menu-items"}},[t._v("Define Menu Items")])]),e("li",[e("a",{attrs:{href:"#define-routes"}},[t._v("Define Routes")])]),e("li",[e("a",{attrs:{href:"#add-menu-icon"}},[t._v("Add Menu Icon")])]),e("li",[e("a",{attrs:{href:"#merge-configuration"}},[t._v("Merge Configuration")])]),e("li",[e("a",{attrs:{href:"#optimize-application"}},[t._v("Optimize Application")])])])]),e("li",[e("a",{attrs:{href:"#level-of-menu"}},[t._v("Level of Menu")]),e("ul",[e("li",[e("a",{attrs:{href:"#first-level-sidebar"}},[t._v("First Level (Sidebar)")])]),e("li",[e("a",{attrs:{href:"#second-level-hover-menu"}},[t._v("Second Level (Hover Menu)")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("The menu in Krayin allows developers to customize and extend the default menu items within the admin panel. By adding custom menu items, you can provide easy access to various sections and features specific to your package. This guide will walk you through the process of configuring the menu for your custom package.")]),t._v(" "),e("h2",{attrs:{id:"configure-the-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configure-the-menu"}},[t._v("#")]),t._v(" Configure the menu")]),t._v(" "),e("p",[t._v("To ensure that the menu includes the necessary configuration, follow these steps:")]),t._v(" "),e("h3",{attrs:{id:"create-configuration-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-file"}},[t._v("#")]),t._v(" Create Configuration File")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("Navigate to your package's source directory, typically located at "),e("code",[t._v("packages/Webkul/Category/src")]),t._v(".")])]),t._v(" "),e("li",[e("p",[t._v("Create a new directory named "),e("code",[t._v("Config")]),t._v(" if it doesn't already exist.")])]),t._v(" "),e("li",[e("p",[t._v("Inside the "),e("code",[t._v("Config")]),t._v(" directory, create a file "),e("code",[t._v("named menu.php")]),t._v(".")])])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Config\n └── menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),e("h3",{attrs:{id:"define-menu-items"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-menu-items"}},[t._v("#")]),t._v(" Define Menu Items")]),t._v(" "),e("p",[t._v("Open "),e("code",[t._v("menu.php")]),t._v(" and define your menu items using an array structure. Each item should include:")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("key")]),t._v(" Unique identifier for the menu item.")]),t._v(" "),e("li",[e("code",[t._v("name")]),t._v(" Display name of the menu item.")]),t._v(" "),e("li",[e("code",[t._v("route")]),t._v(" Laravel route name corresponding to the menu item.")]),t._v(" "),e("li",[e("code",[t._v("sort")]),t._v(" Optional. Sort order for menu items.")]),t._v(" "),e("li",[e("code",[t._v("icon")]),t._v(" Optional. CSS class for an icon associated with the menu item.")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category.admin.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sort'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon-category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),e("h3",{attrs:{id:"define-routes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-routes"}},[t._v("#")]),t._v(" Define Routes")]),t._v(" "),e("p",[t._v("In your package's "),e("code",[t._v("routes.php")]),t._v(" file, define the named route used in "),e("code",[t._v("menu.php")]),t._v(" as follows.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category.admin.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("In this step, we define the route that corresponds to the menu item added in the previous step.")]),t._v(" "),e("h3",{attrs:{id:"add-menu-icon"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-menu-icon"}},[t._v("#")]),t._v(" Add Menu Icon")]),t._v(" "),e("p",[t._v("You can add menu icon by creating the file icons.scss, follow the below provided directory structure.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── assets\n ├── css\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("css\n ├── js\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("js\n └── images\n \n")])])]),e("p",[t._v("Here the example how you can add menu icon.")]),t._v(" "),e("div",{staticClass:"language-scss extra-class"},[e("pre",{pre:!0,attrs:{class:"language-scss"}},[e("code",[e("span",{pre:!0,attrs:{class:"token selector"}},[t._v(".icon-category ")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-position")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" -371px -2px"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-image")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token url"}},[t._v("url")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../images/sprite-main.svg"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h3",{attrs:{id:"merge-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#merge-configuration"}},[t._v("#")]),t._v(" Merge Configuration")]),t._v(" "),e("p",[t._v("In your package's service provider ("),e("code",[t._v("CategoryServiceProvider")]),t._v("), use "),e("code",[t._v("mergeConfigFrom()")]),t._v(" to integrate your "),e("code",[t._v("menu.php")]),t._v(" configuration with the core menu.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeConfigFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/Config/menu.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'menu.admin'")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("h3",{attrs:{id:"optimize-application"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#optimize-application"}},[t._v("#")]),t._v(" Optimize Application")]),t._v(" "),e("p",[t._v("Finally, run the following command to optimize your application:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("php artisan optimize:clear\n")])])]),e("p",[t._v("After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.")]),t._v(" "),e("h2",{attrs:{id:"level-of-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#level-of-menu"}},[t._v("#")]),t._v(" Level of Menu")]),t._v(" "),e("p",[t._v("In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:")]),t._v(" "),e("h3",{attrs:{id:"first-level-sidebar"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#first-level-sidebar"}},[t._v("#")]),t._v(" First Level (Sidebar)")]),t._v(" "),e("p",[t._v("This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.")]),t._v(" "),e("h3",{attrs:{id:"second-level-hover-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#second-level-hover-menu"}},[t._v("#")]),t._v(" Second Level (Hover Menu)")]),t._v(" "),e("p",[t._v('When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.')])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/121.3f79ddd5.js b/assets/js/121.90e73262.js similarity index 99% rename from assets/js/121.3f79ddd5.js rename to assets/js/121.90e73262.js index 830a474..076d465 100644 --- a/assets/js/121.3f79ddd5.js +++ b/assets/js/121.90e73262.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[121],{419:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"bundling-assets"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bundling-assets"}},[t._v("#")]),t._v(" Bundling Assets")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#directory-structure"}},[t._v("Directory Structure")])]),s("li",[s("a",{attrs:{href:"#configure-compiling-assets"}},[t._v("Configure Compiling Assets")])]),s("li",[s("a",{attrs:{href:"#create-configuration-files"}},[t._v("Create Configuration Files")]),s("ul",[s("li",[s("a",{attrs:{href:"#set-up-package-json"}},[t._v("Set Up package.json")])]),s("li",[s("a",{attrs:{href:"#set-up-webpack-mix-js"}},[t._v("Set Up webpack.mix.js")])]),s("li",[s("a",{attrs:{href:"#importing-laravel-mix"}},[t._v("Importing Laravel Mix")])]),s("li",[s("a",{attrs:{href:"#merging-manifests"}},[t._v("Merging Manifests")])]),s("li",[s("a",{attrs:{href:"#setting-the-public-path"}},[t._v("Setting the Public Path")])]),s("li",[s("a",{attrs:{href:"#mix-configuration"}},[t._v("Mix Configuration")])]),s("li",[s("a",{attrs:{href:"#asset-compilation"}},[t._v("Asset Compilation")])]),s("li",[s("a",{attrs:{href:"#webpack-configuration"}},[t._v("Webpack Configuration")])]),s("li",[s("a",{attrs:{href:"#source-maps"}},[t._v("Source Maps")])]),s("li",[s("a",{attrs:{href:"#versioning"}},[t._v("Versioning")])])])]),s("li",[s("a",{attrs:{href:"#load-assets-in-blade-file"}},[t._v("Load Assets in Blade File")])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("Assets in web development refer to files such as stylesheets, scripts, and images that are utilized to enhance the functionality, design, and interactivity of a web application or website. These files are essential for providing styling, behavior, and media content to the user interface.")]),t._v(" "),s("ul",[s("li",[s("strong",[t._v("CSS")]),t._v(": Cascading Style Sheets (CSS) define the presentation and layout of HTML elements, ensuring consistent styling across pages.")]),t._v(" "),s("li",[s("strong",[t._v("JavaScript")]),t._v(": JavaScript (JS) adds interactivity and dynamic behavior to web pages, enabling features like form validation, animations, and AJAX requests.")]),t._v(" "),s("li",[s("strong",[t._v("Images")]),t._v(": Images enhance visual content, including logos, illustrations, and photographs, making web pages more engaging and informative.")])]),t._v(" "),s("p",[t._v("To learn in detail about Bundling Asset, you can visit the Laravel documentation "),s("a",{attrs:{href:"https://laravel.com/docs/10.x/frontend#bundling-assets",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"directory-structure"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[t._v("#")]),t._v(" Directory Structure")]),t._v(" "),s("p",[t._v("To maintain organization and manage these assets effectively, developers typically structure them within dedicated directories in the project's "),s("code",[t._v("Resources\\assets")]),t._v(" directory. For instance:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("/Resources/assets/images")]),t._v(": Stores image files used throughout the application.")]),t._v(" "),s("li",[s("code",[t._v("/Resources/assets/js")]),t._v(": Holds JavaScript files such as "),s("code",[t._v("app.js")]),t._v(" for client-side scripting.")]),t._v(" "),s("li",[s("code",[t._v("/Resources/assets/sass")]),t._v(": Contains CSS files like "),s("code",[t._v("app.css")]),t._v(" for styling the application.")])]),t._v(" "),s("p",[t._v("Here's the updated directory structure:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Resources\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── assets\n ├── css\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("css\n ├── js\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("js\n └── images\n \n")])])]),s("h2",{attrs:{id:"configure-compiling-assets"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#configure-compiling-assets"}},[t._v("#")]),t._v(" Configure Compiling Assets")]),t._v(" "),s("p",[t._v("To compile the assets, perform the following steps:")]),t._v(" "),s("h2",{attrs:{id:"create-configuration-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-files"}},[t._v("#")]),t._v(" Create Configuration Files")]),t._v(" "),s("p",[t._v("First, create the following configuration files in the root directory of your package, specifically inside "),s("code",[t._v("packages/Webkul/Category")]),t._v(":")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("package.json")])]),t._v(" "),s("li",[s("code",[t._v("webpack.mix.js")])])]),t._v(" "),s("h3",{attrs:{id:"set-up-package-json"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#set-up-package-json"}},[t._v("#")]),t._v(" Set Up package.json")]),t._v(" "),s("p",[t._v("Copy and paste the following code into your "),s("code",[t._v("package.json")]),t._v(" file:")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"private"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dev"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"npm run development"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"development"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"watch"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"watch-poll"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch -- --watch-options-poll=1000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hot"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch --hot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prod"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"npm run production"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"production"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix --production"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"axios"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.21.4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cross-env"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^7.0.3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"jquery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^3.6.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^6.0.6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^master.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lodash"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^4.17.19"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"postcss"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^8.1.14"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sass"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.32.8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sass-loader"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^11.0.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.6.12"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-loader"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^15.9.6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-template-compiler"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.6.12"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moment"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.29.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vee-validate"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.2.15"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-cal"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^3.10.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-kanban"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.8.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-timeago"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^5.1.3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vuedraggable"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.24.3"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),s("h4",{attrs:{id:"explanation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("package.json")]),t._v(" file includes the following:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Ensures the package is private and not published to a registry.")])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("Scripts")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("dev: Runs the development script. This command is a shortcut for running npm run development.")])]),t._v(" "),s("li",[s("p",[t._v("development: Executes mix. This typically refers to Laravel Mix, a wrapper around Webpack, to compile and bundle assets in development mode.")])]),t._v(" "),s("li",[s("p",[t._v("watch: Runs mix watch. This command watches for file changes and automatically recompiles assets whenever a change is detected, useful during development for continuous integration of updates.")])]),t._v(" "),s("li",[s("p",[t._v("watch-poll: Runs mix watch with the --watch-options-poll=1000 option. This enables polling for file changes every 1000 milliseconds (1 second), which can be useful in certain development environments where file change notifications are unreliable.")])]),t._v(" "),s("li",[s("p",[t._v("hot: Runs mix watch --hot. This command enables Hot Module Replacement (HMR), allowing modules to be replaced without a full browser refresh, enhancing development experience by maintaining application state.")])]),t._v(" "),s("li",[s("p",[t._v("prod: Runs the production script. This command is a shortcut for running npm run production.")])]),t._v(" "),s("li",[s("p",[t._v("production: Executes mix --production. This compiles and bundles assets for production, typically with optimizations like minification, which makes the assets smaller and faster to load in a production environment.")])])])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("DevDependencies:")]),t._v("\nThe devDependencies section in a package.json file specifies the packages that are required for the development of the application. These dependencies are not included in the production build. Here’s a brief overview of each dependency listed:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("axios: A popular promise-based HTTP client for making requests to servers. It is used to handle HTTP requests and responses.")])]),t._v(" "),s("li",[s("p",[t._v("cross-env: A utility that allows you to set environment variables across different platforms in a consistent way. This is particularly useful for ensuring scripts work across various operating systems.")])]),t._v(" "),s("li",[s("p",[t._v("jquery: A fast, small, and feature-rich JavaScript library. It simplifies things like HTML document traversal and manipulation, event handling, and animation.")])]),t._v(" "),s("li",[s("p",[t._v("laravel-mix: An elegant wrapper around Webpack for the Laravel framework. It simplifies the process of compiling and minifying CSS and JavaScript files.")])]),t._v(" "),s("li",[s("p",[t._v("laravel-mix-merge-manifest: A Laravel Mix extension that merges manifests when you have multiple Mix instances in your project. This is useful for complex projects with multiple entry points.")])]),t._v(" "),s("li",[s("p",[t._v("lodash: A modern JavaScript utility library delivering modularity, performance, and extras. It provides helpful functions for working with arrays, numbers, objects, strings, etc.")])]),t._v(" "),s("li",[s("p",[t._v("postcss: A tool for transforming CSS with JavaScript plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS syntax, inline images, and more.")])]),t._v(" "),s("li",[s("p",[t._v("sass: A preprocessor scripting language that is interpreted or compiled into CSS. It allows you to use features such as variables, nested rules, and mixins.")])]),t._v(" "),s("li",[s("p",[t._v("sass-loader: A loader for Webpack that compiles SCSS or SASS files to CSS. It allows you to use Sass in your Webpack workflow.")])]),t._v(" "),s("li",[s("p",[t._v("vue: A progressive JavaScript framework for building user interfaces. Vue is designed to be incrementally adaptable and focuses on the view layer.")])]),t._v(" "),s("li",[s("p",[t._v("vue-loader: A loader for Webpack that allows you to write Vue components in a single file format, combining HTML, JavaScript, and CSS.")])]),t._v(" "),s("li",[s("p",[t._v("vue-template-compiler: A package used to pre-compile Vue templates into render functions. It is typically used alongside vue-loader to compile Vue components.")])])])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("Dependencies:")]),t._v(" These are essential packages required for the project to function, including:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("moment: A widely-used library for parsing, validating, manipulating, and formatting dates in JavaScript. It simplifies working with dates and times.")])]),t._v(" "),s("li",[s("p",[t._v("vee-validate: A form validation library for Vue.js that allows you to validate form inputs with simple declarative syntax. It helps manage form validation logic and provides user feedback on form errors.")])]),t._v(" "),s("li",[s("p",[t._v("vue-cal: A flexible calendar component for Vue.js. It provides features like multi-range selection, drag-and-drop, and custom event rendering, making it useful for implementing calendar functionality in applications.")])]),t._v(" "),s("li",[s("p",[t._v("vue-kanban: A Kanban board component for Vue.js. It allows you to create and manage tasks in a Kanban-style board, useful for project management and task tracking applications.")])]),t._v(" "),s("li",[s("p",[t._v('vue-timeago: A Vue.js component that automatically updates the display of dates and times to a "time ago" format, such as "3 minutes ago" or "2 days ago". It enhances the user interface by providing relative time formatting.')])]),t._v(" "),s("li",[s("p",[t._v("vuedraggable: A Vue.js component based on the Sortable.js library that enables drag-and-drop functionality. It allows you to create draggable lists and components, enhancing the interactivity of your application.")])])])])]),t._v(" "),s("h3",{attrs:{id:"set-up-webpack-mix-js"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#set-up-webpack-mix-js"}},[t._v("#")]),t._v(" Set Up webpack.mix.js")]),t._v(" "),s("p",[t._v("Here the configuration of webpack.min.js you can customize for your configuration")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'undefined'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'publishable/assets'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../../public/vendor/webkul/category/assets"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPublicPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("publicPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeManifest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("disableNotifications")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("js")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/js/app.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"js/category.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/sass/app.scss"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"css/category.css"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("options")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("processCssUrls")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("vue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("webpackConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("resolve")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("alias")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v("'vue$'")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue/dist/vue.runtime.js'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sourceMaps")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("version")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This script is a configuration file for Laravel Mix, a tool for compiling and optimizing frontend assets in a Laravel application. Let's break down each part of the code:")]),t._v(" "),s("h3",{attrs:{id:"importing-laravel-mix"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#importing-laravel-mix"}},[t._v("#")]),t._v(" Importing Laravel Mix")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'undefined'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This code imports Laravel Mix. The conditional check ensures that "),s("code",[t._v("mix")]),t._v(" is defined, though it's unnecessary here as "),s("code",[t._v("require")]),t._v(" should always return the module correctly.")]),t._v(" "),s("h3",{attrs:{id:"merging-manifests"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#merging-manifests"}},[t._v("#")]),t._v(" Merging Manifests")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("This imports the "),s("code",[t._v("laravel-mix-merge-manifest")]),t._v(" package, which allows merging multiple Mix manifests.")]),t._v(" "),s("h3",{attrs:{id:"setting-the-public-path"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-the-public-path"}},[t._v("#")]),t._v(" Setting the Public Path")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'publishable/assets'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../../public/vendor/webkul/admin/assets"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The "),s("code",[t._v("publicPath")]),t._v(" is set based on whether the build is for production or development. In production, it sets the path to "),s("code",[t._v("publishable/assets")]),t._v(", otherwise, it sets the path to "),s("code",[t._v("../../../public/vendor/webkul/admin/assets")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"mix-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mix-configuration"}},[t._v("#")]),t._v(" Mix Configuration")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPublicPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("publicPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeManifest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("disableNotifications")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("ul",[s("li",[s("p",[t._v("mix.setPublicPath(publicPath): Sets the public directory where the compiled assets will be stored.")])]),t._v(" "),s("li",[s("p",[t._v("mix.mergeManifest(): Merges the Mix manifests.")])]),t._v(" "),s("li",[s("p",[t._v("mix.disableNotifications(): Disables system notifications for the build process.")])])]),t._v(" "),s("h3",{attrs:{id:"asset-compilation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#asset-compilation"}},[t._v("#")]),t._v(" Asset Compilation")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("js")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/js/app.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"js/admin.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/sass/app.scss"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"css/admin.css"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("options")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("processCssUrls")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("vue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])]),s("ul",[s("li",[s("p",[t._v("mix.js(): Compiles the JavaScript file from the specified source to the specified destination.")])]),t._v(" "),s("li",[s("p",[t._v("mix.copy(): Copies image files from the source directory to the public path.")])]),t._v(" "),s("li",[s("p",[t._v("mix.sass(): Compiles the SASS file to CSS.")])]),t._v(" "),s("li",[s("p",[t._v("options({ processCssUrls: false }): Disables the processing of URLs found in CSS files.")])]),t._v(" "),s("li",[s("p",[t._v("vue(): Configures Laravel Mix to handle Vue.js single-file components.")])])]),t._v(" "),s("h3",{attrs:{id:"webpack-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#webpack-configuration"}},[t._v("#")]),t._v(" Webpack Configuration")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("webpackConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("resolve")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("alias")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v("'vue$'")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue/dist/vue.runtime.js'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("This customizes the Webpack configuration. It sets an alias for Vue to use the runtime-only build.")]),t._v(" "),s("h3",{attrs:{id:"source-maps"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#source-maps"}},[t._v("#")]),t._v(" Source Maps")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sourceMaps")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This generates source maps only in non-production environments to help with debugging.")]),t._v(" "),s("h3",{attrs:{id:"versioning"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#versioning"}},[t._v("#")]),t._v(" Versioning")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("version")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This enables versioning in production, appending a unique hash to filenames to help with cache busting.")]),t._v(" "),s("p",[t._v("Overall, this configuration sets up Laravel Mix to handle JavaScript, images, SASS, and Vue.js components, with different behaviors for development and production environments.")]),t._v(" "),s("h2",{attrs:{id:"load-assets-in-blade-file"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#load-assets-in-blade-file"}},[t._v("#")]),t._v(" Load Assets in Blade File")]),t._v(" "),s("p",[t._v("Add the following code to your Blade file to load assets from your package:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("link rel"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"stylesheet"')]),t._v(" href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/ui/assets/css/ui.css') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("link rel"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"stylesheet"')]),t._v(" href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/category/assets/css/category.css') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"text/javascript"')]),t._v(" src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/category/assets/js/category.js') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"text/javascript"')]),t._v(" src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/ui/assets/js/ui.js') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[121],{422:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"bundling-assets"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bundling-assets"}},[t._v("#")]),t._v(" Bundling Assets")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#directory-structure"}},[t._v("Directory Structure")])]),s("li",[s("a",{attrs:{href:"#configure-compiling-assets"}},[t._v("Configure Compiling Assets")])]),s("li",[s("a",{attrs:{href:"#create-configuration-files"}},[t._v("Create Configuration Files")]),s("ul",[s("li",[s("a",{attrs:{href:"#set-up-package-json"}},[t._v("Set Up package.json")])]),s("li",[s("a",{attrs:{href:"#set-up-webpack-mix-js"}},[t._v("Set Up webpack.mix.js")])]),s("li",[s("a",{attrs:{href:"#importing-laravel-mix"}},[t._v("Importing Laravel Mix")])]),s("li",[s("a",{attrs:{href:"#merging-manifests"}},[t._v("Merging Manifests")])]),s("li",[s("a",{attrs:{href:"#setting-the-public-path"}},[t._v("Setting the Public Path")])]),s("li",[s("a",{attrs:{href:"#mix-configuration"}},[t._v("Mix Configuration")])]),s("li",[s("a",{attrs:{href:"#asset-compilation"}},[t._v("Asset Compilation")])]),s("li",[s("a",{attrs:{href:"#webpack-configuration"}},[t._v("Webpack Configuration")])]),s("li",[s("a",{attrs:{href:"#source-maps"}},[t._v("Source Maps")])]),s("li",[s("a",{attrs:{href:"#versioning"}},[t._v("Versioning")])])])]),s("li",[s("a",{attrs:{href:"#load-assets-in-blade-file"}},[t._v("Load Assets in Blade File")])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("Assets in web development refer to files such as stylesheets, scripts, and images that are utilized to enhance the functionality, design, and interactivity of a web application or website. These files are essential for providing styling, behavior, and media content to the user interface.")]),t._v(" "),s("ul",[s("li",[s("strong",[t._v("CSS")]),t._v(": Cascading Style Sheets (CSS) define the presentation and layout of HTML elements, ensuring consistent styling across pages.")]),t._v(" "),s("li",[s("strong",[t._v("JavaScript")]),t._v(": JavaScript (JS) adds interactivity and dynamic behavior to web pages, enabling features like form validation, animations, and AJAX requests.")]),t._v(" "),s("li",[s("strong",[t._v("Images")]),t._v(": Images enhance visual content, including logos, illustrations, and photographs, making web pages more engaging and informative.")])]),t._v(" "),s("p",[t._v("To learn in detail about Bundling Asset, you can visit the Laravel documentation "),s("a",{attrs:{href:"https://laravel.com/docs/10.x/frontend#bundling-assets",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"directory-structure"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[t._v("#")]),t._v(" Directory Structure")]),t._v(" "),s("p",[t._v("To maintain organization and manage these assets effectively, developers typically structure them within dedicated directories in the project's "),s("code",[t._v("Resources\\assets")]),t._v(" directory. For instance:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("/Resources/assets/images")]),t._v(": Stores image files used throughout the application.")]),t._v(" "),s("li",[s("code",[t._v("/Resources/assets/js")]),t._v(": Holds JavaScript files such as "),s("code",[t._v("app.js")]),t._v(" for client-side scripting.")]),t._v(" "),s("li",[s("code",[t._v("/Resources/assets/sass")]),t._v(": Contains CSS files like "),s("code",[t._v("app.css")]),t._v(" for styling the application.")])]),t._v(" "),s("p",[t._v("Here's the updated directory structure:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Resources\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── assets\n ├── css\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("css\n ├── js\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("js\n └── images\n \n")])])]),s("h2",{attrs:{id:"configure-compiling-assets"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#configure-compiling-assets"}},[t._v("#")]),t._v(" Configure Compiling Assets")]),t._v(" "),s("p",[t._v("To compile the assets, perform the following steps:")]),t._v(" "),s("h2",{attrs:{id:"create-configuration-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-files"}},[t._v("#")]),t._v(" Create Configuration Files")]),t._v(" "),s("p",[t._v("First, create the following configuration files in the root directory of your package, specifically inside "),s("code",[t._v("packages/Webkul/Category")]),t._v(":")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("package.json")])]),t._v(" "),s("li",[s("code",[t._v("webpack.mix.js")])])]),t._v(" "),s("h3",{attrs:{id:"set-up-package-json"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#set-up-package-json"}},[t._v("#")]),t._v(" Set Up package.json")]),t._v(" "),s("p",[t._v("Copy and paste the following code into your "),s("code",[t._v("package.json")]),t._v(" file:")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"private"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dev"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"npm run development"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"development"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"watch"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"watch-poll"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch -- --watch-options-poll=1000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hot"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch --hot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prod"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"npm run production"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"production"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix --production"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"axios"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.21.4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cross-env"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^7.0.3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"jquery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^3.6.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^6.0.6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^master.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lodash"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^4.17.19"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"postcss"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^8.1.14"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sass"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.32.8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sass-loader"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^11.0.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.6.12"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-loader"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^15.9.6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-template-compiler"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.6.12"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moment"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.29.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vee-validate"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.2.15"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-cal"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^3.10.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-kanban"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.8.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-timeago"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^5.1.3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vuedraggable"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.24.3"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),s("h4",{attrs:{id:"explanation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("package.json")]),t._v(" file includes the following:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Ensures the package is private and not published to a registry.")])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("Scripts")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("dev: Runs the development script. This command is a shortcut for running npm run development.")])]),t._v(" "),s("li",[s("p",[t._v("development: Executes mix. This typically refers to Laravel Mix, a wrapper around Webpack, to compile and bundle assets in development mode.")])]),t._v(" "),s("li",[s("p",[t._v("watch: Runs mix watch. This command watches for file changes and automatically recompiles assets whenever a change is detected, useful during development for continuous integration of updates.")])]),t._v(" "),s("li",[s("p",[t._v("watch-poll: Runs mix watch with the --watch-options-poll=1000 option. This enables polling for file changes every 1000 milliseconds (1 second), which can be useful in certain development environments where file change notifications are unreliable.")])]),t._v(" "),s("li",[s("p",[t._v("hot: Runs mix watch --hot. This command enables Hot Module Replacement (HMR), allowing modules to be replaced without a full browser refresh, enhancing development experience by maintaining application state.")])]),t._v(" "),s("li",[s("p",[t._v("prod: Runs the production script. This command is a shortcut for running npm run production.")])]),t._v(" "),s("li",[s("p",[t._v("production: Executes mix --production. This compiles and bundles assets for production, typically with optimizations like minification, which makes the assets smaller and faster to load in a production environment.")])])])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("DevDependencies:")]),t._v("\nThe devDependencies section in a package.json file specifies the packages that are required for the development of the application. These dependencies are not included in the production build. Here’s a brief overview of each dependency listed:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("axios: A popular promise-based HTTP client for making requests to servers. It is used to handle HTTP requests and responses.")])]),t._v(" "),s("li",[s("p",[t._v("cross-env: A utility that allows you to set environment variables across different platforms in a consistent way. This is particularly useful for ensuring scripts work across various operating systems.")])]),t._v(" "),s("li",[s("p",[t._v("jquery: A fast, small, and feature-rich JavaScript library. It simplifies things like HTML document traversal and manipulation, event handling, and animation.")])]),t._v(" "),s("li",[s("p",[t._v("laravel-mix: An elegant wrapper around Webpack for the Laravel framework. It simplifies the process of compiling and minifying CSS and JavaScript files.")])]),t._v(" "),s("li",[s("p",[t._v("laravel-mix-merge-manifest: A Laravel Mix extension that merges manifests when you have multiple Mix instances in your project. This is useful for complex projects with multiple entry points.")])]),t._v(" "),s("li",[s("p",[t._v("lodash: A modern JavaScript utility library delivering modularity, performance, and extras. It provides helpful functions for working with arrays, numbers, objects, strings, etc.")])]),t._v(" "),s("li",[s("p",[t._v("postcss: A tool for transforming CSS with JavaScript plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS syntax, inline images, and more.")])]),t._v(" "),s("li",[s("p",[t._v("sass: A preprocessor scripting language that is interpreted or compiled into CSS. It allows you to use features such as variables, nested rules, and mixins.")])]),t._v(" "),s("li",[s("p",[t._v("sass-loader: A loader for Webpack that compiles SCSS or SASS files to CSS. It allows you to use Sass in your Webpack workflow.")])]),t._v(" "),s("li",[s("p",[t._v("vue: A progressive JavaScript framework for building user interfaces. Vue is designed to be incrementally adaptable and focuses on the view layer.")])]),t._v(" "),s("li",[s("p",[t._v("vue-loader: A loader for Webpack that allows you to write Vue components in a single file format, combining HTML, JavaScript, and CSS.")])]),t._v(" "),s("li",[s("p",[t._v("vue-template-compiler: A package used to pre-compile Vue templates into render functions. It is typically used alongside vue-loader to compile Vue components.")])])])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("Dependencies:")]),t._v(" These are essential packages required for the project to function, including:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("moment: A widely-used library for parsing, validating, manipulating, and formatting dates in JavaScript. It simplifies working with dates and times.")])]),t._v(" "),s("li",[s("p",[t._v("vee-validate: A form validation library for Vue.js that allows you to validate form inputs with simple declarative syntax. It helps manage form validation logic and provides user feedback on form errors.")])]),t._v(" "),s("li",[s("p",[t._v("vue-cal: A flexible calendar component for Vue.js. It provides features like multi-range selection, drag-and-drop, and custom event rendering, making it useful for implementing calendar functionality in applications.")])]),t._v(" "),s("li",[s("p",[t._v("vue-kanban: A Kanban board component for Vue.js. It allows you to create and manage tasks in a Kanban-style board, useful for project management and task tracking applications.")])]),t._v(" "),s("li",[s("p",[t._v('vue-timeago: A Vue.js component that automatically updates the display of dates and times to a "time ago" format, such as "3 minutes ago" or "2 days ago". It enhances the user interface by providing relative time formatting.')])]),t._v(" "),s("li",[s("p",[t._v("vuedraggable: A Vue.js component based on the Sortable.js library that enables drag-and-drop functionality. It allows you to create draggable lists and components, enhancing the interactivity of your application.")])])])])]),t._v(" "),s("h3",{attrs:{id:"set-up-webpack-mix-js"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#set-up-webpack-mix-js"}},[t._v("#")]),t._v(" Set Up webpack.mix.js")]),t._v(" "),s("p",[t._v("Here the configuration of webpack.min.js you can customize for your configuration")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'undefined'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'publishable/assets'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../../public/vendor/webkul/category/assets"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPublicPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("publicPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeManifest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("disableNotifications")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("js")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/js/app.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"js/category.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/sass/app.scss"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"css/category.css"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("options")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("processCssUrls")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("vue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("webpackConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("resolve")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("alias")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v("'vue$'")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue/dist/vue.runtime.js'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sourceMaps")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("version")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This script is a configuration file for Laravel Mix, a tool for compiling and optimizing frontend assets in a Laravel application. Let's break down each part of the code:")]),t._v(" "),s("h3",{attrs:{id:"importing-laravel-mix"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#importing-laravel-mix"}},[t._v("#")]),t._v(" Importing Laravel Mix")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'undefined'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This code imports Laravel Mix. The conditional check ensures that "),s("code",[t._v("mix")]),t._v(" is defined, though it's unnecessary here as "),s("code",[t._v("require")]),t._v(" should always return the module correctly.")]),t._v(" "),s("h3",{attrs:{id:"merging-manifests"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#merging-manifests"}},[t._v("#")]),t._v(" Merging Manifests")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("This imports the "),s("code",[t._v("laravel-mix-merge-manifest")]),t._v(" package, which allows merging multiple Mix manifests.")]),t._v(" "),s("h3",{attrs:{id:"setting-the-public-path"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-the-public-path"}},[t._v("#")]),t._v(" Setting the Public Path")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'publishable/assets'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../../public/vendor/webkul/admin/assets"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The "),s("code",[t._v("publicPath")]),t._v(" is set based on whether the build is for production or development. In production, it sets the path to "),s("code",[t._v("publishable/assets")]),t._v(", otherwise, it sets the path to "),s("code",[t._v("../../../public/vendor/webkul/admin/assets")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"mix-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mix-configuration"}},[t._v("#")]),t._v(" Mix Configuration")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPublicPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("publicPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeManifest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("disableNotifications")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("ul",[s("li",[s("p",[t._v("mix.setPublicPath(publicPath): Sets the public directory where the compiled assets will be stored.")])]),t._v(" "),s("li",[s("p",[t._v("mix.mergeManifest(): Merges the Mix manifests.")])]),t._v(" "),s("li",[s("p",[t._v("mix.disableNotifications(): Disables system notifications for the build process.")])])]),t._v(" "),s("h3",{attrs:{id:"asset-compilation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#asset-compilation"}},[t._v("#")]),t._v(" Asset Compilation")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("js")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/js/app.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"js/admin.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/sass/app.scss"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"css/admin.css"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("options")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("processCssUrls")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("vue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])]),s("ul",[s("li",[s("p",[t._v("mix.js(): Compiles the JavaScript file from the specified source to the specified destination.")])]),t._v(" "),s("li",[s("p",[t._v("mix.copy(): Copies image files from the source directory to the public path.")])]),t._v(" "),s("li",[s("p",[t._v("mix.sass(): Compiles the SASS file to CSS.")])]),t._v(" "),s("li",[s("p",[t._v("options({ processCssUrls: false }): Disables the processing of URLs found in CSS files.")])]),t._v(" "),s("li",[s("p",[t._v("vue(): Configures Laravel Mix to handle Vue.js single-file components.")])])]),t._v(" "),s("h3",{attrs:{id:"webpack-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#webpack-configuration"}},[t._v("#")]),t._v(" Webpack Configuration")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("webpackConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("resolve")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("alias")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v("'vue$'")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue/dist/vue.runtime.js'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("This customizes the Webpack configuration. It sets an alias for Vue to use the runtime-only build.")]),t._v(" "),s("h3",{attrs:{id:"source-maps"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#source-maps"}},[t._v("#")]),t._v(" Source Maps")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sourceMaps")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This generates source maps only in non-production environments to help with debugging.")]),t._v(" "),s("h3",{attrs:{id:"versioning"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#versioning"}},[t._v("#")]),t._v(" Versioning")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("version")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This enables versioning in production, appending a unique hash to filenames to help with cache busting.")]),t._v(" "),s("p",[t._v("Overall, this configuration sets up Laravel Mix to handle JavaScript, images, SASS, and Vue.js components, with different behaviors for development and production environments.")]),t._v(" "),s("h2",{attrs:{id:"load-assets-in-blade-file"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#load-assets-in-blade-file"}},[t._v("#")]),t._v(" Load Assets in Blade File")]),t._v(" "),s("p",[t._v("Add the following code to your Blade file to load assets from your package:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("link rel"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"stylesheet"')]),t._v(" href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/ui/assets/css/ui.css') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("link rel"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"stylesheet"')]),t._v(" href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/category/assets/css/category.css') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"text/javascript"')]),t._v(" src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/category/assets/js/category.js') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"text/javascript"')]),t._v(" src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/ui/assets/js/ui.js') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/122.3bc5152f.js b/assets/js/122.aa694a53.js similarity index 99% rename from assets/js/122.3bc5152f.js rename to assets/js/122.aa694a53.js index 6c07373..f410a1b 100644 --- a/assets/js/122.3bc5152f.js +++ b/assets/js/122.aa694a53.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[122],{422:function(t,e,a){"use strict";a.r(e);var s=a(10),r=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"blade-components"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#blade-components"}},[t._v("#")]),t._v(" Blade Components")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#components"}},[t._v("Components")]),e("ul",[e("li",[e("a",{attrs:{href:"#tag"}},[t._v("Tag")])]),e("li",[e("a",{attrs:{href:"#avatar"}},[t._v("Avatar")])]),e("li",[e("a",{attrs:{href:"#activities"}},[t._v("Activities")])]),e("li",[e("a",{attrs:{href:"#lookup"}},[t._v("Lookup")])]),e("li",[e("a",{attrs:{href:"#attachment"}},[t._v("Attachment")])]),e("li",[e("a",{attrs:{href:"#inline-editable"}},[t._v("Inline Editable")])]),e("li",[e("a",{attrs:{href:"#accordion"}},[t._v("Accordion")])]),e("li",[e("a",{attrs:{href:"#button"}},[t._v("Button")])]),e("li",[e("a",{attrs:{href:"#drawer"}},[t._v("Drawer")])]),e("li",[e("a",{attrs:{href:"#dropdown"}},[t._v("Dropdown")])]),e("li",[e("a",{attrs:{href:"#flat-picker"}},[t._v("Flat-Picker")])]),e("li",[e("a",{attrs:{href:"#data-grid"}},[t._v("Data Grid")])]),e("li",[e("a",{attrs:{href:"#tinymce"}},[t._v("Tinymce")])]),e("li",[e("a",{attrs:{href:"#shimmer"}},[t._v("Shimmer")])]),e("li",[e("a",{attrs:{href:"#table"}},[t._v("Table")])]),e("li",[e("a",{attrs:{href:"#modal"}},[t._v("Modal")])]),e("li",[e("a",{attrs:{href:"#tree"}},[t._v("Tree")])]),e("li",[e("a",{attrs:{href:"#media"}},[t._v("Media")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("To ensure optimal user experience in "),e("strong",[t._v("Krayin")]),t._v(" we have created several separate Blade components for the Admin packages. Now in "),e("strong",[e("code",[t._v("Krayin")])]),t._v(" we have also merged the vue.js code inside the blade component to improve application performance.")]),t._v(" "),e("p",[t._v("Additionally, To learn in detail about blade components, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/blade#introduction",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("ul",[e("li",[t._v("Here are the list of Blade component that is available in "),e("strong",[e("code",[t._v("Krayin")])]),t._v(".")])]),t._v(" "),e("h2",{attrs:{id:"components"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#components"}},[t._v("#")]),t._v(" Components")]),t._v(" "),e("p",[t._v("Components are reusable Blade components used to build the Admin.")]),t._v(" "),e("h3",{attrs:{id:"tag"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tag"}},[t._v("#")]),t._v(" Tag")]),t._v(" "),e("p",[t._v("The Krayin CRM provides a "),e("code",[t._v("Tag")]),t._v(" component that allows you to add and manage tags for various entities such as leads, mails, or any other resources where tagging functionality is required. This component is highly flexible and can be integrated wherever the tagging feature is needed.")]),t._v(" "),e("ul",[e("li",[t._v("Component Props")])]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Tag")]),t._v(" component accepts the following three props:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("attach-endpoint")])]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("The API endpoint used to attach a tag to the specified entity. This should be a valid URL.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("detach-endpoint")])]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("The API endpoint used to detach a tag from the specified entity. This should be a valid URL.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("added-tags")])]),t._v(" "),e("td",[t._v("Array")]),t._v(" "),e("td",[t._v("An array of tags that are already attached to the entity. It should be an array of objects, with each object representing a tag.")])])])]),t._v(" "),e("ul",[e("li",[t._v("Example Usage")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("tags")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("attach"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("endpoint"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"route('admin.leads.tags.attach', "),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$lead")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("id")])]),t._v(')"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("detach"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("endpoint"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"route('admin.leads.tags.detach', "),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$lead")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("id")])]),t._v(')"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("added"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("tags"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$lead")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("tags")])]),t._v('"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Detailed Description")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("attach-endpoint")]),t._v(":")]),t._v(" This prop is crucial for adding new tags. When a user adds a tag, the "),e("code",[t._v("attach-endpoint")]),t._v(" is used to send the tag data to the server. Ensure that the endpoint provided handles the attachment logic on the backend.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("detach-endpoint")]),t._v(":")]),t._v(" Similarly, this prop is used when a tag is removed. The "),e("code",[t._v("detach-endpoint")]),t._v(" sends a request to the server to remove the specified tag from the entity.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("added-tags")]),t._v(":")]),t._v(" This prop provides the component with the list of tags that are already associated with the entity. The tags are displayed when the component is rendered, allowing users to see which tags are currently applied.")])])]),t._v(" "),e("h3",{attrs:{id:"avatar"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#avatar"}},[t._v("#")]),t._v(" Avatar")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Avatar")]),t._v(" component in Krayin CRM is designed to generate and display an avatar with the initials of a given name. This is useful for representing users, contacts, or any other entities with a visual identifier.")]),t._v(" "),e("ul",[e("li",[t._v("Prop")])]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Avatar")]),t._v(" component accepts the following prop:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("name")])]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("The full name for which the avatar should generate initials. For example, if the name is "),e("code",[t._v("John Doe")]),t._v(", the avatar will display "),e("code",[t._v("JD")]),t._v(".")])])])]),t._v(" "),e("ul",[e("li",[t._v("Example Usage")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("avatar")]),t._v(" name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"John Doe"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("p",[t._v("Detailed Description")]),t._v(" "),e("ul",[e("li",[e("strong",[e("code",[t._v("name")]),t._v(":")]),t._v(" The "),e("code",[t._v("name")]),t._v(" prop is required and should be a string representing the full name of the person or entity. The component processes this name and extracts the initials. For example:\n"),e("ul",[e("li",[t._v("If the "),e("code",[t._v("name")]),t._v(" is "),e("code",[t._v("John Doe")]),t._v(", the avatar will display "),e("code",[t._v("JD")]),t._v(".")]),t._v(" "),e("li",[t._v("If the "),e("code",[t._v("name")]),t._v(" is "),e("code",[t._v("Jane Smith")]),t._v(", the avatar will display "),e("code",[t._v("JS")]),t._v(".")])])])]),t._v(" "),e("p",[t._v("This component is particularly useful in scenarios where you need a quick and simple visual representation of users or entities within the CRM interface.")]),t._v(" "),e("h3",{attrs:{id:"activities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#activities"}},[t._v("#")]),t._v(" Activities")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Activities")]),t._v(" Blade Component in Krayin CRM is a versatile and dynamic component designed to display various types of activities related to an entity, such as leads, contacts, warehouse. This component allows you to manage and display different types of data (like emails, products, quotes, and descriptions) in a structured and user-friendly way. Below is a detailed explanation of the props and slots that the component accepts:")]),t._v(" "),e("ul",[e("li",[t._v("Props")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")]),t._v(" "),e("th",[t._v("Default Value")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("endpoint")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The API endpoint that the component will call to fetch and display the activities.")]),t._v(" "),e("td",[e("code",[t._v("''")]),t._v(" (empty string)")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("emailDetachEndpoint")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The API endpoint for detaching emails from the activity log.")]),t._v(" "),e("td",[e("code",[t._v("''")]),t._v(" (empty string)")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("activeType")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The type of activity currently active and displayed in the component.")]),t._v(" "),e("td",[e("code",[t._v("'all'")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("types")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[t._v("An array of predefined activity types, each with a "),e("code",[t._v("name")]),t._v(" and "),e("code",[t._v("label")]),t._v(", which will be displayed as filter options.")]),t._v(" "),e("td",[e("code",[t._v("[ {name: 'all', label: \""+t._s("All")+'" }, ... ]')])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("extraTypes")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[t._v("An array for additional custom activity types that extend the default types provided by the component.")]),t._v(" "),e("td",[e("code",[t._v("[]")]),t._v(" (empty array)")])])])]),t._v(" "),e("ul",[e("li",[t._v("Slots")])]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Activities")]),t._v(" component also supports named slots, which allow you to insert custom content into specific sections of the component. Below are the slots available:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slot Name")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("products")])])]),t._v(" "),e("td",[t._v("Slot for displaying product-related activities. You can include custom product views or components here.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("quotes")])])]),t._v(" "),e("td",[t._v("Slot for displaying quote-related activities. This is where you can include a view for quotes.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("description")])])]),t._v(" "),e("td",[t._v("Slot for displaying a description related to the entity. You can customize the description view or layout.")])])])]),t._v(" "),e("ul",[e("li",[t._v("Usage Example")])]),t._v(" "),e("p",[t._v("Here is how you can use the "),e("code",[t._v("Activities")]),t._v(" component in your Blade template:")]),t._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-admin:")]),t._v(":activities")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":endpoint")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("route('admin.leads.activities.index', $lead->id)"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":email-detach-endpoint")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("route('admin.leads.emails.detach', $lead->id)"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":extra-types")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("[\n ['name' => 'description', 'label' => trans('admin::app.leads.view.tabs.description')],\n ['name' => 'products', 'label' => trans('admin::app.leads.view.tabs.products')],\n ['name' => 'quotes', 'label' => trans('admin::app.leads.view.tabs.quotes')],\n ]"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- Products --\x3e")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-slot:")]),t._v("products")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n @include('admin::leads.view.products')\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- Quotes --\x3e")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-slot:")]),t._v("quotes")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n @include('admin::leads.view.quotes')\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- Description --\x3e")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-slot:")]),t._v("description")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("p-4"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n {{ $lead->description }}\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Explanation:")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("endpoint")])]),t._v(": This prop is used to specify the API endpoint that the component will query to fetch the activities. In this example, the endpoint is dynamically generated based on the lead's ID.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("email-detach-endpoint")])]),t._v(": This prop provides the API endpoint that will be called when detaching an email from the activity log. It's crucial for managing email-related activities within the component.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("extra-types")])]),t._v(": This prop allows you to extend the types of activities displayed by the component. Each activity type is represented by an array containing a "),e("code",[t._v("name")]),t._v(" and "),e("code",[t._v("label")]),t._v(". The "),e("code",[t._v("name")]),t._v(" is used to identify the activity type, and the "),e("code",[t._v("label")]),t._v(" is the user-friendly name displayed in the UI.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Slots")]),t._v(": The "),e("code",[t._v("Activities")]),t._v(" component supports named slots ("),e("code",[t._v("products")]),t._v(", "),e("code",[t._v("quotes")]),t._v(", "),e("code",[t._v("description")]),t._v(") where you can insert custom views or content. These slots are particularly useful for displaying specific types of activities, like products or quotes, in a way that fits your application's design.")])])]),t._v(" "),e("p",[t._v("This component is powerful for creating a comprehensive activity log in CRM applications, ensuring that all relevant interactions and data are easily accessible and well-organized. The use of props and slots makes it highly customizable, allowing you to tailor the component to fit specific needs within the admin panel.")]),t._v(" "),e("h3",{attrs:{id:"lookup"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#lookup"}},[t._v("#")]),t._v(" Lookup")]),t._v(" "),e("p",[t._v("The Lookup Blade Component in Krayin CRM is designed to facilitate the selection of items from a list or database by providing a search-and-select interface. This component is highly customizable and can be integrated into forms or other UI elements to enhance user experience. Below is a detailed explanation of the props that the component accepts:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")]),t._v(" "),e("th",[t._v("Default Value")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("src")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The API endpoint or URL from which the component fetches data for the lookup functionality.")]),t._v(" "),e("td",[e("code",[t._v("required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("params")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("Additional parameters to be sent along with the API request, often used for filtering data.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The name of the input field, used as an identifier in forms.")]),t._v(" "),e("td",[e("code",[t._v("required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("placeholder")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The placeholder text displayed in the input field when no value is selected.")]),t._v(" "),e("td",[e("code",[t._v("required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("The currently selected value in the lookup component. This object represents the selected item.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("rules")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("Validation rules applied to the lookup component, typically using Laravel's validation syntax.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("label")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("A label for the lookup component, displayed above or next to the input field.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("canAddNew")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[t._v("A boolean flag that enables or disables the ability to add a new item directly from the lookup component.")]),t._v(" "),e("td",[e("code",[t._v("false")])])])])]),t._v(" "),e("ul",[e("li",[t._v("Usage Example:")])]),t._v(" "),e("p",[t._v("Here's an example of how you might use the Lookup Blade Component in your Blade template:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("lookup")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("src")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"src"')]),t._v("\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"person[id]"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("params")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"params"')]),t._v("\n @on"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("selected"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"addPerson"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("placeholder"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"trans('admin::app.leads.common.contact.name')\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("value")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"{id: person.id, name: person.name}"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("can"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("add"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Description:")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("src")])]),t._v(": The URL or API endpoint from which the lookup component fetches its data. This is required and is the source for populating the search results within the lookup dropdown.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("params")])]),t._v(": An object containing additional parameters that are sent along with the API request. This allows for filtering or customizing the data fetched based on specific criteria.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("name")])]),t._v(": The name of the lookup input field, used to identify the component in form submissions. This is required and should be unique within the form.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("placeholder")])]),t._v(": The placeholder text that appears in the input field when the user hasn't selected a value. This helps guide users on what the input field is used for.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("value")])]),t._v(": An object representing the currently selected value in the lookup component. This is typically bound to a data property in your application and is used to prepopulate the lookup field with a selected item.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("rules")])]),t._v(": Validation rules that are applied to the lookup component. These rules are defined using Laravel's validation syntax and can enforce constraints such as required fields.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("label")])]),t._v(": A label that accompanies the lookup component, providing context or instructions to the user. It is optional and can be used to describe the purpose of the lookup field.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("canAddNew")])]),t._v(": A boolean flag that, when set to "),e("code",[t._v("true")]),t._v(", allows users to add a new item directly from the lookup component. This is particularly useful when the desired item is not found in the existing list, enabling a quick addition of new options.")])])]),t._v(" "),e("p",[t._v("This Lookup Component is useful in various scenarios where users need to search for and select items from a list, such as selecting products, categories, or any other entities within Krayin CRM. The flexibility provided by props like "),e("code",[t._v("src")]),t._v(", "),e("code",[t._v("params")]),t._v(", and "),e("code",[t._v("canAddNew")]),t._v(" ensures that it can be tailored to fit the specific needs of different parts of the application.")]),t._v(" "),e("h3",{attrs:{id:"attachment"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#attachment"}},[t._v("#")]),t._v(" Attachment")]),t._v(" "),e("p",[t._v("The Attachment Blade Component in Krayin CRM is designed to handle file uploads with various customizable options. This component is powered by Vue.js, providing flexibility in managing attachments within forms or other UI elements. Below is a detailed explanation of the props that the component accepts:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")]),t._v(" "),e("th",[t._v("Default Value")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The name of the input field for attachments, used as an identifier in forms.")]),t._v(" "),e("td",[e("code",[t._v("'attachments'")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("validations")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("Validation rules for the attachments, typically using Laravel's validation syntax.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("uploadedAttachments")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[t._v("An array of already uploaded attachments, allowing for the display and management of existing files.")]),t._v(" "),e("td",[e("code",[t._v("[]")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("allowMultiple")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[t._v("Determines whether multiple files can be uploaded at once.")]),t._v(" "),e("td",[e("code",[t._v("false")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("hideButton")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[t._v("Option to hide the upload button, useful in scenarios where uploads are triggered differently.")]),t._v(" "),e("td",[e("code",[t._v("false")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("errors")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("An object containing any validation errors related to the file upload process.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])])])]),t._v(" "),e("ul",[e("li",[t._v("Usage Example:")])]),t._v(" "),e("p",[t._v("Here's an example of how you might use the Attachment Blade Component in your Blade template:")]),t._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-admin:")]),t._v(":attachments")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("documentAttachments"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("validations")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("required|mimes:pdf,jpg,png|max:2048"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":uploadedAttachments")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("$lead->documents"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":allowMultiple")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("true"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":hideButton")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("false"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":errors")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("$errors->toArray()"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Description:")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Name")]),t._v(": This is the name of the input field for the attachments, often used as the "),e("code",[t._v("name")]),t._v(" attribute in the HTML form. It uniquely identifies the file input, especially in forms that may have multiple file upload fields.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Validations")]),t._v(": Validation rules that apply to the uploaded files. These rules are defined using Laravel's validation syntax, allowing you to specify file types, size limits, and other constraints.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Uploaded Attachments")]),t._v(": An array that holds information about attachments that have already been uploaded. This allows for displaying existing files to users, enabling them to view or manage previously uploaded files.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Allow Multiple")]),t._v(": A boolean flag that enables or disables the ability to upload multiple files at once. If set to "),e("code",[t._v("true")]),t._v(", users can select and upload several files in one action.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Hide Button")]),t._v(": A boolean flag to hide the file upload button. This can be useful if the file upload is triggered by other UI elements or if you want to prevent manual file uploads in certain contexts.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Errors")]),t._v(": An object containing validation errors related to the file uploads. If the uploaded files don't meet the specified validation criteria, the errors object will hold the relevant messages to be displayed to the user.")])])]),t._v(" "),e("p",[t._v("This component is versatile and can be integrated into various parts of Krayin CRM where file uploads are necessary, such as when attaching documents to leads, contacts, or any other CRM entities. The ability to customize validation rules, manage multiple files, and control the visibility of the upload button makes it a powerful tool for handling attachments.")]),t._v(" "),e("h3",{attrs:{id:"inline-editable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inline-editable"}},[t._v("#")]),t._v(" Inline Editable")]),t._v(" "),e("p",[t._v("The Inline Editable Blade Component in Krayin CRM allows users to create editable fields directly within the user interface, providing an intuitive and seamless editing experience. This component is powered by Vue.js and is highly customizable through various props that dictate its behavior, appearance, and functionality. Below is a detailed explanation of each prop that the component accepts:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")]),t._v(" "),e("th",[t._v("Default Value")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The name of the field, used as an identifier for the input.")]),t._v(" "),e("td",[e("strong",[t._v("Required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value")])])]),t._v(" "),e("td",[e("code",[t._v("Mixed")])]),t._v(" "),e("td",[t._v("The current value of the field that will be displayed and edited.")]),t._v(" "),e("td",[e("strong",[t._v("Required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("rules")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("Validation rules for the field, typically using "),e("a",{attrs:{href:"https://vee-validate.logaretm.com/v4/guide/overview/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Vee Validate v4"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("label")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The label for the field, displayed alongside the input.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("placeholder")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("Placeholder text for the input field, shown when the value is empty.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("position")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The position of the editable input relative to its label or icon, typically 'right' or 'left'.")]),t._v(" "),e("td",[e("code",[t._v("'right'")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("allowEdit")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[t._v("Determines whether the field is editable by the user.")]),t._v(" "),e("td",[e("code",[t._v("true")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("errors")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("An object containing any validation errors related to the field.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("url")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The endpoint URL where the updated value should be sent for saving.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("params")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("Additional parameters to be sent along with the value when saving.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("valueLabel")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("A label to represent the value, especially useful when displaying complex data types.")]),t._v(" "),e("td",[e("code",[t._v("''")])])])])]),t._v(" "),e("ul",[e("li",[t._v("Usage Example:")])]),t._v(" "),e("p",[t._v("Here's an example of how you might use this Inline Editable Blade Component in your Blade template:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("form")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("control"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("group"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("controls"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("inline"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("text\n type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"inline"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("name")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"'{{ "),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("code")])]),t._v(" }}'\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("value")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"'{{ "),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$value")])]),t._v(" }}'\"")]),t._v("\n position"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"left"')]),t._v("\n rules"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"required"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("label"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("name")])]),t._v('"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("placeholder"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("name")])]),t._v('"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("errors")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"errors"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("url"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$url")])]),t._v('"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("allow"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("edit"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$allowEdit")])]),t._v('"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Description:")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Name")]),t._v(": This is the identifier for the input field, often used as the "),e("code",[t._v("name")]),t._v(" attribute in the HTML form.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Value")]),t._v(": The current value of the field, which can be edited by the user. It is passed directly to the input field.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Rules")]),t._v(": Validation rules that are applied when the value is updated, ensuring the data meets specific criteria before being saved.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Label")]),t._v(": The text label displayed next to the input field, providing context about what the field represents.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Placeholder")]),t._v(": Text that appears in the input field when it is empty, guiding the user on what to enter.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Position")]),t._v(": Determines where the editable input appears relative to the label or any accompanying icons.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Allow Edit")]),t._v(": A boolean flag that enables or disables the ability to edit the field. When set to "),e("code",[t._v("false")]),t._v(", the field will be read-only.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Errors")]),t._v(": Any validation errors associated with the field, which can be displayed to the user if the input does not meet the validation criteria.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("URL")]),t._v(": The endpoint where the component sends the updated value when the user saves their changes.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Params")]),t._v(": Additional parameters that can be sent along with the value, such as method overrides or extra data needed for the request.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Value Label")]),t._v(": A label that can represent the value when displaying complex data types or when the value itself is not straightforward.")])])]),t._v(" "),e("p",[t._v("This component is highly versatile and can be used across various sections of the CRM, such as in leads, contacts, or any other entity where inline editing is required. The ability to customize nearly every aspect of its behavior makes it a powerful tool for enhancing user experience.")]),t._v(" "),e("h3",{attrs:{id:"accordion"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#accordion"}},[t._v("#")]),t._v(" Accordion")]),t._v(" "),e("p",[t._v("Krayin provides a collapsible accordion UI element, allowing users to toggle the visibility of content sections. It is commonly used for organizing and presenting information in a compact and intuitive manner.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("is-active")])])]),t._v(" "),e("td",[t._v("Boolean")]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Determines the initial state of the accordion. When set to "),e("code",[t._v("true")]),t._v(", the accordion section will be expanded by default; otherwise, it will be collapsed.")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slots")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("header")])])]),t._v(" "),e("td",[t._v("Used to customize the header section of the accordion.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("content")])])]),t._v(" "),e("td",[t._v("Used to customize the content section of the accordion.")])])])]),t._v(" "),e("p",[t._v("You can customize the appearance of the accordion "),e("code",[t._v("header")]),t._v(" and "),e("code",[t._v("content")]),t._v(" by passing additional CSS classes to the header and content slots, respectively.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("accordion")])]),t._v(" component, you can call it like this:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Accordion "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("accordion")]),t._v(" \n title"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"Admin Accordion"')]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"px-5"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("header "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"bg-gray-200"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Accordion Header\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("content "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"bg-green-200"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Accordion Content\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("accordion")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"button"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#button"}},[t._v("#")]),t._v(" Button")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("button")]),t._v(" component in Krayin provides a versatile button element that supports loading state with a spinner animation. It offers flexibility in styling and functionality to suit various use cases within your application.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("title")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("None")]),t._v(" "),e("td",[t._v("Title text displayed on the button.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("loading")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Indicates whether the button is in a loading state.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("button-type")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'button'")])]),t._v(" "),e("td",[t._v("Specifies the type of button ("),e("code",[t._v("'button'")]),t._v(", "),e("code",[t._v("'submit'")]),t._v(", "),e("code",[t._v("'reset'")]),t._v(", etc.).")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("button-class")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("''")])]),t._v(" "),e("td",[t._v("Additional classes for custom styling.")])])])]),t._v(" "),e("p",[t._v("You can customize the appearance of the button by passing additional props "),e("code",[t._v("loading")]),t._v(" "),e("code",[t._v("buttonType")]),t._v(" "),e("code",[t._v("buttonClass")]),t._v(" respectively.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("button")])]),t._v(" component. You can call it like this:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Button "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("button")]),t._v("\n type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"submit"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"secondary-button w-full max-w-full max-md:py-3 max-sm:rounded-lg max-sm:py-1.5"')]),t._v("\n button"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"secondary-button"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("loading"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"false"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("title"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"trans('Button')\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("disabled"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("loading")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"drawer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#drawer"}},[t._v("#")]),t._v(" Drawer")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("drawer")]),t._v(" component in Krayin provides a versatile drawer that can be positioned on the top, bottom, left, or right side of the screen. It allows you to create interactive drawers that can contain various content such as headers, body, and footer sections. The drawer can be toggled open or closed, providing a clean and efficient way to display additional information or functionality.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("is-active")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Determines whether the drawer is initially active.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("position")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'left'")])]),t._v(" "),e("td",[t._v("Specifies the position of the drawer ("),e("code",[t._v("top")]),t._v(", "),e("code",[t._v("bottom")]),t._v(", "),e("code",[t._v("left")]),t._v(", or "),e("code",[t._v("right")]),t._v(").")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("width")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'500px'")])]),t._v(" "),e("td",[t._v("Specifies the width of the drawer.")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slots")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("toggle")])])]),t._v(" "),e("td",[t._v("Slot for the toggle button or element.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("header")])])]),t._v(" "),e("td",[t._v("Slot for the header content.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("content")])])]),t._v(" "),e("td",[t._v("Slot for the main content.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("footer")])])]),t._v(" "),e("td",[t._v("Slot for the footer content.")])])])]),t._v(" "),e("p",[t._v("You can customize the appearance of the Drawer by passing additional CSS.")]),t._v(" "),e("ul",[e("li",[t._v("To customize the header section, you can target the "),e("code",[t._v("header")]),t._v(" slot with your own CSS classes or styles.")]),t._v(" "),e("li",[t._v("Similarly, you can customize the content section using the "),e("code",[t._v("content")]),t._v(" slot.")]),t._v(" "),e("li",[t._v("Similarly, you can customize the content section using the "),e("code",[t._v("footer")]),t._v(" slot.")])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("drawer")])]),t._v(" component. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Drawer "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("drawer")]),t._v(" \n position"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"left"')]),t._v("\n width"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"100%"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("toggle"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Drawer Toggle\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("header "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"bg-red-100"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Pass your custom css to customize header "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("Drawer")]),t._v(" Header\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("content "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"!p-5"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Pass your custom css to customize header "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("Drawer")]),t._v(" Content\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("drawer")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"dropdown"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dropdown"}},[t._v("#")]),t._v(" Dropdown")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("dropdown")]),t._v(" component in Krayin provides a customizable dropdown menu that can be positioned at different locations relative to its toggle button. It enables you to create dropdown menus with various content sections such as toggle button, content, and menu items.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("close-on-click")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("true")])]),t._v(" "),e("td",[t._v("Determines whether the dropdown should close when clicking outside the menu.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("position")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'bottom-left'")])]),t._v(" "),e("td",[t._v("Specifies the position of the dropdown menu relative to the toggle button ("),e("code",[t._v("top-left")]),t._v(", "),e("code",[t._v("top-right")]),t._v(", "),e("code",[t._v("bottom-left")]),t._v(", "),e("code",[t._v("bottom-right")]),t._v(").")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slots")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("toggle")])])]),t._v(" "),e("td",[t._v("Slot for the toggle button or element..")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("content")])])]),t._v(" "),e("td",[t._v("Slot for the main content.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("menu")])])]),t._v(" "),e("td",[t._v("Slot for the menu items..")])])])]),t._v(" "),e("p",[t._v("To customize the content section, you can target the "),e("code",[t._v("content")]),t._v(" slot with your own CSS classes or styles.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("dropdown")])]),t._v(" component. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Dropdown "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("dropdown")]),t._v(" position"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"bottom-left"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("toggle"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Dropdown Toggle\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("content "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"!p-0"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Dropdown Content\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("dropdown")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("item\n Menu Item "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n Menu Item "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("dropdown")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("item"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("dropdown")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"flat-picker"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#flat-picker"}},[t._v("#")]),t._v(" Flat-Picker")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("datetime-picker")]),t._v(" and "),e("code",[t._v("date-picker")]),t._v(" components provide "),e("code",[t._v("date")]),t._v(" and "),e("code",[t._v("time")]),t._v(" picker functionality within Krayin applications. These components are based on the Flatpickr library and offer customizable options for selecting dates and times.")]),t._v(" "),e("p",[t._v("It can be configured with various props to customize its behavior according to application requirements.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("None")]),t._v(" "),e("td",[t._v("Name attribute for the input field.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("None")]),t._v(" "),e("td",[t._v("Initial value of the date picker.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("allow-input")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("true")])]),t._v(" "),e("td",[t._v("Determines whether manual input is allowed in the input field.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("disable")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[e("code",[t._v("[]")])]),t._v(" "),e("td",[t._v("Array of dates to disable in the date picker.")])])])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("flat-picker")])]),t._v(" component. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin DateTime Picker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("flat")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("picker"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("date")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("allow")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("input"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"false"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("input\n type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"datetime"')]),t._v("\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"datetime"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"mb-4"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("value"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"selectedDateTime"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("disable"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"disabledDates"')]),t._v("\n placeholder"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"datetime"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("flat")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("picker"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("date"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"data-grid"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#data-grid"}},[t._v("#")]),t._v(" Data Grid")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("datagrid")]),t._v(" component in Krayin applications provides a flexible and customizable data grid interface for displaying tabular data. It includes features such as "),e("code",[t._v("sorting")]),t._v(", "),e("code",[t._v("filtering")]),t._v(", "),e("code",[t._v("pagination")]),t._v(", and "),e("code",[t._v("mass actions")]),t._v(" to manage data efficiently.")]),t._v(" "),e("p",[t._v("You can customize the appearance of the "),e("code",[t._v("DataGrid")]),t._v(" by referring to the "),e("a",{attrs:{href:"https://devdocs.Krayin.com/2.0/packages/datagrid.html#datagrid-customization",target:"_blank",rel:"noopener noreferrer"}},[t._v("DataGrid Customization"),e("OutboundLink")],1),t._v(" documentation.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("datagrid")])]),t._v(" component. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Datagrid "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("datagrid")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("src"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"route('admin.catalog.products.index')\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"tinymce"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tinymce"}},[t._v("#")]),t._v(" Tinymce")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("tinymce")]),t._v(" component wraps the Tinymce editor and provides additional functionalities like AI content generation.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("selector")])])]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[e("code",[t._v("''")])]),t._v(" "),e("td",[t._v("The CSS selector for the textarea element to initialize as TinyMCE.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("field")])])]),t._v(" "),e("td",[t._v("Object")]),t._v(" "),e("td",[e("code",[t._v("{}")])]),t._v(" "),e("td",[t._v("Vue Formulate field object.")])])])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("tinymce")])]),t._v(" component on admin and shop. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Tinymce "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("form")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("control"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("group"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("control\n type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"textarea"')]),t._v("\n id"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"content"')]),t._v("\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"content"')]),t._v("\n rules"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"required"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("value"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"old('content')\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("label"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"Content"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("placeholder"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"Content"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("tinymce"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"shimmer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#shimmer"}},[t._v("#")]),t._v(" Shimmer")]),t._v(" "),e("p",[t._v("Prebuilt "),e("code",[t._v("shimmer")]),t._v(" effects are available in Krayin. You can easily use them.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("shimmer")])]),t._v(" You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin shimmer "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("shimmer")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("datagrid "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"table"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#table"}},[t._v("#")]),t._v(" Table")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Table")]),t._v(" component in Laravel Krayin CRM is used to display structured tabular data. The customization options are also available through CSS for various table elements:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Styling")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("Table")])])]),t._v(" "),e("td",[t._v("Apply custom styles to the "),e("code",[t._v("table")]),t._v(" element to change its appearance, such as borders, padding, and background color.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("Cell")])])]),t._v(" "),e("td",[t._v("Customize the appearance of "),e("code",[t._v("th")]),t._v(" and "),e("code",[t._v("td")]),t._v(" elements using CSS, such as font size, text alignment, and background color.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("Row")])])]),t._v(" "),e("td",[t._v("Apply styles to "),e("code",[t._v("tr")]),t._v(" elements to change their appearance, such as background color, hover effects, and borders.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("Header")])])]),t._v(" "),e("td",[t._v("Customize the appearance of the header cells within the "),e("code",[t._v("thead")]),t._v(" section using "),e("code",[t._v("th")]),t._v(" elements. Apply styles such as font weight, text color, and background color.")])])])]),t._v(" "),e("p",[t._v("To use the "),e("strong",[e("code",[t._v("Table")])]),t._v(" component in Krayin CRM, you can call it like this:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("CRM")]),t._v(" Table "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("thead"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("thead"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Heading "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Heading "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Heading "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Heading "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("thead"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("thead"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tbody"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tbody"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Column "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Column "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Column "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Column "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tbody"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tbody"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"modal"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#modal"}},[t._v("#")]),t._v(" Modal")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("modal")]),t._v(" component in Krayin provides a flexible way to create modal dialogs. It allows you to display content in a layer that floats above the rest of the page.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("is-active")])]),t._v(" "),e("td",[t._v("Boolean")]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Controls the visibility of the modal.")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slot")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("toggle")])])]),t._v(" "),e("td",[t._v("Used for the element that toggles the visibility of the modal.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("header")])])]),t._v(" "),e("td",[t._v("Allows customization of the modal header content.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("content")])])]),t._v(" "),e("td",[t._v("Provides a slot for the main body content of the modal.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("footer")])])]),t._v(" "),e("td",[t._v("Allows customization of the footer content within the modal.")])])])]),t._v(" "),e("p",[t._v("You can customize the appearance of the Modal by passing additional CSS.")]),t._v(" "),e("ul",[e("li",[t._v("To customize the header section, you can target the "),e("code",[t._v("header")]),t._v(" slot with your own CSS classes or styles.")]),t._v(" "),e("li",[t._v("Similarly, you can customize the content section using the "),e("code",[t._v("content")]),t._v(" slot.")]),t._v(" "),e("li",[t._v("Similarly, you can customize the content section using the "),e("code",[t._v("footer")]),t._v(" slot.")])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("modal")])]),t._v(" component, You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Modal "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("modal")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("toggle"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Modal Toggle\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("header"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Modal Header\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("content"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Modal Content\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("modal")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"tree"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tree"}},[t._v("#")]),t._v(" Tree")]),t._v(" "),e("p",[t._v("The Tree component in Krayin enables you to display hierarchical data in a tree-like structure, with support for checkboxes or radio buttons for selection.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("input-type")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'checkbox'")])]),t._v(" "),e("td",[t._v("Specifies the type of input to use for selection. Can be either "),e("code",[t._v("checkbox")]),t._v(" or "),e("code",[t._v("radio")]),t._v(".")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("selection-type")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'hierarchical'")])]),t._v(" "),e("td",[t._v("Specifies the selection type. Can be "),e("code",[t._v("'hierarchical'")]),t._v(" or "),e("code",[t._v("'individual'")]),t._v(".")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("name-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'permissions'")])]),t._v(" "),e("td",[t._v("The field name to use as the identifier for each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'value'")])]),t._v(" "),e("td",[t._v("The field name to use as the value for each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("id-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'id'")])]),t._v(" "),e("td",[t._v("The field name to use as the unique identifier for each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("label-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'name'")])]),t._v(" "),e("td",[t._v("The field name to use as the label for each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("children-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'children'")])]),t._v(" "),e("td",[t._v("The field name to use for nesting child nodes within each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("items")])])]),t._v(" "),e("td",[e("code",[t._v("Array")]),t._v(", "),e("code",[t._v("String")]),t._v(", "),e("code",[t._v("Object")])]),t._v(" "),e("td",[e("code",[t._v("[]")])]),t._v(" "),e("td",[t._v("The hierarchical data to be displayed in the tree structure.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value")])])]),t._v(" "),e("td",[e("code",[t._v("Array")]),t._v(", "),e("code",[t._v("String")]),t._v(", "),e("code",[t._v("Object")])]),t._v(" "),e("td",[e("code",[t._v("[]")])]),t._v(" "),e("td",[t._v("The selected values.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("fallback-locale")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'en'")])]),t._v(" "),e("td",[t._v("The fallback locale to use for translations.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("collapse")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Determines whether the tree nodes are initially collapsed ("),e("code",[t._v("true")]),t._v(") or expanded ("),e("code",[t._v("false")]),t._v(").")])])])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("tree")])]),t._v(" component, You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("tree")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("view\n input"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"checkbox"')]),t._v("\n selection"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"individual"')]),t._v("\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("field"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"categories"')]),t._v("\n id"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("field"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"id"')]),t._v("\n value"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("field"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("items")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"categories"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("value"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"('),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categories")])]),t._v("->pluck('id'))\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("fallback"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("locale"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"config('app.fallback_locale')\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("collapse"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("tree")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("view"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"media"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#media"}},[t._v("#")]),t._v(" Media")]),t._v(" "),e("p",[t._v("The Media component in Krayin provides a user interface for managing and displaying images, allowing users to upload, edit, and delete images.:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td"),t._v(" "),e("td",[t._v("The name of the input field.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("allow-multiple")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Whether to allow uploading multiple images.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("show-placeholders")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("true")])]),t._v(" "),e("td",[t._v("Whether to show placeholder images when no images are uploaded.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("uploaded-images")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[e("code",[t._v("[]")])]),t._v(" "),e("td",[t._v("Array of uploaded images.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("width")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'100%'")])]),t._v(" "),e("td",[t._v("Width of the image container.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("height")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'auto'")])]),t._v(" "),e("td",[t._v("Height of the image container.")])])])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("Image")])]),t._v(" component, You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Image Component "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("media")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("images\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"images"')]),t._v("\n allow"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("multiple"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n show"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("placeholders"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("uploaded"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("images"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("images")])]),t._v('"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[122],{420:function(t,e,a){"use strict";a.r(e);var s=a(10),r=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"blade-components"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#blade-components"}},[t._v("#")]),t._v(" Blade Components")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#components"}},[t._v("Components")]),e("ul",[e("li",[e("a",{attrs:{href:"#tag"}},[t._v("Tag")])]),e("li",[e("a",{attrs:{href:"#avatar"}},[t._v("Avatar")])]),e("li",[e("a",{attrs:{href:"#activities"}},[t._v("Activities")])]),e("li",[e("a",{attrs:{href:"#lookup"}},[t._v("Lookup")])]),e("li",[e("a",{attrs:{href:"#attachment"}},[t._v("Attachment")])]),e("li",[e("a",{attrs:{href:"#inline-editable"}},[t._v("Inline Editable")])]),e("li",[e("a",{attrs:{href:"#accordion"}},[t._v("Accordion")])]),e("li",[e("a",{attrs:{href:"#button"}},[t._v("Button")])]),e("li",[e("a",{attrs:{href:"#drawer"}},[t._v("Drawer")])]),e("li",[e("a",{attrs:{href:"#dropdown"}},[t._v("Dropdown")])]),e("li",[e("a",{attrs:{href:"#flat-picker"}},[t._v("Flat-Picker")])]),e("li",[e("a",{attrs:{href:"#data-grid"}},[t._v("Data Grid")])]),e("li",[e("a",{attrs:{href:"#tinymce"}},[t._v("Tinymce")])]),e("li",[e("a",{attrs:{href:"#shimmer"}},[t._v("Shimmer")])]),e("li",[e("a",{attrs:{href:"#table"}},[t._v("Table")])]),e("li",[e("a",{attrs:{href:"#modal"}},[t._v("Modal")])]),e("li",[e("a",{attrs:{href:"#tree"}},[t._v("Tree")])]),e("li",[e("a",{attrs:{href:"#media"}},[t._v("Media")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("To ensure optimal user experience in "),e("strong",[t._v("Krayin")]),t._v(" we have created several separate Blade components for the Admin packages. Now in "),e("strong",[e("code",[t._v("Krayin")])]),t._v(" we have also merged the vue.js code inside the blade component to improve application performance.")]),t._v(" "),e("p",[t._v("Additionally, To learn in detail about blade components, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/blade#introduction",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("ul",[e("li",[t._v("Here are the list of Blade component that is available in "),e("strong",[e("code",[t._v("Krayin")])]),t._v(".")])]),t._v(" "),e("h2",{attrs:{id:"components"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#components"}},[t._v("#")]),t._v(" Components")]),t._v(" "),e("p",[t._v("Components are reusable Blade components used to build the Admin.")]),t._v(" "),e("h3",{attrs:{id:"tag"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tag"}},[t._v("#")]),t._v(" Tag")]),t._v(" "),e("p",[t._v("The Krayin CRM provides a "),e("code",[t._v("Tag")]),t._v(" component that allows you to add and manage tags for various entities such as leads, mails, or any other resources where tagging functionality is required. This component is highly flexible and can be integrated wherever the tagging feature is needed.")]),t._v(" "),e("ul",[e("li",[t._v("Component Props")])]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Tag")]),t._v(" component accepts the following three props:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("attach-endpoint")])]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("The API endpoint used to attach a tag to the specified entity. This should be a valid URL.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("detach-endpoint")])]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("The API endpoint used to detach a tag from the specified entity. This should be a valid URL.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("added-tags")])]),t._v(" "),e("td",[t._v("Array")]),t._v(" "),e("td",[t._v("An array of tags that are already attached to the entity. It should be an array of objects, with each object representing a tag.")])])])]),t._v(" "),e("ul",[e("li",[t._v("Example Usage")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("tags")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("attach"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("endpoint"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"route('admin.leads.tags.attach', "),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$lead")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("id")])]),t._v(')"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("detach"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("endpoint"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"route('admin.leads.tags.detach', "),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$lead")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("id")])]),t._v(')"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("added"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("tags"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$lead")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("tags")])]),t._v('"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Detailed Description")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("attach-endpoint")]),t._v(":")]),t._v(" This prop is crucial for adding new tags. When a user adds a tag, the "),e("code",[t._v("attach-endpoint")]),t._v(" is used to send the tag data to the server. Ensure that the endpoint provided handles the attachment logic on the backend.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("detach-endpoint")]),t._v(":")]),t._v(" Similarly, this prop is used when a tag is removed. The "),e("code",[t._v("detach-endpoint")]),t._v(" sends a request to the server to remove the specified tag from the entity.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("added-tags")]),t._v(":")]),t._v(" This prop provides the component with the list of tags that are already associated with the entity. The tags are displayed when the component is rendered, allowing users to see which tags are currently applied.")])])]),t._v(" "),e("h3",{attrs:{id:"avatar"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#avatar"}},[t._v("#")]),t._v(" Avatar")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Avatar")]),t._v(" component in Krayin CRM is designed to generate and display an avatar with the initials of a given name. This is useful for representing users, contacts, or any other entities with a visual identifier.")]),t._v(" "),e("ul",[e("li",[t._v("Prop")])]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Avatar")]),t._v(" component accepts the following prop:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("name")])]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("The full name for which the avatar should generate initials. For example, if the name is "),e("code",[t._v("John Doe")]),t._v(", the avatar will display "),e("code",[t._v("JD")]),t._v(".")])])])]),t._v(" "),e("ul",[e("li",[t._v("Example Usage")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("avatar")]),t._v(" name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"John Doe"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("p",[t._v("Detailed Description")]),t._v(" "),e("ul",[e("li",[e("strong",[e("code",[t._v("name")]),t._v(":")]),t._v(" The "),e("code",[t._v("name")]),t._v(" prop is required and should be a string representing the full name of the person or entity. The component processes this name and extracts the initials. For example:\n"),e("ul",[e("li",[t._v("If the "),e("code",[t._v("name")]),t._v(" is "),e("code",[t._v("John Doe")]),t._v(", the avatar will display "),e("code",[t._v("JD")]),t._v(".")]),t._v(" "),e("li",[t._v("If the "),e("code",[t._v("name")]),t._v(" is "),e("code",[t._v("Jane Smith")]),t._v(", the avatar will display "),e("code",[t._v("JS")]),t._v(".")])])])]),t._v(" "),e("p",[t._v("This component is particularly useful in scenarios where you need a quick and simple visual representation of users or entities within the CRM interface.")]),t._v(" "),e("h3",{attrs:{id:"activities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#activities"}},[t._v("#")]),t._v(" Activities")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Activities")]),t._v(" Blade Component in Krayin CRM is a versatile and dynamic component designed to display various types of activities related to an entity, such as leads, contacts, warehouse. This component allows you to manage and display different types of data (like emails, products, quotes, and descriptions) in a structured and user-friendly way. Below is a detailed explanation of the props and slots that the component accepts:")]),t._v(" "),e("ul",[e("li",[t._v("Props")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")]),t._v(" "),e("th",[t._v("Default Value")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("endpoint")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The API endpoint that the component will call to fetch and display the activities.")]),t._v(" "),e("td",[e("code",[t._v("''")]),t._v(" (empty string)")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("emailDetachEndpoint")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The API endpoint for detaching emails from the activity log.")]),t._v(" "),e("td",[e("code",[t._v("''")]),t._v(" (empty string)")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("activeType")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The type of activity currently active and displayed in the component.")]),t._v(" "),e("td",[e("code",[t._v("'all'")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("types")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[t._v("An array of predefined activity types, each with a "),e("code",[t._v("name")]),t._v(" and "),e("code",[t._v("label")]),t._v(", which will be displayed as filter options.")]),t._v(" "),e("td",[e("code",[t._v("[ {name: 'all', label: \""+t._s("All")+'" }, ... ]')])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("extraTypes")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[t._v("An array for additional custom activity types that extend the default types provided by the component.")]),t._v(" "),e("td",[e("code",[t._v("[]")]),t._v(" (empty array)")])])])]),t._v(" "),e("ul",[e("li",[t._v("Slots")])]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Activities")]),t._v(" component also supports named slots, which allow you to insert custom content into specific sections of the component. Below are the slots available:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slot Name")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("products")])])]),t._v(" "),e("td",[t._v("Slot for displaying product-related activities. You can include custom product views or components here.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("quotes")])])]),t._v(" "),e("td",[t._v("Slot for displaying quote-related activities. This is where you can include a view for quotes.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("description")])])]),t._v(" "),e("td",[t._v("Slot for displaying a description related to the entity. You can customize the description view or layout.")])])])]),t._v(" "),e("ul",[e("li",[t._v("Usage Example")])]),t._v(" "),e("p",[t._v("Here is how you can use the "),e("code",[t._v("Activities")]),t._v(" component in your Blade template:")]),t._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-admin:")]),t._v(":activities")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":endpoint")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("route('admin.leads.activities.index', $lead->id)"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":email-detach-endpoint")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("route('admin.leads.emails.detach', $lead->id)"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":extra-types")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("[\n ['name' => 'description', 'label' => trans('admin::app.leads.view.tabs.description')],\n ['name' => 'products', 'label' => trans('admin::app.leads.view.tabs.products')],\n ['name' => 'quotes', 'label' => trans('admin::app.leads.view.tabs.quotes')],\n ]"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- Products --\x3e")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-slot:")]),t._v("products")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n @include('admin::leads.view.products')\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- Quotes --\x3e")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-slot:")]),t._v("quotes")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n @include('admin::leads.view.quotes')\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- Description --\x3e")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-slot:")]),t._v("description")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("p-4"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n {{ $lead->description }}\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Explanation:")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("endpoint")])]),t._v(": This prop is used to specify the API endpoint that the component will query to fetch the activities. In this example, the endpoint is dynamically generated based on the lead's ID.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("email-detach-endpoint")])]),t._v(": This prop provides the API endpoint that will be called when detaching an email from the activity log. It's crucial for managing email-related activities within the component.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("extra-types")])]),t._v(": This prop allows you to extend the types of activities displayed by the component. Each activity type is represented by an array containing a "),e("code",[t._v("name")]),t._v(" and "),e("code",[t._v("label")]),t._v(". The "),e("code",[t._v("name")]),t._v(" is used to identify the activity type, and the "),e("code",[t._v("label")]),t._v(" is the user-friendly name displayed in the UI.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Slots")]),t._v(": The "),e("code",[t._v("Activities")]),t._v(" component supports named slots ("),e("code",[t._v("products")]),t._v(", "),e("code",[t._v("quotes")]),t._v(", "),e("code",[t._v("description")]),t._v(") where you can insert custom views or content. These slots are particularly useful for displaying specific types of activities, like products or quotes, in a way that fits your application's design.")])])]),t._v(" "),e("p",[t._v("This component is powerful for creating a comprehensive activity log in CRM applications, ensuring that all relevant interactions and data are easily accessible and well-organized. The use of props and slots makes it highly customizable, allowing you to tailor the component to fit specific needs within the admin panel.")]),t._v(" "),e("h3",{attrs:{id:"lookup"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#lookup"}},[t._v("#")]),t._v(" Lookup")]),t._v(" "),e("p",[t._v("The Lookup Blade Component in Krayin CRM is designed to facilitate the selection of items from a list or database by providing a search-and-select interface. This component is highly customizable and can be integrated into forms or other UI elements to enhance user experience. Below is a detailed explanation of the props that the component accepts:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")]),t._v(" "),e("th",[t._v("Default Value")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("src")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The API endpoint or URL from which the component fetches data for the lookup functionality.")]),t._v(" "),e("td",[e("code",[t._v("required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("params")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("Additional parameters to be sent along with the API request, often used for filtering data.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The name of the input field, used as an identifier in forms.")]),t._v(" "),e("td",[e("code",[t._v("required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("placeholder")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The placeholder text displayed in the input field when no value is selected.")]),t._v(" "),e("td",[e("code",[t._v("required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("The currently selected value in the lookup component. This object represents the selected item.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("rules")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("Validation rules applied to the lookup component, typically using Laravel's validation syntax.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("label")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("A label for the lookup component, displayed above or next to the input field.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("canAddNew")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[t._v("A boolean flag that enables or disables the ability to add a new item directly from the lookup component.")]),t._v(" "),e("td",[e("code",[t._v("false")])])])])]),t._v(" "),e("ul",[e("li",[t._v("Usage Example:")])]),t._v(" "),e("p",[t._v("Here's an example of how you might use the Lookup Blade Component in your Blade template:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("lookup")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("src")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"src"')]),t._v("\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"person[id]"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("params")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"params"')]),t._v("\n @on"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("selected"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"addPerson"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("placeholder"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"trans('admin::app.leads.common.contact.name')\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("value")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"{id: person.id, name: person.name}"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("can"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("add"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Description:")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("src")])]),t._v(": The URL or API endpoint from which the lookup component fetches its data. This is required and is the source for populating the search results within the lookup dropdown.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("params")])]),t._v(": An object containing additional parameters that are sent along with the API request. This allows for filtering or customizing the data fetched based on specific criteria.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("name")])]),t._v(": The name of the lookup input field, used to identify the component in form submissions. This is required and should be unique within the form.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("placeholder")])]),t._v(": The placeholder text that appears in the input field when the user hasn't selected a value. This helps guide users on what the input field is used for.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("value")])]),t._v(": An object representing the currently selected value in the lookup component. This is typically bound to a data property in your application and is used to prepopulate the lookup field with a selected item.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("rules")])]),t._v(": Validation rules that are applied to the lookup component. These rules are defined using Laravel's validation syntax and can enforce constraints such as required fields.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("label")])]),t._v(": A label that accompanies the lookup component, providing context or instructions to the user. It is optional and can be used to describe the purpose of the lookup field.")])]),t._v(" "),e("li",[e("p",[e("strong",[e("code",[t._v("canAddNew")])]),t._v(": A boolean flag that, when set to "),e("code",[t._v("true")]),t._v(", allows users to add a new item directly from the lookup component. This is particularly useful when the desired item is not found in the existing list, enabling a quick addition of new options.")])])]),t._v(" "),e("p",[t._v("This Lookup Component is useful in various scenarios where users need to search for and select items from a list, such as selecting products, categories, or any other entities within Krayin CRM. The flexibility provided by props like "),e("code",[t._v("src")]),t._v(", "),e("code",[t._v("params")]),t._v(", and "),e("code",[t._v("canAddNew")]),t._v(" ensures that it can be tailored to fit the specific needs of different parts of the application.")]),t._v(" "),e("h3",{attrs:{id:"attachment"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#attachment"}},[t._v("#")]),t._v(" Attachment")]),t._v(" "),e("p",[t._v("The Attachment Blade Component in Krayin CRM is designed to handle file uploads with various customizable options. This component is powered by Vue.js, providing flexibility in managing attachments within forms or other UI elements. Below is a detailed explanation of the props that the component accepts:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")]),t._v(" "),e("th",[t._v("Default Value")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The name of the input field for attachments, used as an identifier in forms.")]),t._v(" "),e("td",[e("code",[t._v("'attachments'")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("validations")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("Validation rules for the attachments, typically using Laravel's validation syntax.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("uploadedAttachments")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[t._v("An array of already uploaded attachments, allowing for the display and management of existing files.")]),t._v(" "),e("td",[e("code",[t._v("[]")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("allowMultiple")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[t._v("Determines whether multiple files can be uploaded at once.")]),t._v(" "),e("td",[e("code",[t._v("false")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("hideButton")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[t._v("Option to hide the upload button, useful in scenarios where uploads are triggered differently.")]),t._v(" "),e("td",[e("code",[t._v("false")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("errors")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("An object containing any validation errors related to the file upload process.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])])])]),t._v(" "),e("ul",[e("li",[t._v("Usage Example:")])]),t._v(" "),e("p",[t._v("Here's an example of how you might use the Attachment Blade Component in your Blade template:")]),t._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-admin:")]),t._v(":attachments")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("documentAttachments"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("validations")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("required|mimes:pdf,jpg,png|max:2048"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":uploadedAttachments")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("$lead->documents"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":allowMultiple")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("true"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":hideButton")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("false"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":errors")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("$errors->toArray()"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Description:")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Name")]),t._v(": This is the name of the input field for the attachments, often used as the "),e("code",[t._v("name")]),t._v(" attribute in the HTML form. It uniquely identifies the file input, especially in forms that may have multiple file upload fields.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Validations")]),t._v(": Validation rules that apply to the uploaded files. These rules are defined using Laravel's validation syntax, allowing you to specify file types, size limits, and other constraints.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Uploaded Attachments")]),t._v(": An array that holds information about attachments that have already been uploaded. This allows for displaying existing files to users, enabling them to view or manage previously uploaded files.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Allow Multiple")]),t._v(": A boolean flag that enables or disables the ability to upload multiple files at once. If set to "),e("code",[t._v("true")]),t._v(", users can select and upload several files in one action.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Hide Button")]),t._v(": A boolean flag to hide the file upload button. This can be useful if the file upload is triggered by other UI elements or if you want to prevent manual file uploads in certain contexts.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Errors")]),t._v(": An object containing validation errors related to the file uploads. If the uploaded files don't meet the specified validation criteria, the errors object will hold the relevant messages to be displayed to the user.")])])]),t._v(" "),e("p",[t._v("This component is versatile and can be integrated into various parts of Krayin CRM where file uploads are necessary, such as when attaching documents to leads, contacts, or any other CRM entities. The ability to customize validation rules, manage multiple files, and control the visibility of the upload button makes it a powerful tool for handling attachments.")]),t._v(" "),e("h3",{attrs:{id:"inline-editable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inline-editable"}},[t._v("#")]),t._v(" Inline Editable")]),t._v(" "),e("p",[t._v("The Inline Editable Blade Component in Krayin CRM allows users to create editable fields directly within the user interface, providing an intuitive and seamless editing experience. This component is powered by Vue.js and is highly customizable through various props that dictate its behavior, appearance, and functionality. Below is a detailed explanation of each prop that the component accepts:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")]),t._v(" "),e("th",[t._v("Default Value")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The name of the field, used as an identifier for the input.")]),t._v(" "),e("td",[e("strong",[t._v("Required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value")])])]),t._v(" "),e("td",[e("code",[t._v("Mixed")])]),t._v(" "),e("td",[t._v("The current value of the field that will be displayed and edited.")]),t._v(" "),e("td",[e("strong",[t._v("Required")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("rules")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("Validation rules for the field, typically using "),e("a",{attrs:{href:"https://vee-validate.logaretm.com/v4/guide/overview/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Vee Validate v4"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("label")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The label for the field, displayed alongside the input.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("placeholder")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("Placeholder text for the input field, shown when the value is empty.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("position")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The position of the editable input relative to its label or icon, typically 'right' or 'left'.")]),t._v(" "),e("td",[e("code",[t._v("'right'")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("allowEdit")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[t._v("Determines whether the field is editable by the user.")]),t._v(" "),e("td",[e("code",[t._v("true")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("errors")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("An object containing any validation errors related to the field.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("url")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("The endpoint URL where the updated value should be sent for saving.")]),t._v(" "),e("td",[e("code",[t._v("''")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("params")])])]),t._v(" "),e("td",[e("code",[t._v("Object")])]),t._v(" "),e("td",[t._v("Additional parameters to be sent along with the value when saving.")]),t._v(" "),e("td",[e("code",[t._v("{}")])])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("valueLabel")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("A label to represent the value, especially useful when displaying complex data types.")]),t._v(" "),e("td",[e("code",[t._v("''")])])])])]),t._v(" "),e("ul",[e("li",[t._v("Usage Example:")])]),t._v(" "),e("p",[t._v("Here's an example of how you might use this Inline Editable Blade Component in your Blade template:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("form")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("control"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("group"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("controls"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("inline"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("text\n type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"inline"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("name")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"'{{ "),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("code")])]),t._v(" }}'\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("value")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"'{{ "),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$value")])]),t._v(" }}'\"")]),t._v("\n position"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"left"')]),t._v("\n rules"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"required"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("label"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("name")])]),t._v('"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("placeholder"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("name")])]),t._v('"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("errors")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"errors"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("url"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$url")])]),t._v('"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("allow"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("edit"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$allowEdit")])]),t._v('"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("ul",[e("li",[e("p",[t._v("Description:")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Name")]),t._v(": This is the identifier for the input field, often used as the "),e("code",[t._v("name")]),t._v(" attribute in the HTML form.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Value")]),t._v(": The current value of the field, which can be edited by the user. It is passed directly to the input field.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Rules")]),t._v(": Validation rules that are applied when the value is updated, ensuring the data meets specific criteria before being saved.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Label")]),t._v(": The text label displayed next to the input field, providing context about what the field represents.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Placeholder")]),t._v(": Text that appears in the input field when it is empty, guiding the user on what to enter.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Position")]),t._v(": Determines where the editable input appears relative to the label or any accompanying icons.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Allow Edit")]),t._v(": A boolean flag that enables or disables the ability to edit the field. When set to "),e("code",[t._v("false")]),t._v(", the field will be read-only.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Errors")]),t._v(": Any validation errors associated with the field, which can be displayed to the user if the input does not meet the validation criteria.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("URL")]),t._v(": The endpoint where the component sends the updated value when the user saves their changes.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Params")]),t._v(": Additional parameters that can be sent along with the value, such as method overrides or extra data needed for the request.")])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Value Label")]),t._v(": A label that can represent the value when displaying complex data types or when the value itself is not straightforward.")])])]),t._v(" "),e("p",[t._v("This component is highly versatile and can be used across various sections of the CRM, such as in leads, contacts, or any other entity where inline editing is required. The ability to customize nearly every aspect of its behavior makes it a powerful tool for enhancing user experience.")]),t._v(" "),e("h3",{attrs:{id:"accordion"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#accordion"}},[t._v("#")]),t._v(" Accordion")]),t._v(" "),e("p",[t._v("Krayin provides a collapsible accordion UI element, allowing users to toggle the visibility of content sections. It is commonly used for organizing and presenting information in a compact and intuitive manner.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("is-active")])])]),t._v(" "),e("td",[t._v("Boolean")]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Determines the initial state of the accordion. When set to "),e("code",[t._v("true")]),t._v(", the accordion section will be expanded by default; otherwise, it will be collapsed.")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slots")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("header")])])]),t._v(" "),e("td",[t._v("Used to customize the header section of the accordion.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("content")])])]),t._v(" "),e("td",[t._v("Used to customize the content section of the accordion.")])])])]),t._v(" "),e("p",[t._v("You can customize the appearance of the accordion "),e("code",[t._v("header")]),t._v(" and "),e("code",[t._v("content")]),t._v(" by passing additional CSS classes to the header and content slots, respectively.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("accordion")])]),t._v(" component, you can call it like this:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Accordion "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("accordion")]),t._v(" \n title"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"Admin Accordion"')]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"px-5"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("header "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"bg-gray-200"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Accordion Header\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("content "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"bg-green-200"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Accordion Content\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("accordion")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"button"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#button"}},[t._v("#")]),t._v(" Button")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("button")]),t._v(" component in Krayin provides a versatile button element that supports loading state with a spinner animation. It offers flexibility in styling and functionality to suit various use cases within your application.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("title")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("None")]),t._v(" "),e("td",[t._v("Title text displayed on the button.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("loading")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Indicates whether the button is in a loading state.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("button-type")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'button'")])]),t._v(" "),e("td",[t._v("Specifies the type of button ("),e("code",[t._v("'button'")]),t._v(", "),e("code",[t._v("'submit'")]),t._v(", "),e("code",[t._v("'reset'")]),t._v(", etc.).")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("button-class")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("''")])]),t._v(" "),e("td",[t._v("Additional classes for custom styling.")])])])]),t._v(" "),e("p",[t._v("You can customize the appearance of the button by passing additional props "),e("code",[t._v("loading")]),t._v(" "),e("code",[t._v("buttonType")]),t._v(" "),e("code",[t._v("buttonClass")]),t._v(" respectively.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("button")])]),t._v(" component. You can call it like this:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Button "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("button")]),t._v("\n type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"submit"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"secondary-button w-full max-w-full max-md:py-3 max-sm:rounded-lg max-sm:py-1.5"')]),t._v("\n button"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"secondary-button"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("loading"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"false"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("title"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"trans('Button')\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("disabled"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("loading")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"drawer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#drawer"}},[t._v("#")]),t._v(" Drawer")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("drawer")]),t._v(" component in Krayin provides a versatile drawer that can be positioned on the top, bottom, left, or right side of the screen. It allows you to create interactive drawers that can contain various content such as headers, body, and footer sections. The drawer can be toggled open or closed, providing a clean and efficient way to display additional information or functionality.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("is-active")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Determines whether the drawer is initially active.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("position")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'left'")])]),t._v(" "),e("td",[t._v("Specifies the position of the drawer ("),e("code",[t._v("top")]),t._v(", "),e("code",[t._v("bottom")]),t._v(", "),e("code",[t._v("left")]),t._v(", or "),e("code",[t._v("right")]),t._v(").")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("width")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'500px'")])]),t._v(" "),e("td",[t._v("Specifies the width of the drawer.")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slots")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("toggle")])])]),t._v(" "),e("td",[t._v("Slot for the toggle button or element.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("header")])])]),t._v(" "),e("td",[t._v("Slot for the header content.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("content")])])]),t._v(" "),e("td",[t._v("Slot for the main content.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("footer")])])]),t._v(" "),e("td",[t._v("Slot for the footer content.")])])])]),t._v(" "),e("p",[t._v("You can customize the appearance of the Drawer by passing additional CSS.")]),t._v(" "),e("ul",[e("li",[t._v("To customize the header section, you can target the "),e("code",[t._v("header")]),t._v(" slot with your own CSS classes or styles.")]),t._v(" "),e("li",[t._v("Similarly, you can customize the content section using the "),e("code",[t._v("content")]),t._v(" slot.")]),t._v(" "),e("li",[t._v("Similarly, you can customize the content section using the "),e("code",[t._v("footer")]),t._v(" slot.")])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("drawer")])]),t._v(" component. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Drawer "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("drawer")]),t._v(" \n position"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"left"')]),t._v("\n width"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"100%"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("toggle"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Drawer Toggle\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("header "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"bg-red-100"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Pass your custom css to customize header "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("Drawer")]),t._v(" Header\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("content "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"!p-5"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Pass your custom css to customize header "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("Drawer")]),t._v(" Content\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("drawer")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"dropdown"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dropdown"}},[t._v("#")]),t._v(" Dropdown")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("dropdown")]),t._v(" component in Krayin provides a customizable dropdown menu that can be positioned at different locations relative to its toggle button. It enables you to create dropdown menus with various content sections such as toggle button, content, and menu items.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("close-on-click")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("true")])]),t._v(" "),e("td",[t._v("Determines whether the dropdown should close when clicking outside the menu.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("position")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'bottom-left'")])]),t._v(" "),e("td",[t._v("Specifies the position of the dropdown menu relative to the toggle button ("),e("code",[t._v("top-left")]),t._v(", "),e("code",[t._v("top-right")]),t._v(", "),e("code",[t._v("bottom-left")]),t._v(", "),e("code",[t._v("bottom-right")]),t._v(").")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slots")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("toggle")])])]),t._v(" "),e("td",[t._v("Slot for the toggle button or element..")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("content")])])]),t._v(" "),e("td",[t._v("Slot for the main content.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("menu")])])]),t._v(" "),e("td",[t._v("Slot for the menu items..")])])])]),t._v(" "),e("p",[t._v("To customize the content section, you can target the "),e("code",[t._v("content")]),t._v(" slot with your own CSS classes or styles.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("dropdown")])]),t._v(" component. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Dropdown "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("dropdown")]),t._v(" position"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"bottom-left"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("toggle"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Dropdown Toggle\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("content "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"!p-0"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Dropdown Content\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("dropdown")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("item\n Menu Item "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n Menu Item "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("dropdown")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("item"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("dropdown")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"flat-picker"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#flat-picker"}},[t._v("#")]),t._v(" Flat-Picker")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("datetime-picker")]),t._v(" and "),e("code",[t._v("date-picker")]),t._v(" components provide "),e("code",[t._v("date")]),t._v(" and "),e("code",[t._v("time")]),t._v(" picker functionality within Krayin applications. These components are based on the Flatpickr library and offer customizable options for selecting dates and times.")]),t._v(" "),e("p",[t._v("It can be configured with various props to customize its behavior according to application requirements.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Prop")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("None")]),t._v(" "),e("td",[t._v("Name attribute for the input field.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[t._v("None")]),t._v(" "),e("td",[t._v("Initial value of the date picker.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("allow-input")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("true")])]),t._v(" "),e("td",[t._v("Determines whether manual input is allowed in the input field.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("disable")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[e("code",[t._v("[]")])]),t._v(" "),e("td",[t._v("Array of dates to disable in the date picker.")])])])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("flat-picker")])]),t._v(" component. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin DateTime Picker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("flat")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("picker"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("date")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("allow")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("input"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"false"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("input\n type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"datetime"')]),t._v("\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"datetime"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"mb-4"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("value"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"selectedDateTime"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("disable"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"disabledDates"')]),t._v("\n placeholder"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"datetime"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("flat")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("picker"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("date"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"data-grid"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#data-grid"}},[t._v("#")]),t._v(" Data Grid")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("datagrid")]),t._v(" component in Krayin applications provides a flexible and customizable data grid interface for displaying tabular data. It includes features such as "),e("code",[t._v("sorting")]),t._v(", "),e("code",[t._v("filtering")]),t._v(", "),e("code",[t._v("pagination")]),t._v(", and "),e("code",[t._v("mass actions")]),t._v(" to manage data efficiently.")]),t._v(" "),e("p",[t._v("You can customize the appearance of the "),e("code",[t._v("DataGrid")]),t._v(" by referring to the "),e("a",{attrs:{href:"https://devdocs.Krayin.com/2.0/packages/datagrid.html#datagrid-customization",target:"_blank",rel:"noopener noreferrer"}},[t._v("DataGrid Customization"),e("OutboundLink")],1),t._v(" documentation.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("datagrid")])]),t._v(" component. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Datagrid "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("datagrid")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("src"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"route('admin.catalog.products.index')\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"tinymce"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tinymce"}},[t._v("#")]),t._v(" Tinymce")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("tinymce")]),t._v(" component wraps the Tinymce editor and provides additional functionalities like AI content generation.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("selector")])])]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[e("code",[t._v("''")])]),t._v(" "),e("td",[t._v("The CSS selector for the textarea element to initialize as TinyMCE.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("field")])])]),t._v(" "),e("td",[t._v("Object")]),t._v(" "),e("td",[e("code",[t._v("{}")])]),t._v(" "),e("td",[t._v("Vue Formulate field object.")])])])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("tinymce")])]),t._v(" component on admin and shop. You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Tinymce "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("form")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("control"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("group"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("control\n type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"textarea"')]),t._v("\n id"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"content"')]),t._v("\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"content"')]),t._v("\n rules"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"required"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("value"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"old('content')\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("label"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"Content"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("placeholder"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"Content"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("tinymce"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"shimmer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#shimmer"}},[t._v("#")]),t._v(" Shimmer")]),t._v(" "),e("p",[t._v("Prebuilt "),e("code",[t._v("shimmer")]),t._v(" effects are available in Krayin. You can easily use them.")]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("shimmer")])]),t._v(" You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin shimmer "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("shimmer")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("datagrid "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"table"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#table"}},[t._v("#")]),t._v(" Table")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Table")]),t._v(" component in Laravel Krayin CRM is used to display structured tabular data. The customization options are also available through CSS for various table elements:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Styling")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("Table")])])]),t._v(" "),e("td",[t._v("Apply custom styles to the "),e("code",[t._v("table")]),t._v(" element to change its appearance, such as borders, padding, and background color.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("Cell")])])]),t._v(" "),e("td",[t._v("Customize the appearance of "),e("code",[t._v("th")]),t._v(" and "),e("code",[t._v("td")]),t._v(" elements using CSS, such as font size, text alignment, and background color.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("Row")])])]),t._v(" "),e("td",[t._v("Apply styles to "),e("code",[t._v("tr")]),t._v(" elements to change their appearance, such as background color, hover effects, and borders.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("Header")])])]),t._v(" "),e("td",[t._v("Customize the appearance of the header cells within the "),e("code",[t._v("thead")]),t._v(" section using "),e("code",[t._v("th")]),t._v(" elements. Apply styles such as font weight, text color, and background color.")])])])]),t._v(" "),e("p",[t._v("To use the "),e("strong",[e("code",[t._v("Table")])]),t._v(" component in Krayin CRM, you can call it like this:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("CRM")]),t._v(" Table "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("thead"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("thead"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Heading "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Heading "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Heading "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Heading "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("th"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("thead"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("thead"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tbody"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tbody"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Column "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Column "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Column "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Column "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("td"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tbody"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("tbody"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("table")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"modal"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#modal"}},[t._v("#")]),t._v(" Modal")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("modal")]),t._v(" component in Krayin provides a flexible way to create modal dialogs. It allows you to display content in a layer that floats above the rest of the page.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("is-active")])]),t._v(" "),e("td",[t._v("Boolean")]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Controls the visibility of the modal.")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Slot")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("toggle")])])]),t._v(" "),e("td",[t._v("Used for the element that toggles the visibility of the modal.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("header")])])]),t._v(" "),e("td",[t._v("Allows customization of the modal header content.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("content")])])]),t._v(" "),e("td",[t._v("Provides a slot for the main body content of the modal.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("footer")])])]),t._v(" "),e("td",[t._v("Allows customization of the footer content within the modal.")])])])]),t._v(" "),e("p",[t._v("You can customize the appearance of the Modal by passing additional CSS.")]),t._v(" "),e("ul",[e("li",[t._v("To customize the header section, you can target the "),e("code",[t._v("header")]),t._v(" slot with your own CSS classes or styles.")]),t._v(" "),e("li",[t._v("Similarly, you can customize the content section using the "),e("code",[t._v("content")]),t._v(" slot.")]),t._v(" "),e("li",[t._v("Similarly, you can customize the content section using the "),e("code",[t._v("footer")]),t._v(" slot.")])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("modal")])]),t._v(" component, You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Admin Modal "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("modal")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("toggle"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Modal Toggle\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("header"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Modal Header\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("content"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n Modal Content\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("modal")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"tree"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tree"}},[t._v("#")]),t._v(" Tree")]),t._v(" "),e("p",[t._v("The Tree component in Krayin enables you to display hierarchical data in a tree-like structure, with support for checkboxes or radio buttons for selection.")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("input-type")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'checkbox'")])]),t._v(" "),e("td",[t._v("Specifies the type of input to use for selection. Can be either "),e("code",[t._v("checkbox")]),t._v(" or "),e("code",[t._v("radio")]),t._v(".")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("selection-type")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'hierarchical'")])]),t._v(" "),e("td",[t._v("Specifies the selection type. Can be "),e("code",[t._v("'hierarchical'")]),t._v(" or "),e("code",[t._v("'individual'")]),t._v(".")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("name-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'permissions'")])]),t._v(" "),e("td",[t._v("The field name to use as the identifier for each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'value'")])]),t._v(" "),e("td",[t._v("The field name to use as the value for each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("id-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'id'")])]),t._v(" "),e("td",[t._v("The field name to use as the unique identifier for each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("label-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'name'")])]),t._v(" "),e("td",[t._v("The field name to use as the label for each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("children-field")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'children'")])]),t._v(" "),e("td",[t._v("The field name to use for nesting child nodes within each tree node.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("items")])])]),t._v(" "),e("td",[e("code",[t._v("Array")]),t._v(", "),e("code",[t._v("String")]),t._v(", "),e("code",[t._v("Object")])]),t._v(" "),e("td",[e("code",[t._v("[]")])]),t._v(" "),e("td",[t._v("The hierarchical data to be displayed in the tree structure.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("value")])])]),t._v(" "),e("td",[e("code",[t._v("Array")]),t._v(", "),e("code",[t._v("String")]),t._v(", "),e("code",[t._v("Object")])]),t._v(" "),e("td",[e("code",[t._v("[]")])]),t._v(" "),e("td",[t._v("The selected values.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("fallback-locale")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'en'")])]),t._v(" "),e("td",[t._v("The fallback locale to use for translations.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("collapse")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Determines whether the tree nodes are initially collapsed ("),e("code",[t._v("true")]),t._v(") or expanded ("),e("code",[t._v("false")]),t._v(").")])])])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("tree")])]),t._v(" component, You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("tree")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("view\n input"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"checkbox"')]),t._v("\n selection"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("type"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"individual"')]),t._v("\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("field"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"categories"')]),t._v("\n id"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("field"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"id"')]),t._v("\n value"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("field"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("items")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"categories"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("value"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"('),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categories")])]),t._v("->pluck('id'))\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("fallback"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("locale"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"config('app.fallback_locale')\"")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("collapse"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("tree")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("view"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),e("h3",{attrs:{id:"media"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#media"}},[t._v("#")]),t._v(" Media")]),t._v(" "),e("p",[t._v("The Media component in Krayin provides a user interface for managing and displaying images, allowing users to upload, edit, and delete images.:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Props")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Default Value")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("strong",[e("code",[t._v("name")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td"),t._v(" "),e("td",[t._v("The name of the input field.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("allow-multiple")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("false")])]),t._v(" "),e("td",[t._v("Whether to allow uploading multiple images.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("show-placeholders")])])]),t._v(" "),e("td",[e("code",[t._v("Boolean")])]),t._v(" "),e("td",[e("code",[t._v("true")])]),t._v(" "),e("td",[t._v("Whether to show placeholder images when no images are uploaded.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("uploaded-images")])])]),t._v(" "),e("td",[e("code",[t._v("Array")])]),t._v(" "),e("td",[e("code",[t._v("[]")])]),t._v(" "),e("td",[t._v("Array of uploaded images.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("width")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'100%'")])]),t._v(" "),e("td",[t._v("Width of the image container.")])]),t._v(" "),e("tr",[e("td",[e("strong",[e("code",[t._v("height")])])]),t._v(" "),e("td",[e("code",[t._v("String")])]),t._v(" "),e("td",[e("code",[t._v("'auto'")])]),t._v(" "),e("td",[t._v("Height of the image container.")])])])]),t._v(" "),e("p",[t._v("Let's assume you want to use the "),e("strong",[e("code",[t._v("Image")])]),t._v(" component, You can call it like this.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),t._v(" Image Component "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("x"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("admin")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("media")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("images\n name"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"images"')]),t._v("\n allow"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("multiple"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n show"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("placeholders"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"true"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("uploaded"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("images"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token interpolation"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("images")])]),t._v('"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/124.bedc3890.js b/assets/js/124.15cf7ffc.js similarity index 99% rename from assets/js/124.bedc3890.js rename to assets/js/124.15cf7ffc.js index da02cb7..0c36a17 100644 --- a/assets/js/124.bedc3890.js +++ b/assets/js/124.15cf7ffc.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[124],{423:function(e,t,s){"use strict";s.r(t);var a=s(10),n=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"access-control-list"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-control-list"}},[e._v("#")]),e._v(" Access Control List")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#directory-structure"}},[e._v("Directory Structure")]),t("ul",[t("li",[t("a",{attrs:{href:"#create-configuration-file"}},[e._v("Create Configuration File")])]),t("li",[t("a",{attrs:{href:"#define-acl-configuration"}},[e._v("Define ACL Configuration")])])])]),t("li",[t("a",{attrs:{href:"#merge-acl-configuration"}},[e._v("Merge ACL Configuration")]),t("ul",[t("li",[t("a",{attrs:{href:"#modify-service-provider"}},[e._v("Modify Service Provider")])]),t("li",[t("a",{attrs:{href:"#register-method"}},[e._v("Register Method")])]),t("li",[t("a",{attrs:{href:"#clear-configuration-cache"}},[e._v("Clear Configuration Cache")])]),t("li",[t("a",{attrs:{href:"#verify-in-admin-panel"}},[e._v("Verify in Admin Panel")])])])]),t("li",[t("a",{attrs:{href:"#checking-roles-and-permissions"}},[e._v("Checking Roles and Permissions")]),t("ul",[t("li",[t("a",{attrs:{href:"#access-roles"}},[e._v("Access Roles")])]),t("li",[t("a",{attrs:{href:"#permission-checks"}},[e._v("Permission Checks")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Krayin's Access Control List (ACL) feature enhances security by allowing administrators to finely manage user access across different application sections. It enables precise control over permissions, ensuring users only access authorized resources and actions. By defining roles and assigning privileges based on organizational structures or responsibilities, Krayin's ACL strengthens governance, safeguards sensitive data, and ensures compliance with policies. This capability supports a secure and customizable user experience, adapting permissions dynamically to meet evolving organizational needs, thereby enhancing operational efficiency.")]),e._v(" "),t("h2",{attrs:{id:"directory-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[e._v("#")]),e._v(" Directory Structure")]),e._v(" "),t("p",[e._v("To configure Access Control List (ACL) settings in Krayin, follow these structured steps:")]),e._v(" "),t("h3",{attrs:{id:"create-configuration-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-file"}},[e._v("#")]),e._v(" Create Configuration File")]),e._v(" "),t("p",[e._v("Begin by creating a new file named "),t("code",[e._v("acl.php")]),e._v(" within the "),t("code",[e._v("Config")]),e._v(" directory of your package located at "),t("code",[e._v("packages/Webkul/Category/src/Config")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Config\n ├── acl.php\n └── ...\n")])])]),t("h3",{attrs:{id:"define-acl-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#define-acl-configuration"}},[e._v("#")]),e._v(" Define ACL Configuration")]),e._v(" "),t("p",[e._v("Inside "),t("code",[e._v("acl.php")]),e._v(", define ACL settings using an array format. Each array element represents a menu item or resource with parameters such as key, "),t("code",[e._v("name")]),e._v(", "),t("code",[e._v("route")]),e._v(", and "),t("code",[e._v("sort")]),e._v(". Here’s an example:")]),e._v(" "),t("p",[e._v("Add the following code to "),t("code",[e._v("acl.php")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'name'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'route'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category.admin.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'sort'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("2")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])])]),t("p",[e._v("In the above code, we have defined an array for each menu item with the parameters (key, name, route, and sort). You need to define the menus you want to include in the ACL here.")]),e._v(" "),t("h2",{attrs:{id:"merge-acl-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#merge-acl-configuration"}},[e._v("#")]),e._v(" Merge ACL Configuration")]),e._v(" "),t("p",[e._v("To merge the ACL configuration, follow these steps:")]),e._v(" "),t("h3",{attrs:{id:"modify-service-provider"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#modify-service-provider"}},[e._v("#")]),e._v(" Modify Service Provider")]),e._v(" "),t("p",[e._v("Navigate to the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class within the "),t("code",[e._v("Webkul\\Category\\Providers")]),e._v(" namespace.")]),e._v(" "),t("h3",{attrs:{id:"register-method"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#register-method"}},[e._v("#")]),e._v(" Register Method")]),e._v(" "),t("p",[e._v("Inside the "),t("code",[e._v("register")]),e._v(" method of your service provider, use the mergeConfigFrom method to merge your ACL configuration file:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[e._v(" "),t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("mergeConfigFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dirname")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("__DIR__")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(".")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'/Config/acl.php'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'acl'")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("p",[e._v("Ensure that the path specified in mergeConfigFrom matches the location of your acl.php file.")]),e._v(" "),t("p",[e._v("This will merge the ACL configuration with the existing configuration.")]),e._v(" "),t("h3",{attrs:{id:"clear-configuration-cache"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#clear-configuration-cache"}},[e._v("#")]),e._v(" Clear Configuration Cache")]),e._v(" "),t("p",[e._v("After making changes, clear the configuration cache to apply the latest ACL configuration:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan optimize\n")])])]),t("h3",{attrs:{id:"verify-in-admin-panel"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#verify-in-admin-panel"}},[e._v("#")]),e._v(" Verify in Admin Panel")]),e._v(" "),t("p",[e._v("Check the updated ACL configuration within the admin panel to confirm that menu items are correctly displayed and sorted according to your configuration.")]),e._v(" "),t("p",[e._v("This will ensure that the latest ACL configuration is used.")]),e._v(" "),t("h2",{attrs:{id:"checking-roles-and-permissions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#checking-roles-and-permissions"}},[e._v("#")]),e._v(" Checking Roles and Permissions")]),e._v(" "),t("p",[e._v("To manage roles and permissions effectively:")]),e._v(" "),t("h3",{attrs:{id:"access-roles"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-roles"}},[e._v("#")]),e._v(" Access Roles")]),e._v(" "),t("p",[e._v("In the Admin model located in "),t("code",[e._v("Webkul\\User\\Models")]),e._v(", utilize the relationship with the Role model to manage "),t("code",[e._v("roles")]),e._v(" associated with users.")]),e._v(" "),t("h3",{attrs:{id:"permission-checks"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#permission-checks"}},[e._v("#")]),e._v(" Permission Checks")]),e._v(" "),t("p",[e._v("Use the "),t("code",[e._v("bouncer()")]),e._v(" helper function to verify if a user has specific permissions. Example usage:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("bouncer")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("hasPermission")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$permission")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),t("p",[e._v("Replace "),t("code",[e._v("$permission")]),e._v(" with the actual permission you want to check.")]),e._v(" "),t("p",[e._v("By following these steps, you can seamlessly configure and manage Access Control List (ACL) settings in Krayin, ensuring secure and controlled access to administrative functionalities.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[124],{424:function(e,t,s){"use strict";s.r(t);var a=s(10),n=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"access-control-list"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-control-list"}},[e._v("#")]),e._v(" Access Control List")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#directory-structure"}},[e._v("Directory Structure")]),t("ul",[t("li",[t("a",{attrs:{href:"#create-configuration-file"}},[e._v("Create Configuration File")])]),t("li",[t("a",{attrs:{href:"#define-acl-configuration"}},[e._v("Define ACL Configuration")])])])]),t("li",[t("a",{attrs:{href:"#merge-acl-configuration"}},[e._v("Merge ACL Configuration")]),t("ul",[t("li",[t("a",{attrs:{href:"#modify-service-provider"}},[e._v("Modify Service Provider")])]),t("li",[t("a",{attrs:{href:"#register-method"}},[e._v("Register Method")])]),t("li",[t("a",{attrs:{href:"#clear-configuration-cache"}},[e._v("Clear Configuration Cache")])]),t("li",[t("a",{attrs:{href:"#verify-in-admin-panel"}},[e._v("Verify in Admin Panel")])])])]),t("li",[t("a",{attrs:{href:"#checking-roles-and-permissions"}},[e._v("Checking Roles and Permissions")]),t("ul",[t("li",[t("a",{attrs:{href:"#access-roles"}},[e._v("Access Roles")])]),t("li",[t("a",{attrs:{href:"#permission-checks"}},[e._v("Permission Checks")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Krayin's Access Control List (ACL) feature enhances security by allowing administrators to finely manage user access across different application sections. It enables precise control over permissions, ensuring users only access authorized resources and actions. By defining roles and assigning privileges based on organizational structures or responsibilities, Krayin's ACL strengthens governance, safeguards sensitive data, and ensures compliance with policies. This capability supports a secure and customizable user experience, adapting permissions dynamically to meet evolving organizational needs, thereby enhancing operational efficiency.")]),e._v(" "),t("h2",{attrs:{id:"directory-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[e._v("#")]),e._v(" Directory Structure")]),e._v(" "),t("p",[e._v("To configure Access Control List (ACL) settings in Krayin, follow these structured steps:")]),e._v(" "),t("h3",{attrs:{id:"create-configuration-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-file"}},[e._v("#")]),e._v(" Create Configuration File")]),e._v(" "),t("p",[e._v("Begin by creating a new file named "),t("code",[e._v("acl.php")]),e._v(" within the "),t("code",[e._v("Config")]),e._v(" directory of your package located at "),t("code",[e._v("packages/Webkul/Category/src/Config")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Config\n ├── acl.php\n └── ...\n")])])]),t("h3",{attrs:{id:"define-acl-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#define-acl-configuration"}},[e._v("#")]),e._v(" Define ACL Configuration")]),e._v(" "),t("p",[e._v("Inside "),t("code",[e._v("acl.php")]),e._v(", define ACL settings using an array format. Each array element represents a menu item or resource with parameters such as key, "),t("code",[e._v("name")]),e._v(", "),t("code",[e._v("route")]),e._v(", and "),t("code",[e._v("sort")]),e._v(". Here’s an example:")]),e._v(" "),t("p",[e._v("Add the following code to "),t("code",[e._v("acl.php")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'name'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'route'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category.admin.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'sort'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("2")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])])]),t("p",[e._v("In the above code, we have defined an array for each menu item with the parameters (key, name, route, and sort). You need to define the menus you want to include in the ACL here.")]),e._v(" "),t("h2",{attrs:{id:"merge-acl-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#merge-acl-configuration"}},[e._v("#")]),e._v(" Merge ACL Configuration")]),e._v(" "),t("p",[e._v("To merge the ACL configuration, follow these steps:")]),e._v(" "),t("h3",{attrs:{id:"modify-service-provider"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#modify-service-provider"}},[e._v("#")]),e._v(" Modify Service Provider")]),e._v(" "),t("p",[e._v("Navigate to the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class within the "),t("code",[e._v("Webkul\\Category\\Providers")]),e._v(" namespace.")]),e._v(" "),t("h3",{attrs:{id:"register-method"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#register-method"}},[e._v("#")]),e._v(" Register Method")]),e._v(" "),t("p",[e._v("Inside the "),t("code",[e._v("register")]),e._v(" method of your service provider, use the mergeConfigFrom method to merge your ACL configuration file:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[e._v(" "),t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("mergeConfigFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dirname")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("__DIR__")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(".")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'/Config/acl.php'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'acl'")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("p",[e._v("Ensure that the path specified in mergeConfigFrom matches the location of your acl.php file.")]),e._v(" "),t("p",[e._v("This will merge the ACL configuration with the existing configuration.")]),e._v(" "),t("h3",{attrs:{id:"clear-configuration-cache"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#clear-configuration-cache"}},[e._v("#")]),e._v(" Clear Configuration Cache")]),e._v(" "),t("p",[e._v("After making changes, clear the configuration cache to apply the latest ACL configuration:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan optimize\n")])])]),t("h3",{attrs:{id:"verify-in-admin-panel"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#verify-in-admin-panel"}},[e._v("#")]),e._v(" Verify in Admin Panel")]),e._v(" "),t("p",[e._v("Check the updated ACL configuration within the admin panel to confirm that menu items are correctly displayed and sorted according to your configuration.")]),e._v(" "),t("p",[e._v("This will ensure that the latest ACL configuration is used.")]),e._v(" "),t("h2",{attrs:{id:"checking-roles-and-permissions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#checking-roles-and-permissions"}},[e._v("#")]),e._v(" Checking Roles and Permissions")]),e._v(" "),t("p",[e._v("To manage roles and permissions effectively:")]),e._v(" "),t("h3",{attrs:{id:"access-roles"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-roles"}},[e._v("#")]),e._v(" Access Roles")]),e._v(" "),t("p",[e._v("In the Admin model located in "),t("code",[e._v("Webkul\\User\\Models")]),e._v(", utilize the relationship with the Role model to manage "),t("code",[e._v("roles")]),e._v(" associated with users.")]),e._v(" "),t("h3",{attrs:{id:"permission-checks"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#permission-checks"}},[e._v("#")]),e._v(" Permission Checks")]),e._v(" "),t("p",[e._v("Use the "),t("code",[e._v("bouncer()")]),e._v(" helper function to verify if a user has specific permissions. Example usage:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("bouncer")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("hasPermission")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$permission")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),t("p",[e._v("Replace "),t("code",[e._v("$permission")]),e._v(" with the actual permission you want to check.")]),e._v(" "),t("p",[e._v("By following these steps, you can seamlessly configure and manage Access Control List (ACL) settings in Krayin, ensuring secure and controlled access to administrative functionalities.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/125.7f3b45f6.js b/assets/js/125.467e2c39.js similarity index 99% rename from assets/js/125.7f3b45f6.js rename to assets/js/125.467e2c39.js index 75ef36a..180c1b1 100644 --- a/assets/js/125.7f3b45f6.js +++ b/assets/js/125.467e2c39.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[125],{424:function(a,t,s){"use strict";s.r(t);var n=s(10),e=Object(n.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#migrations"}},[a._v("#")]),a._v(" Migrations")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[a._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[a._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#loading-migration-from-package"}},[a._v("Loading Migration from Package")])]),t("li",[t("a",{attrs:{href:"#creating-tables-from-migrations"}},[a._v("Creating Tables from Migrations")])])])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),t("p",[a._v("Migrations are like version control for your database, allowing your team to define and share the application's database schema definition.")]),a._v(" "),t("p",[a._v("Krayin leverages the Laravel Schema facade to offer database-agnostic support for creating and manipulating tables across various database systems supported by Laravel. Migrations in Krayin utilize this powerful feature to manage database schema changes efficiently.")]),a._v(" "),t("p",[a._v("To understand Migrations in detail, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/10.x/migrations",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),t("OutboundLink")],1),a._v(".")]),a._v(" "),t("p",[a._v("Let's create a new migration file for your application. We will assume that the package name is \""),t("strong",[a._v("Category")]),a._v('". Follow these steps:')]),a._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[a._v("#")]),a._v(" Using Krayin Package Generator")]),a._v(" "),t("p",[a._v("This command creates a new migration class in the "),t("strong",[t("code",[a._v("packages/Webkul/Category/src/Database/Migrations")])]),a._v(" directory.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan package:make-migration CreateCategoryTable Webkul/Category\n")])])]),t("ul",[t("li",[t("code",[a._v("CreateCategoryTable")]),a._v(" Specifies the name of the migration file.")]),a._v(" "),t("li",[t("code",[a._v("Webkul/Category")]),a._v(" Specifies the package name")])]),a._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[a._v("#")]),a._v(" Using Laravel Artisan Command")]),a._v(" "),t("p",[a._v("Create a "),t("code",[a._v("Database")]),a._v(" directory in the "),t("code",[a._v("packages/Webkul/Category/src")]),a._v(" path. Inside the "),t("code",[a._v("Database")]),a._v(" directory, create "),t("code",[a._v("Migrations")]),a._v(" and "),t("code",[a._v("Seeders")]),a._v(" directories.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Database\n ├── Migrations\n └── Seeders\n")])])]),t("p",[a._v("Run the following command with the "),t("code",[a._v("--path")]),a._v(" option to specify where your migration file will be placed.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan make:migration create_categories_table "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("packages/Webkul/Category/src/Database/Migrations\n")])])]),t("p",[a._v("To create a new database table Copy the code provided here and paste it into your migration file. The create method used on the Schema facade. The create method accepts two arguments: the first is the name of the table, while the second is a closure which receives a Blueprint object that may be used to define the new table:")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("integer")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'parent_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token keyword type-declaration"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("longText")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'description'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("tinyInteger")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("default")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("timestamps")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/**\n * Reverse the migrations.\n *\n * @return void\n */")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("function")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[a._v("down")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[a._v("Schema")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("dropIfExists")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),t("h3",{attrs:{id:"loading-migration-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#loading-migration-from-package"}},[a._v("#")]),a._v(" Loading Migration from Package")]),a._v(" "),t("p",[a._v("We need to add the migrations to our service provider to load them.")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadMigrationsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Database/Migrations'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),t("h3",{attrs:{id:"creating-tables-from-migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-tables-from-migrations"}},[a._v("#")]),a._v(" Creating Tables from Migrations")]),a._v(" "),t("p",[a._v("Run the following command to create the "),t("strong",[t("code",[a._v("Category")])]),a._v(" table in your database.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("php artisan migrate\n")])])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[125],{423:function(a,t,s){"use strict";s.r(t);var n=s(10),e=Object(n.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#migrations"}},[a._v("#")]),a._v(" Migrations")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[a._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[a._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#loading-migration-from-package"}},[a._v("Loading Migration from Package")])]),t("li",[t("a",{attrs:{href:"#creating-tables-from-migrations"}},[a._v("Creating Tables from Migrations")])])])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),t("p",[a._v("Migrations are like version control for your database, allowing your team to define and share the application's database schema definition.")]),a._v(" "),t("p",[a._v("Krayin leverages the Laravel Schema facade to offer database-agnostic support for creating and manipulating tables across various database systems supported by Laravel. Migrations in Krayin utilize this powerful feature to manage database schema changes efficiently.")]),a._v(" "),t("p",[a._v("To understand Migrations in detail, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/10.x/migrations",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),t("OutboundLink")],1),a._v(".")]),a._v(" "),t("p",[a._v("Let's create a new migration file for your application. We will assume that the package name is \""),t("strong",[a._v("Category")]),a._v('". Follow these steps:')]),a._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[a._v("#")]),a._v(" Using Krayin Package Generator")]),a._v(" "),t("p",[a._v("This command creates a new migration class in the "),t("strong",[t("code",[a._v("packages/Webkul/Category/src/Database/Migrations")])]),a._v(" directory.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan package:make-migration CreateCategoryTable Webkul/Category\n")])])]),t("ul",[t("li",[t("code",[a._v("CreateCategoryTable")]),a._v(" Specifies the name of the migration file.")]),a._v(" "),t("li",[t("code",[a._v("Webkul/Category")]),a._v(" Specifies the package name")])]),a._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[a._v("#")]),a._v(" Using Laravel Artisan Command")]),a._v(" "),t("p",[a._v("Create a "),t("code",[a._v("Database")]),a._v(" directory in the "),t("code",[a._v("packages/Webkul/Category/src")]),a._v(" path. Inside the "),t("code",[a._v("Database")]),a._v(" directory, create "),t("code",[a._v("Migrations")]),a._v(" and "),t("code",[a._v("Seeders")]),a._v(" directories.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Database\n ├── Migrations\n └── Seeders\n")])])]),t("p",[a._v("Run the following command with the "),t("code",[a._v("--path")]),a._v(" option to specify where your migration file will be placed.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan make:migration create_categories_table "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("packages/Webkul/Category/src/Database/Migrations\n")])])]),t("p",[a._v("To create a new database table Copy the code provided here and paste it into your migration file. The create method used on the Schema facade. The create method accepts two arguments: the first is the name of the table, while the second is a closure which receives a Blueprint object that may be used to define the new table:")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("integer")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'parent_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token keyword type-declaration"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("longText")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'description'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("tinyInteger")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("default")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("timestamps")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/**\n * Reverse the migrations.\n *\n * @return void\n */")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("function")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[a._v("down")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[a._v("Schema")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("dropIfExists")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),t("h3",{attrs:{id:"loading-migration-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#loading-migration-from-package"}},[a._v("#")]),a._v(" Loading Migration from Package")]),a._v(" "),t("p",[a._v("We need to add the migrations to our service provider to load them.")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadMigrationsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Database/Migrations'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),t("h3",{attrs:{id:"creating-tables-from-migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-tables-from-migrations"}},[a._v("#")]),a._v(" Creating Tables from Migrations")]),a._v(" "),t("p",[a._v("Run the following command to create the "),t("strong",[t("code",[a._v("Category")])]),a._v(" table in your database.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("php artisan migrate\n")])])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/126.aaf2e112.js b/assets/js/126.59293cc7.js similarity index 99% rename from assets/js/126.aaf2e112.js rename to assets/js/126.59293cc7.js index d212f2b..8dc9b2f 100644 --- a/assets/js/126.aaf2e112.js +++ b/assets/js/126.59293cc7.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[126],{425:function(e,t,a){"use strict";a.r(t);var s=a(10),n=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#models"}},[e._v("#")]),e._v(" Models")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[e._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[e._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#create-the-contract"}},[e._v("Create the Contract")])]),t("li",[t("a",{attrs:{href:"#create-the-proxy"}},[e._v("Create the Proxy")])]),t("li",[t("a",{attrs:{href:"#create-the-model"}},[e._v("Create the Model")])]),t("li",[t("a",{attrs:{href:"#create-module-service-provider"}},[e._v("Create Module Service Provider")])]),t("li",[t("a",{attrs:{href:"#registering-moduleserviceprovider"}},[e._v("Registering ModuleServiceProvider")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v('Laravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using Eloquent, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.\nTo understand Models in detail, you can visit the Laravel documentation '),t("a",{attrs:{href:"https://laravel.com/docs/10.x/eloquent",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We are using the "),t("a",{attrs:{href:"https://packagist.org/packages/konekt/concord",target:"_blank",rel:"noopener noreferrer"}},[e._v("konekt/concord"),t("OutboundLink")],1),e._v(" package, which is an extension of Laravel. It helps in building modular Laravel applications.")]),e._v(" "),t("p",[e._v("Let's create a new model for your application. We will assume that the package name is \""),t("strong",[e._v("Category")]),e._v('". Follow these steps:')]),e._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[e._v("#")]),e._v(" Using Krayin Package Generator")]),e._v(" "),t("p",[e._v("To create a new "),t("code",[e._v("Category")]),e._v(" Model inside your package using the Krayin Package Generator, follow these steps")]),e._v(" "),t("p",[e._v("Execute the following command in your terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-model Category Webkul/Category\n")])])]),t("p",[e._v("This command creates the following files:")]),e._v(" "),t("ul",[t("li",[e._v("New model "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model proxy "),t("strong",[t("code",[e._v("CategoryProxy.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model contract "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Contracts")])]),e._v(" directory.")])]),e._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[e._v("#")]),e._v(" Using Laravel Artisan Command")]),e._v(" "),t("p",[e._v("Before creating the model class, it's essential to create two additional components: the "),t("code",[e._v("Contract")]),e._v(" and the "),t("code",[e._v("Proxy")]),e._v(".")]),e._v(" "),t("h3",{attrs:{id:"create-the-contract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-contract"}},[e._v("#")]),e._v(" Create the Contract")]),e._v(" "),t("p",[e._v("Laravel's Contracts are a set of interfaces that define the core services provided by the framework. For example, the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Queue\\Queue")])]),e._v(" contract defines the methods needed for queueing jobs, while the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Mail\\Mailer")])]),e._v(" contract defines the methods needed for sending an email.")]),e._v(" "),t("p",[e._v("Each contract has a corresponding implementation provided by the framework. For example, Laravel provides a queue implementation with various drivers and a mailer implementation powered by SwiftMailer.")]),e._v(" "),t("p",[e._v("All Laravel contracts are stored in their own GitHub repository. This provides a quick reference for all available contracts and a single, decoupled package that can be used by package developers.")]),e._v(" "),t("p",[e._v("Now, create a directory named "),t("strong",[t("code",[e._v("Contracts")])]),e._v(" inside "),t("strong",[t("code",[e._v("Webkul/Category/src/")])]),e._v(" and create an interface file named "),t("strong",[t("code",[e._v("Category.php")])]),e._v(".")]),e._v(" "),t("div",{staticClass:"language-structure extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("packages\n└── Webkul\n └── Category\n └── src\n └── Contracts\n └── Category.php\n")])])]),t("p",[e._v("Copy the following code into the "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" file.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// Other service providers")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Category"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Providers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("ModuleServiceProvider")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[126],{426:function(e,t,a){"use strict";a.r(t);var s=a(10),n=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#models"}},[e._v("#")]),e._v(" Models")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[e._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[e._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#create-the-contract"}},[e._v("Create the Contract")])]),t("li",[t("a",{attrs:{href:"#create-the-proxy"}},[e._v("Create the Proxy")])]),t("li",[t("a",{attrs:{href:"#create-the-model"}},[e._v("Create the Model")])]),t("li",[t("a",{attrs:{href:"#create-module-service-provider"}},[e._v("Create Module Service Provider")])]),t("li",[t("a",{attrs:{href:"#registering-moduleserviceprovider"}},[e._v("Registering ModuleServiceProvider")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v('Laravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using Eloquent, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.\nTo understand Models in detail, you can visit the Laravel documentation '),t("a",{attrs:{href:"https://laravel.com/docs/10.x/eloquent",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We are using the "),t("a",{attrs:{href:"https://packagist.org/packages/konekt/concord",target:"_blank",rel:"noopener noreferrer"}},[e._v("konekt/concord"),t("OutboundLink")],1),e._v(" package, which is an extension of Laravel. It helps in building modular Laravel applications.")]),e._v(" "),t("p",[e._v("Let's create a new model for your application. We will assume that the package name is \""),t("strong",[e._v("Category")]),e._v('". Follow these steps:')]),e._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[e._v("#")]),e._v(" Using Krayin Package Generator")]),e._v(" "),t("p",[e._v("To create a new "),t("code",[e._v("Category")]),e._v(" Model inside your package using the Krayin Package Generator, follow these steps")]),e._v(" "),t("p",[e._v("Execute the following command in your terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-model Category Webkul/Category\n")])])]),t("p",[e._v("This command creates the following files:")]),e._v(" "),t("ul",[t("li",[e._v("New model "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model proxy "),t("strong",[t("code",[e._v("CategoryProxy.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model contract "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Contracts")])]),e._v(" directory.")])]),e._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[e._v("#")]),e._v(" Using Laravel Artisan Command")]),e._v(" "),t("p",[e._v("Before creating the model class, it's essential to create two additional components: the "),t("code",[e._v("Contract")]),e._v(" and the "),t("code",[e._v("Proxy")]),e._v(".")]),e._v(" "),t("h3",{attrs:{id:"create-the-contract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-contract"}},[e._v("#")]),e._v(" Create the Contract")]),e._v(" "),t("p",[e._v("Laravel's Contracts are a set of interfaces that define the core services provided by the framework. For example, the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Queue\\Queue")])]),e._v(" contract defines the methods needed for queueing jobs, while the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Mail\\Mailer")])]),e._v(" contract defines the methods needed for sending an email.")]),e._v(" "),t("p",[e._v("Each contract has a corresponding implementation provided by the framework. For example, Laravel provides a queue implementation with various drivers and a mailer implementation powered by SwiftMailer.")]),e._v(" "),t("p",[e._v("All Laravel contracts are stored in their own GitHub repository. This provides a quick reference for all available contracts and a single, decoupled package that can be used by package developers.")]),e._v(" "),t("p",[e._v("Now, create a directory named "),t("strong",[t("code",[e._v("Contracts")])]),e._v(" inside "),t("strong",[t("code",[e._v("Webkul/Category/src/")])]),e._v(" and create an interface file named "),t("strong",[t("code",[e._v("Category.php")])]),e._v(".")]),e._v(" "),t("div",{staticClass:"language-structure extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("packages\n└── Webkul\n └── Category\n └── src\n └── Contracts\n └── Category.php\n")])])]),t("p",[e._v("Copy the following code into the "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" file.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// Other service providers")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Category"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Providers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("ModuleServiceProvider")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/128.fa93a2fc.js b/assets/js/128.2273311e.js similarity index 99% rename from assets/js/128.fa93a2fc.js rename to assets/js/128.2273311e.js index 442ab26..3d4e965 100644 --- a/assets/js/128.fa93a2fc.js +++ b/assets/js/128.2273311e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[128],{426:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#datagrid"}},[t._v("#")]),t._v(" DataGrid")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#global-properties-of-datagrid"}},[t._v("Global Properties of DataGrid")])]),s("li",[s("a",{attrs:{href:"#how-datagrid-works"}},[t._v("How DataGrid Works")])]),s("li",[s("a",{attrs:{href:"#multiple-datagrids"}},[t._v("Multiple DataGrids")]),s("ul",[s("li",[s("a",{attrs:{href:"#datagrid-to-json"}},[t._v("DataGrid to JSON")])]),s("li",[s("a",{attrs:{href:"#render-datagrid"}},[t._v("Render DataGrid")])])])]),s("li",[s("a",{attrs:{href:"#sample-datagrid"}},[t._v("Sample DataGrid")])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("A DataGrid is a concept of displaying your database records in a tabular format. It is a powerful tool that helps you present large amounts of data in an organized way. At Krayin, we have implemented this feature, which allows you to use it to display data in a tabular format or write code from scratch to display data. In addition to the basic functionality of DataGrid, we have also implemented additional features such as sorting, filtering, and mass action, which are explained in detail below.")]),t._v(" "),s("h2",{attrs:{id:"global-properties-of-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#global-properties-of-datagrid"}},[t._v("#")]),t._v(" Global Properties of DataGrid")]),t._v(" "),s("p",[t._v("Here are the global properties of the DataGrid:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Property")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("index")])])]),t._v(" "),s("td",[t._v("This property is defined in the grid, and the value assigned to this property must be unique, typically the primary key, so that data will be uniquely identified and operations performed will be based on your index value.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("sortOrder")])])]),t._v(" "),s("td",[t._v("The "),s("strong",[s("code",[t._v("sortOrder")])]),t._v(" key is used to arrange the results in ascending or descending order. Set the "),s("strong",[s("code",[t._v("sortOrder")])]),t._v(" variable to "),s("strong",[s("code",[t._v("asc")])]),t._v(" or "),s("strong",[s("code",[t._v("desc")])]),t._v(".")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("queryBuilder")])])]),t._v(" "),s("td",[t._v("This is used to perform database operations in your application.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableMassAction")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable the mass action in DataGrid.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableAction")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable the action column of DataGrid.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("paginate")])])]),t._v(" "),s("td",[t._v("Set the "),s("strong",[s("code",[t._v("paginate")])]),t._v(" property to "),s("strong",[s("code",[t._v("true")])]),t._v(" to allow pagination on your page.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("itemsPerPage")])])]),t._v(" "),s("td",[t._v("The "),s("strong",[s("code",[t._v("itemsPerPage")])]),t._v(" key is used to display the number of items per page.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableFilterMap")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable filtering on the basis of columns.")])])])]),t._v(" "),s("h2",{attrs:{id:"how-datagrid-works"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#how-datagrid-works"}},[t._v("#")]),t._v(" How DataGrid Works")]),t._v(" "),s("p",[t._v("The "),s("strong",[s("code",[t._v("DataGrid")])]),t._v(" abstract class is created in the "),s("strong",[s("code",[t._v("Webkul\\Ui")])]),t._v(" package. In the abstract class, a list of properties and methods are declared. To create your own DataGrid, you need to extend the "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\DataGrid")])]),t._v(" abstract class.")]),t._v(" "),s("p",[t._v("In "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\DataGrid.php")])]),t._v(" abstract class, two abstract methods are declared "),s("strong",[s("code",[t._v("prepareQueryBuilder()")])]),t._v(" and "),s("strong",[s("code",[t._v("addColumns()")])]),t._v(". You can prepare your grid by defining these two methods.")]),t._v(" "),s("ul",[s("li",[s("p",[s("strong",[s("code",[t._v("prepareQueryBuilder()")])]),t._v(": In this method, records are retrieved through queries applicable to the database and stored in a collection. When records are retrieved, the "),s("strong",[s("code",[t._v("setQueryBuilder()")])]),t._v(" method is called.")])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("setQueryBuilder()")])]),t._v(": This method is used for setting the "),s("strong",[s("code",[t._v("$queryBuilder")])]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("DB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("table")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addSelect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addFilter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("addColumns()")])]),t._v(": In this method, columns are created which are displayed in the grid. The parameter accepts an array in key-value pairs. Some of the essential keys are described below:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("index")])])]),t._v(" "),s("td",[t._v("This key is defined in the grid, and the value assigned to this key must be unique, typically the primary key, so that data will be uniquely identified and operations performed will be based on your index value.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("label")])])]),t._v(" "),s("td",[t._v("This key defines the name of the column.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("type")])])]),t._v(" "),s("td",[t._v("This key accepts the type of data in the column.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("searchable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column searchable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("sortable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column sortable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("filterable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column filterable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("wrapper")])])]),t._v(" "),s("td",[t._v("Perform actions based on a condition satisfied or apply some customization to the value.")])])])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("addColumns")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::app.admin.datagrid.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'number'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'searchable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'filterable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("prepareActions()")])]),t._v(": This method is defined when there is a need to perform any action such as edit or delete on the grid. In this method, the "),s("strong",[s("code",[t._v("addAction()")])]),t._v(" method is called to define a particular action.")])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("addAction()")])]),t._v(": This method is used for adding actions (like "),s("strong",[s("code",[t._v("edit")])]),t._v(", "),s("strong",[s("code",[t._v("delete")])]),t._v(", etc.) to each row generated by the DataGrid.")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("title")])])]),t._v(" "),s("td",[t._v("The text to be displayed is written here.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("method")])])]),t._v(" "),s("td",[t._v("HTTP methods are declared.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("route")])])]),t._v(" "),s("td",[t._v("This key accepts the route of the icon.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("icon")])])]),t._v(" "),s("td",[t._v("Class of the icon to be displayed in the action column. You may prefer text also.")])])])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareActions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::app.admin.datagrid.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'GET'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.category.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon pencil-lg-icon'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h2",{attrs:{id:"multiple-datagrids"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#multiple-datagrids"}},[t._v("#")]),t._v(" Multiple DataGrids")]),t._v(" "),s("p",[t._v("When working with multiple DataGrids, the default DataGrid implementation can handle only a single request at a time. This means that operations such as filtration, sorting, and others can conflict when implementing multiple DataGrids. To overcome this, we provide a trait called "),s("strong",[s("code",[t._v("ProvideDataGridPlus")])]),t._v(" in the namespace "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\Traits")])]),t._v(".")]),t._v(" "),s("p",[t._v("Follow the steps below to implement multiple DataGrids:")]),t._v(" "),s("ol",[s("li",[s("p",[t._v("Create a directory called "),s("strong",[s("code",[t._v("DataGrids")])]),t._v(" inside the "),s("strong",[s("code",[t._v("src")])]),t._v(" directory of your package. Within the "),s("strong",[s("code",[t._v("DataGrids")])]),t._v(" directory, create a file called "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(" that extends the "),s("strong",[s("code",[t._v("DataGrid")])]),t._v(" class from the "),s("strong",[s("code",[t._v("Webkul\\Ui")])]),t._v(" package. The directory structure will be as follows:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── DataGrids\n └── CategoryDataGrid.php\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Add the following code to your DataGrid file, i.e., "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Ui"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrid")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryDataGrid")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataGrid")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"datagrid-to-json"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#datagrid-to-json"}},[t._v("#")]),t._v(" DataGrid to JSON")]),t._v(" "),s("ol",{attrs:{start:"3"}},[s("li",[s("p",[t._v("Import the "),s("strong",[s("code",[t._v("ProvideDataGridPlus")])]),t._v(" trait into the "),s("strong",[s("code",[t._v("CategoryDataGrid")])]),t._v(" class:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Admin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Traits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("ProvideDropdownOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryDataGrid")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataGrid")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("ProvideDropdownOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("After that, the "),s("strong",[s("code",[t._v("toJson()")])]),t._v(" method will be available in the DataGrid instance, which provides data to the component.")])]),t._v(" "),s("li",[s("p",[t._v("Now, go to "),s("strong",[s("code",[t._v("Admin/CategoryController.php")])]),t._v(" and locate the "),s("strong",[s("code",[t._v("index")])]),t._v(" method. Use the "),s("strong",[s("code",[t._v("toJson()")])]),t._v(" method as follows:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryDataGrid")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryController")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Controller")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Display a listing of the resource.\n *\n * @return \\Illuminate\\View\\View\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("index")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("request")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ajax")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("app")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryDataGrid")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toJson")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::admin.index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"render-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#render-datagrid"}},[t._v("#")]),t._v(" Render DataGrid")]),t._v(" "),s("ol",{attrs:{start:"6"}},[s("li",[s("p",[t._v("In the view file "),s("strong",[s("code",[t._v("views/admin/index.blade.php")])]),t._v(", use the "),s("strong",[s("code",[t._v("table-component")])]),t._v(" component and specify the URL from which it will load the JSON data:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("@"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("section")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'content-wrapper'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("div "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"content full-page"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("component data"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ route('admin.categories.index') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("template v"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("header"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("h1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view_render_event")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.products.index.header.before'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Breadcrumbs")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("render")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Category'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view_render_event")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.products.index.header.after'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("h1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("template v"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("action"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("a href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ route('admin.categories.create') }}\"")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"btn btn-md btn-primary"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Create Category'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("component"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("div"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n@stop\n")])])]),s("p",[t._v("With these steps, your DataGrid is now ready to be used.")])])]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("Make sure to copy the sample code provided below to your own "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(" file, as we have already included all the necessary methods and functions there. This code can be used later as an example for your implementation.")])]),t._v(" "),s("h2",{attrs:{id:"sample-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sample-datagrid"}},[t._v("#")]),t._v(" Sample DataGrid")]),t._v(" "),s("p",[t._v("Here's an improved version of the provided DataGrid sample:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addSelect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addFilter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Add columns.\n *\n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("addColumns")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Prepare actions.\n *\n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareActions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'GET'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.categories.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'pencil-icon'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'DELETE'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.categories.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'confirm_text'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.massaction.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'resource'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'user'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'trash-icon'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[128],{425:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#datagrid"}},[t._v("#")]),t._v(" DataGrid")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#global-properties-of-datagrid"}},[t._v("Global Properties of DataGrid")])]),s("li",[s("a",{attrs:{href:"#how-datagrid-works"}},[t._v("How DataGrid Works")])]),s("li",[s("a",{attrs:{href:"#multiple-datagrids"}},[t._v("Multiple DataGrids")]),s("ul",[s("li",[s("a",{attrs:{href:"#datagrid-to-json"}},[t._v("DataGrid to JSON")])]),s("li",[s("a",{attrs:{href:"#render-datagrid"}},[t._v("Render DataGrid")])])])]),s("li",[s("a",{attrs:{href:"#sample-datagrid"}},[t._v("Sample DataGrid")])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("A DataGrid is a concept of displaying your database records in a tabular format. It is a powerful tool that helps you present large amounts of data in an organized way. At Krayin, we have implemented this feature, which allows you to use it to display data in a tabular format or write code from scratch to display data. In addition to the basic functionality of DataGrid, we have also implemented additional features such as sorting, filtering, and mass action, which are explained in detail below.")]),t._v(" "),s("h2",{attrs:{id:"global-properties-of-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#global-properties-of-datagrid"}},[t._v("#")]),t._v(" Global Properties of DataGrid")]),t._v(" "),s("p",[t._v("Here are the global properties of the DataGrid:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Property")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("index")])])]),t._v(" "),s("td",[t._v("This property is defined in the grid, and the value assigned to this property must be unique, typically the primary key, so that data will be uniquely identified and operations performed will be based on your index value.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("sortOrder")])])]),t._v(" "),s("td",[t._v("The "),s("strong",[s("code",[t._v("sortOrder")])]),t._v(" key is used to arrange the results in ascending or descending order. Set the "),s("strong",[s("code",[t._v("sortOrder")])]),t._v(" variable to "),s("strong",[s("code",[t._v("asc")])]),t._v(" or "),s("strong",[s("code",[t._v("desc")])]),t._v(".")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("queryBuilder")])])]),t._v(" "),s("td",[t._v("This is used to perform database operations in your application.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableMassAction")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable the mass action in DataGrid.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableAction")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable the action column of DataGrid.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("paginate")])])]),t._v(" "),s("td",[t._v("Set the "),s("strong",[s("code",[t._v("paginate")])]),t._v(" property to "),s("strong",[s("code",[t._v("true")])]),t._v(" to allow pagination on your page.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("itemsPerPage")])])]),t._v(" "),s("td",[t._v("The "),s("strong",[s("code",[t._v("itemsPerPage")])]),t._v(" key is used to display the number of items per page.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableFilterMap")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable filtering on the basis of columns.")])])])]),t._v(" "),s("h2",{attrs:{id:"how-datagrid-works"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#how-datagrid-works"}},[t._v("#")]),t._v(" How DataGrid Works")]),t._v(" "),s("p",[t._v("The "),s("strong",[s("code",[t._v("DataGrid")])]),t._v(" abstract class is created in the "),s("strong",[s("code",[t._v("Webkul\\Ui")])]),t._v(" package. In the abstract class, a list of properties and methods are declared. To create your own DataGrid, you need to extend the "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\DataGrid")])]),t._v(" abstract class.")]),t._v(" "),s("p",[t._v("In "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\DataGrid.php")])]),t._v(" abstract class, two abstract methods are declared "),s("strong",[s("code",[t._v("prepareQueryBuilder()")])]),t._v(" and "),s("strong",[s("code",[t._v("addColumns()")])]),t._v(". You can prepare your grid by defining these two methods.")]),t._v(" "),s("ul",[s("li",[s("p",[s("strong",[s("code",[t._v("prepareQueryBuilder()")])]),t._v(": In this method, records are retrieved through queries applicable to the database and stored in a collection. When records are retrieved, the "),s("strong",[s("code",[t._v("setQueryBuilder()")])]),t._v(" method is called.")])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("setQueryBuilder()")])]),t._v(": This method is used for setting the "),s("strong",[s("code",[t._v("$queryBuilder")])]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("DB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("table")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addSelect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addFilter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("addColumns()")])]),t._v(": In this method, columns are created which are displayed in the grid. The parameter accepts an array in key-value pairs. Some of the essential keys are described below:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("index")])])]),t._v(" "),s("td",[t._v("This key is defined in the grid, and the value assigned to this key must be unique, typically the primary key, so that data will be uniquely identified and operations performed will be based on your index value.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("label")])])]),t._v(" "),s("td",[t._v("This key defines the name of the column.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("type")])])]),t._v(" "),s("td",[t._v("This key accepts the type of data in the column.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("searchable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column searchable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("sortable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column sortable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("filterable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column filterable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("wrapper")])])]),t._v(" "),s("td",[t._v("Perform actions based on a condition satisfied or apply some customization to the value.")])])])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("addColumns")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::app.admin.datagrid.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'number'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'searchable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'filterable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("prepareActions()")])]),t._v(": This method is defined when there is a need to perform any action such as edit or delete on the grid. In this method, the "),s("strong",[s("code",[t._v("addAction()")])]),t._v(" method is called to define a particular action.")])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("addAction()")])]),t._v(": This method is used for adding actions (like "),s("strong",[s("code",[t._v("edit")])]),t._v(", "),s("strong",[s("code",[t._v("delete")])]),t._v(", etc.) to each row generated by the DataGrid.")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("title")])])]),t._v(" "),s("td",[t._v("The text to be displayed is written here.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("method")])])]),t._v(" "),s("td",[t._v("HTTP methods are declared.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("route")])])]),t._v(" "),s("td",[t._v("This key accepts the route of the icon.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("icon")])])]),t._v(" "),s("td",[t._v("Class of the icon to be displayed in the action column. You may prefer text also.")])])])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareActions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::app.admin.datagrid.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'GET'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.category.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon pencil-lg-icon'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h2",{attrs:{id:"multiple-datagrids"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#multiple-datagrids"}},[t._v("#")]),t._v(" Multiple DataGrids")]),t._v(" "),s("p",[t._v("When working with multiple DataGrids, the default DataGrid implementation can handle only a single request at a time. This means that operations such as filtration, sorting, and others can conflict when implementing multiple DataGrids. To overcome this, we provide a trait called "),s("strong",[s("code",[t._v("ProvideDataGridPlus")])]),t._v(" in the namespace "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\Traits")])]),t._v(".")]),t._v(" "),s("p",[t._v("Follow the steps below to implement multiple DataGrids:")]),t._v(" "),s("ol",[s("li",[s("p",[t._v("Create a directory called "),s("strong",[s("code",[t._v("DataGrids")])]),t._v(" inside the "),s("strong",[s("code",[t._v("src")])]),t._v(" directory of your package. Within the "),s("strong",[s("code",[t._v("DataGrids")])]),t._v(" directory, create a file called "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(" that extends the "),s("strong",[s("code",[t._v("DataGrid")])]),t._v(" class from the "),s("strong",[s("code",[t._v("Webkul\\Ui")])]),t._v(" package. The directory structure will be as follows:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── DataGrids\n └── CategoryDataGrid.php\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Add the following code to your DataGrid file, i.e., "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Ui"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrid")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryDataGrid")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataGrid")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"datagrid-to-json"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#datagrid-to-json"}},[t._v("#")]),t._v(" DataGrid to JSON")]),t._v(" "),s("ol",{attrs:{start:"3"}},[s("li",[s("p",[t._v("Import the "),s("strong",[s("code",[t._v("ProvideDataGridPlus")])]),t._v(" trait into the "),s("strong",[s("code",[t._v("CategoryDataGrid")])]),t._v(" class:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Admin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Traits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("ProvideDropdownOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryDataGrid")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataGrid")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("ProvideDropdownOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("After that, the "),s("strong",[s("code",[t._v("toJson()")])]),t._v(" method will be available in the DataGrid instance, which provides data to the component.")])]),t._v(" "),s("li",[s("p",[t._v("Now, go to "),s("strong",[s("code",[t._v("Admin/CategoryController.php")])]),t._v(" and locate the "),s("strong",[s("code",[t._v("index")])]),t._v(" method. Use the "),s("strong",[s("code",[t._v("toJson()")])]),t._v(" method as follows:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryDataGrid")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryController")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Controller")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Display a listing of the resource.\n *\n * @return \\Illuminate\\View\\View\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("index")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("request")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ajax")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("app")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryDataGrid")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toJson")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::admin.index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"render-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#render-datagrid"}},[t._v("#")]),t._v(" Render DataGrid")]),t._v(" "),s("ol",{attrs:{start:"6"}},[s("li",[s("p",[t._v("In the view file "),s("strong",[s("code",[t._v("views/admin/index.blade.php")])]),t._v(", use the "),s("strong",[s("code",[t._v("table-component")])]),t._v(" component and specify the URL from which it will load the JSON data:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("@"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("section")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'content-wrapper'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("div "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"content full-page"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("component data"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ route('admin.categories.index') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("template v"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("header"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("h1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view_render_event")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.products.index.header.before'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Breadcrumbs")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("render")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Category'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view_render_event")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.products.index.header.after'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("h1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("template v"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("action"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("a href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ route('admin.categories.create') }}\"")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"btn btn-md btn-primary"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Create Category'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("component"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("div"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n@stop\n")])])]),s("p",[t._v("With these steps, your DataGrid is now ready to be used.")])])]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("Make sure to copy the sample code provided below to your own "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(" file, as we have already included all the necessary methods and functions there. This code can be used later as an example for your implementation.")])]),t._v(" "),s("h2",{attrs:{id:"sample-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sample-datagrid"}},[t._v("#")]),t._v(" Sample DataGrid")]),t._v(" "),s("p",[t._v("Here's an improved version of the provided DataGrid sample:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addSelect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addFilter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Add columns.\n *\n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("addColumns")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Prepare actions.\n *\n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareActions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'GET'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.categories.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'pencil-icon'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'DELETE'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.categories.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'confirm_text'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.massaction.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'resource'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'user'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'trash-icon'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/129.b9e06943.js b/assets/js/129.a9d67c77.js similarity index 98% rename from assets/js/129.b9e06943.js rename to assets/js/129.a9d67c77.js index ef8c54a..e4a56fb 100644 --- a/assets/js/129.b9e06943.js +++ b/assets/js/129.a9d67c77.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[129],{427:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"layouts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#layouts"}},[t._v("#")]),t._v(" Layouts")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#category-layout"}},[t._v("Category Layout")])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Layouts in Krayin are fundamental to structuring your application's views in a consistent and reusable way. They provide a template for rendering HTML across multiple pages, ensuring a unified design and user experience. By defining layouts, you can streamline development, improve maintainability, and enhance the overall aesthetics of your web application.")]),t._v(" "),a("p",[t._v("To learn in detail about Layouts, you can visit the Laravel documentation "),a("a",{attrs:{href:"https://laravel.com/docs/11.x/blade",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"category-layout"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#category-layout"}},[t._v("#")]),t._v(" Category Layout")]),t._v(" "),a("p",[a("code",[t._v("@extends('category::layouts.master')")]),t._v(" This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit".')]),t._v(" "),a("p",[t._v("To extend the default layout of the Krayin admin panel, you'll create or modify the "),a("code",[t._v("index.blade.php")]),t._v(" file located at "),a("code",[t._v("packages/Webkul/Category/src/Resources/views/admin/index.blade.php")]),t._v(". Below is a detailed breakdown of how to integrate and customize the layout:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[t._v("@extends('category::layouts.master')\n\n@push('css')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token style"}},[a("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* */")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n\n@section('page_title')\n {{ __('category::categories.index.title') }}\n@endsection\n\n@section('content-wrapper')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("content full-page"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- --\x3e")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endsection\n\n@push('scripts')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token script"}},[a("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Prop Name")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("strong",[a("code",[t._v("@extends('category::layouts.master')")])])]),t._v(" "),a("td",[t._v("This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit"')])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('page_title')")])])]),t._v(" "),a("td",[t._v("This is used to define the title of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('content-wrapper')")])])]),t._v(" "),a("td",[t._v("This is used to define the body of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('css')")])])]),t._v(" "),a("td",[t._v("This is used to add additional css.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('scripts')")])])]),t._v(" "),a("td",[t._v("This is used to add additional javascript.")])])])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in "),a("strong",[a("code",[t._v("lang/app.php")])]),t._v(".")])]),t._v(" "),a("p",[t._v("If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside "),a("code",[t._v("Resources\\Views\\Layouts\\master.blade.php")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[129],{429:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"layouts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#layouts"}},[t._v("#")]),t._v(" Layouts")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#category-layout"}},[t._v("Category Layout")])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Layouts in Krayin are fundamental to structuring your application's views in a consistent and reusable way. They provide a template for rendering HTML across multiple pages, ensuring a unified design and user experience. By defining layouts, you can streamline development, improve maintainability, and enhance the overall aesthetics of your web application.")]),t._v(" "),a("p",[t._v("To learn in detail about Layouts, you can visit the Laravel documentation "),a("a",{attrs:{href:"https://laravel.com/docs/11.x/blade",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"category-layout"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#category-layout"}},[t._v("#")]),t._v(" Category Layout")]),t._v(" "),a("p",[a("code",[t._v("@extends('category::layouts.master')")]),t._v(" This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit".')]),t._v(" "),a("p",[t._v("To extend the default layout of the Krayin admin panel, you'll create or modify the "),a("code",[t._v("index.blade.php")]),t._v(" file located at "),a("code",[t._v("packages/Webkul/Category/src/Resources/views/admin/index.blade.php")]),t._v(". Below is a detailed breakdown of how to integrate and customize the layout:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[t._v("@extends('category::layouts.master')\n\n@push('css')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token style"}},[a("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* */")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n\n@section('page_title')\n {{ __('category::categories.index.title') }}\n@endsection\n\n@section('content-wrapper')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("content full-page"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- --\x3e")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endsection\n\n@push('scripts')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token script"}},[a("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Prop Name")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("strong",[a("code",[t._v("@extends('category::layouts.master')")])])]),t._v(" "),a("td",[t._v("This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit"')])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('page_title')")])])]),t._v(" "),a("td",[t._v("This is used to define the title of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('content-wrapper')")])])]),t._v(" "),a("td",[t._v("This is used to define the body of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('css')")])])]),t._v(" "),a("td",[t._v("This is used to add additional css.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('scripts')")])])]),t._v(" "),a("td",[t._v("This is used to add additional javascript.")])])])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in "),a("strong",[a("code",[t._v("lang/app.php")])]),t._v(".")])]),t._v(" "),a("p",[t._v("If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside "),a("code",[t._v("Resources\\Views\\Layouts\\master.blade.php")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/130.7de71edb.js b/assets/js/130.ce891b0c.js similarity index 99% rename from assets/js/130.7de71edb.js rename to assets/js/130.ce891b0c.js index 63d4b25..1e7a129 100644 --- a/assets/js/130.7de71edb.js +++ b/assets/js/130.ce891b0c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[130],{430:function(a,e,t){"use strict";t.r(e);var s=t(10),n=Object(s.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"localization"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#localization"}},[a._v("#")]),a._v(" Localization")]),a._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#publishing-the-language-files"}},[a._v("Publishing the Language Files")])]),e("li",[e("a",{attrs:{href:"#configuring-the-locale"}},[a._v("Configuring the Locale")])]),e("li",[e("a",{attrs:{href:"#create-a-new-locale"}},[a._v("Create a new Locale")]),e("ul",[e("li",[e("a",{attrs:{href:"#directory-structure"}},[a._v("Directory Structure")])]),e("li",[e("a",{attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("Writing a Translation in app.php")])])])]),e("li",[e("a",{attrs:{href:"#load-translation-from-package"}},[a._v("Load Translation from Package")]),e("ul",[e("li",[e("a",{attrs:{href:"#update-the-service-provider"}},[a._v("Update the Service Provider")])]),e("li",[e("a",{attrs:{href:"#use-translations-in-blade-files"}},[a._v("Use Translations in Blade Files")])])])])])]),e("p"),a._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),e("p",[a._v("Laravel's localization features provide a convenient way to retrieve strings in various languages, allowing you to easily support multiple languages within your application.")]),a._v(" "),e("p",[a._v("Language strings may be stored in files within the application's lang directory. Within this directory, there may be subdirectories for each language supported by the application. This is the approach Laravel uses to manage translation strings for built-in Laravel features such as validation error messages:")]),a._v(" "),e("p",[a._v("To learn in detail about Localization, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/localization",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),e("OutboundLink")],1),a._v(".")]),a._v(" "),e("h2",{attrs:{id:"publishing-the-language-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#publishing-the-language-files"}},[a._v("#")]),a._v(" Publishing the Language Files")]),a._v(" "),e("p",[a._v("By default, the Laravel application skeleton does not include the lang directory. If you would like to customize Laravel's language files or create your own, you should scaffold the lang directory via the lang:publish Artisan command. The lang:publish command will create the lang directory in your application and publish the default set of language files used by Laravel:")]),a._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[a._v("php artisan lang:publish\n")])])]),e("h2",{attrs:{id:"configuring-the-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configuring-the-locale"}},[a._v("#")]),a._v(" Configuring the Locale")]),a._v(" "),e("p",[a._v("The default language for your application is stored in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file's "),e("code",[a._v("locale")]),a._v(" configuration option, which is typically set using the "),e("code",[a._v("APP_LOCALE")]),a._v(" environment variable. You are free to modify this value to suit the needs of your application.")]),a._v(" "),e("p",[a._v("You may also configure a "),e("code",[a._v('"fallback language"')]),a._v(", which will be used when the default language does not contain a given translation string. Like the default language, the fallback language is also configured in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file, and its value is typically set using the APP_FALLBACK_LOCALE environment variable.")]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[a._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Locale Configuration\n |--------------------------------------------------------------------------\n |\n | The application locale determines the default locale that will be used\n | by the translation service provider. You are free to set this value\n | to any of the locales which will be supported by the application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("env")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'APP_LOCALE'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Fallback Locale\n |--------------------------------------------------------------------------\n |\n | The fallback locale determines the locale to use when the current one\n | is not available. You may change the value to correspond to any of\n | the language directories that are provided through your application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'fallback_locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n")])])]),e("h2",{attrs:{id:"create-a-new-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-locale"}},[a._v("#")]),a._v(" Create a new Locale")]),a._v(" "),e("p",[a._v("To support localization in your package, you need to create language files. Follow the steps below to set up a language file for English translations.")]),a._v(" "),e("h4",{attrs:{id:"create-the-lang-folder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-lang-folder"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("lang")]),a._v(" Folder")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to the "),e("code",[a._v("packages/Webkul/Category/src/Resources")]),a._v(" directory.")]),a._v(" "),e("li",[a._v("Create a directory named "),e("code",[a._v("lang")]),a._v(".")])]),a._v(" "),e("h4",{attrs:{id:"create-language-code-folders"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-language-code-folders"}},[a._v("#")]),a._v(" Create Language Code Folders")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("lang")]),a._v(" directory, create different directories for each language you want to support. For example, you can create directories for English ("),e("code",[a._v("en")]),a._v("), Hindi ("),e("code",[a._v("hi")]),a._v("), etc.")]),a._v(" "),e("li",[a._v("For now, let's create a directory named "),e("code",[a._v("en")]),a._v(" to represent English.")])]),a._v(" "),e("h4",{attrs:{id:"create-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-app-php-file"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("en")]),a._v(" directory, create a file named "),e("code",[a._v("app.php")]),a._v(" for language translations.")])]),a._v(" "),e("h3",{attrs:{id:"directory-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[a._v("#")]),a._v(" Directory Structure")]),a._v(" "),e("p",[a._v("The updated directory structure will look like this:")]),a._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[a._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── lang\n └── en\n └── app.php\n")])])]),e("h3",{attrs:{id:"writing-a-translation-in-app-php"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("#")]),a._v(" Writing a Translation in "),e("code",[a._v("app.php")])]),a._v(" "),e("p",[a._v("To add translations for your package, you can edit the "),e("code",[a._v("app.php")]),a._v(" file located in the language directory ("),e("code",[a._v("en")]),a._v(" in this case). Below is an example of how you can define translations:")]),a._v(" "),e("h4",{attrs:{id:"open-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#open-the-app-php-file"}},[a._v("#")]),a._v(" Open the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to "),e("code",[a._v("packages/Webkul/Category/src/Resources/lang/en")]),a._v(".")]),a._v(" "),e("li",[a._v("Open the "),e("code",[a._v("app.php")]),a._v(" file.")])]),a._v(" "),e("h4",{attrs:{id:"add-the-translation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-the-translation"}},[a._v("#")]),a._v(" Add the Translation")]),a._v(" "),e("ul",[e("li",[a._v("Inside "),e("code",[a._v("app.php")]),a._v(", define your translations as an associative array. For example:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'index'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'Categories'")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),e("h2",{attrs:{id:"load-translation-from-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#load-translation-from-package"}},[a._v("#")]),a._v(" Load Translation from Package")]),a._v(" "),e("p",[a._v("To make translations from your package accessible, you need to register the language file in the service provider and then use them in your Blade templates.")]),a._v(" "),e("h3",{attrs:{id:"update-the-service-provider"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update-the-service-provider"}},[a._v("#")]),a._v(" Update the Service Provider")]),a._v(" "),e("ul",[e("li",[a._v("Open the "),e("code",[a._v("CategoryServiceProvider.php")]),a._v(" file located in "),e("code",[a._v("packages/Webkul/Category/src/Providers")]),a._v(".")]),a._v(" "),e("li",[a._v("Add the following code to the "),e("code",[a._v("boot")]),a._v(" method:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadTranslationsFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Resources/lang'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),e("h4",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("This code uses "),e("code",[a._v("$this->loadTranslationsFrom")]),a._v(" to register translations from the lang directory of your package ("),e("code",[a._v("packages/ Webkul/Category/src/Resources/lang")]),a._v(") under the namespace "),e("code",[a._v("'category'")]),a._v(".")])]),a._v(" "),e("li",[e("p",[a._v("The "),e("code",[a._v("loadTranslationsFrom")]),a._v(" method registers translations for the "),e("code",[a._v("'category'")]),a._v(" namespace from the specified path ("),e("code",[a._v("__DIR__ . '/../Resources/lang'")]),a._v(").")])]),a._v(" "),e("li",[e("p",[a._v("This makes translations accessible throughout your Laravel application using the "),e("code",[a._v("'category'")]),a._v(" namespace prefix.")])])]),a._v(" "),e("h3",{attrs:{id:"use-translations-in-blade-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-translations-in-blade-files"}},[a._v("#")]),a._v(" Use Translations in Blade Files")]),a._v(" "),e("p",[a._v("In your Blade templates ("),e("code",[a._v(".blade.php")]),a._v(" files), you can use the "),e("code",[a._v("@lang")]),a._v(" helper function to retrieve translations. Use the namespace 'category' followed by the translation key. For example:")]),a._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[a._v("@lang('category::categories.index.title')\n")])])]),e("h4",{attrs:{id:"explanation-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("The "),e("code",[a._v("@lang('category::categories.index.title')")]),a._v(" syntax fetches the translation for for "),e("code",[a._v("categories")]),a._v(" > "),e("code",[a._v("index")]),a._v(" > "),e("code",[a._v("title")])])]),a._v(" "),e("li",[e("p",[a._v("Replace "),e("code",[a._v("'categories.index.title'")]),a._v(" with your actual translation keys to use different translations as needed in your application.")])])]),a._v(" "),e("p",[a._v("By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[130],{431:function(a,e,t){"use strict";t.r(e);var s=t(10),n=Object(s.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"localization"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#localization"}},[a._v("#")]),a._v(" Localization")]),a._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#publishing-the-language-files"}},[a._v("Publishing the Language Files")])]),e("li",[e("a",{attrs:{href:"#configuring-the-locale"}},[a._v("Configuring the Locale")])]),e("li",[e("a",{attrs:{href:"#create-a-new-locale"}},[a._v("Create a new Locale")]),e("ul",[e("li",[e("a",{attrs:{href:"#directory-structure"}},[a._v("Directory Structure")])]),e("li",[e("a",{attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("Writing a Translation in app.php")])])])]),e("li",[e("a",{attrs:{href:"#load-translation-from-package"}},[a._v("Load Translation from Package")]),e("ul",[e("li",[e("a",{attrs:{href:"#update-the-service-provider"}},[a._v("Update the Service Provider")])]),e("li",[e("a",{attrs:{href:"#use-translations-in-blade-files"}},[a._v("Use Translations in Blade Files")])])])])])]),e("p"),a._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),e("p",[a._v("Laravel's localization features provide a convenient way to retrieve strings in various languages, allowing you to easily support multiple languages within your application.")]),a._v(" "),e("p",[a._v("Language strings may be stored in files within the application's lang directory. Within this directory, there may be subdirectories for each language supported by the application. This is the approach Laravel uses to manage translation strings for built-in Laravel features such as validation error messages:")]),a._v(" "),e("p",[a._v("To learn in detail about Localization, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/localization",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),e("OutboundLink")],1),a._v(".")]),a._v(" "),e("h2",{attrs:{id:"publishing-the-language-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#publishing-the-language-files"}},[a._v("#")]),a._v(" Publishing the Language Files")]),a._v(" "),e("p",[a._v("By default, the Laravel application skeleton does not include the lang directory. If you would like to customize Laravel's language files or create your own, you should scaffold the lang directory via the lang:publish Artisan command. The lang:publish command will create the lang directory in your application and publish the default set of language files used by Laravel:")]),a._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[a._v("php artisan lang:publish\n")])])]),e("h2",{attrs:{id:"configuring-the-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configuring-the-locale"}},[a._v("#")]),a._v(" Configuring the Locale")]),a._v(" "),e("p",[a._v("The default language for your application is stored in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file's "),e("code",[a._v("locale")]),a._v(" configuration option, which is typically set using the "),e("code",[a._v("APP_LOCALE")]),a._v(" environment variable. You are free to modify this value to suit the needs of your application.")]),a._v(" "),e("p",[a._v("You may also configure a "),e("code",[a._v('"fallback language"')]),a._v(", which will be used when the default language does not contain a given translation string. Like the default language, the fallback language is also configured in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file, and its value is typically set using the APP_FALLBACK_LOCALE environment variable.")]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[a._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Locale Configuration\n |--------------------------------------------------------------------------\n |\n | The application locale determines the default locale that will be used\n | by the translation service provider. You are free to set this value\n | to any of the locales which will be supported by the application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("env")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'APP_LOCALE'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Fallback Locale\n |--------------------------------------------------------------------------\n |\n | The fallback locale determines the locale to use when the current one\n | is not available. You may change the value to correspond to any of\n | the language directories that are provided through your application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'fallback_locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n")])])]),e("h2",{attrs:{id:"create-a-new-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-locale"}},[a._v("#")]),a._v(" Create a new Locale")]),a._v(" "),e("p",[a._v("To support localization in your package, you need to create language files. Follow the steps below to set up a language file for English translations.")]),a._v(" "),e("h4",{attrs:{id:"create-the-lang-folder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-lang-folder"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("lang")]),a._v(" Folder")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to the "),e("code",[a._v("packages/Webkul/Category/src/Resources")]),a._v(" directory.")]),a._v(" "),e("li",[a._v("Create a directory named "),e("code",[a._v("lang")]),a._v(".")])]),a._v(" "),e("h4",{attrs:{id:"create-language-code-folders"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-language-code-folders"}},[a._v("#")]),a._v(" Create Language Code Folders")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("lang")]),a._v(" directory, create different directories for each language you want to support. For example, you can create directories for English ("),e("code",[a._v("en")]),a._v("), Hindi ("),e("code",[a._v("hi")]),a._v("), etc.")]),a._v(" "),e("li",[a._v("For now, let's create a directory named "),e("code",[a._v("en")]),a._v(" to represent English.")])]),a._v(" "),e("h4",{attrs:{id:"create-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-app-php-file"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("en")]),a._v(" directory, create a file named "),e("code",[a._v("app.php")]),a._v(" for language translations.")])]),a._v(" "),e("h3",{attrs:{id:"directory-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[a._v("#")]),a._v(" Directory Structure")]),a._v(" "),e("p",[a._v("The updated directory structure will look like this:")]),a._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[a._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── lang\n └── en\n └── app.php\n")])])]),e("h3",{attrs:{id:"writing-a-translation-in-app-php"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("#")]),a._v(" Writing a Translation in "),e("code",[a._v("app.php")])]),a._v(" "),e("p",[a._v("To add translations for your package, you can edit the "),e("code",[a._v("app.php")]),a._v(" file located in the language directory ("),e("code",[a._v("en")]),a._v(" in this case). Below is an example of how you can define translations:")]),a._v(" "),e("h4",{attrs:{id:"open-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#open-the-app-php-file"}},[a._v("#")]),a._v(" Open the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to "),e("code",[a._v("packages/Webkul/Category/src/Resources/lang/en")]),a._v(".")]),a._v(" "),e("li",[a._v("Open the "),e("code",[a._v("app.php")]),a._v(" file.")])]),a._v(" "),e("h4",{attrs:{id:"add-the-translation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-the-translation"}},[a._v("#")]),a._v(" Add the Translation")]),a._v(" "),e("ul",[e("li",[a._v("Inside "),e("code",[a._v("app.php")]),a._v(", define your translations as an associative array. For example:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'index'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'Categories'")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),e("h2",{attrs:{id:"load-translation-from-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#load-translation-from-package"}},[a._v("#")]),a._v(" Load Translation from Package")]),a._v(" "),e("p",[a._v("To make translations from your package accessible, you need to register the language file in the service provider and then use them in your Blade templates.")]),a._v(" "),e("h3",{attrs:{id:"update-the-service-provider"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update-the-service-provider"}},[a._v("#")]),a._v(" Update the Service Provider")]),a._v(" "),e("ul",[e("li",[a._v("Open the "),e("code",[a._v("CategoryServiceProvider.php")]),a._v(" file located in "),e("code",[a._v("packages/Webkul/Category/src/Providers")]),a._v(".")]),a._v(" "),e("li",[a._v("Add the following code to the "),e("code",[a._v("boot")]),a._v(" method:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadTranslationsFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Resources/lang'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),e("h4",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("This code uses "),e("code",[a._v("$this->loadTranslationsFrom")]),a._v(" to register translations from the lang directory of your package ("),e("code",[a._v("packages/ Webkul/Category/src/Resources/lang")]),a._v(") under the namespace "),e("code",[a._v("'category'")]),a._v(".")])]),a._v(" "),e("li",[e("p",[a._v("The "),e("code",[a._v("loadTranslationsFrom")]),a._v(" method registers translations for the "),e("code",[a._v("'category'")]),a._v(" namespace from the specified path ("),e("code",[a._v("__DIR__ . '/../Resources/lang'")]),a._v(").")])]),a._v(" "),e("li",[e("p",[a._v("This makes translations accessible throughout your Laravel application using the "),e("code",[a._v("'category'")]),a._v(" namespace prefix.")])])]),a._v(" "),e("h3",{attrs:{id:"use-translations-in-blade-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-translations-in-blade-files"}},[a._v("#")]),a._v(" Use Translations in Blade Files")]),a._v(" "),e("p",[a._v("In your Blade templates ("),e("code",[a._v(".blade.php")]),a._v(" files), you can use the "),e("code",[a._v("@lang")]),a._v(" helper function to retrieve translations. Use the namespace 'category' followed by the translation key. For example:")]),a._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[a._v("@lang('category::categories.index.title')\n")])])]),e("h4",{attrs:{id:"explanation-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("The "),e("code",[a._v("@lang('category::categories.index.title')")]),a._v(" syntax fetches the translation for for "),e("code",[a._v("categories")]),a._v(" > "),e("code",[a._v("index")]),a._v(" > "),e("code",[a._v("title")])])]),a._v(" "),e("li",[e("p",[a._v("Replace "),e("code",[a._v("'categories.index.title'")]),a._v(" with your actual translation keys to use different translations as needed in your application.")])])]),a._v(" "),e("p",[a._v("By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/131.79f85e75.js b/assets/js/131.3f4fa5bd.js similarity index 99% rename from assets/js/131.79f85e75.js rename to assets/js/131.3f4fa5bd.js index e3e0a48..9898be3 100644 --- a/assets/js/131.79f85e75.js +++ b/assets/js/131.3f4fa5bd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[131],{429:function(t,s,a){"use strict";a.r(s);var e=a(10),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"routes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#routes"}},[t._v("#")]),t._v(" Routes")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#create-a-new-route"}},[t._v("Create a new Route")]),s("ul",[s("li",[s("a",{attrs:{href:"#routes"}},[t._v("Routes")])])])]),s("li",[s("a",{attrs:{href:"#loading-routes"}},[t._v("Loading Routes")]),s("ul",[s("li",[s("a",{attrs:{href:"#register-routes-in-serviceprovider"}},[t._v("Register Routes in ServiceProvider")])])])]),s("li",[s("a",{attrs:{href:"#available-http-methods"}},[t._v("Available HTTP methods")]),s("ul",[s("li",[s("a",{attrs:{href:"#get"}},[t._v("GET")])]),s("li",[s("a",{attrs:{href:"#post"}},[t._v("POST")])]),s("li",[s("a",{attrs:{href:"#put"}},[t._v("PUT")])]),s("li",[s("a",{attrs:{href:"#delete"}},[t._v("DELETE")])]),s("li",[s("a",{attrs:{href:"#patch"}},[t._v("PATCH")])])])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("Routes in Laravel define the entry points of your application, mapping HTTP requests to specific controllers or closures. They play a crucial role in defining how users interact with your web application's endpoints.")]),t._v(" "),s("p",[t._v("Routes can be defined to handle various HTTP methods (GET, Category, PUT, DELETE, etc.) and can include parameters and route parameters to capture dynamic values from the URL. Laravel's routing system is powerful and flexible, allowing for easy RESTful routing and middleware application to routes.")]),t._v(" "),s("p",[t._v("For detailed information on Laravel routes, including how to define routes, use route parameters, and apply middleware, refer to the "),s("a",{attrs:{href:"https://laravel.com/docs/11.x/routing",target:"_blank",rel:"noopener noreferrer"}},[t._v("Laravel Documentation on Routing"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"create-a-new-route"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-route"}},[t._v("#")]),t._v(" Create a new Route")]),t._v(" "),s("p",[t._v('Let\'s start by creating a route to display the categories. We will assume that the package name is "Category".')]),t._v(" "),s("p",[t._v("Start by creating a "),s("code",[t._v("Routes")]),t._v(" directory inside "),s("code",[t._v("packages/Webkul/Category/src")]),t._v(".")]),t._v(" "),s("p",[t._v("Inside the "),s("code",[t._v("Routes")]),t._v(" directory, create file named "),s("code",[t._v("routes.php")]),t._v(".")]),t._v(" "),s("p",[t._v("The updated directory structure will look like this:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("packages\n└── Webkul\n └── Category\n └── src\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Routes\n └── routes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),s("h3",{attrs:{id:"routes-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#routes-2"}},[t._v("#")]),t._v(" Routes")]),t._v(" "),s("p",[s("code",[t._v("routes.php")]),t._v(" This file is for Routes. Add the following code to this file:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'web'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin_locale'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'prefix'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'app.admin_path'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),s("h4",{attrs:{id:"explanation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("Routes inside "),s("code",[t._v("routes.php")]),t._v(" are prefixed with the admin URL ("),s("code",[t._v("config('app.admin_path')")]),t._v(") and apply the "),s("code",[t._v("web")]),t._v(" and "),s("code",[t._v("admin_locale")]),t._v(" middleware groups. Adjust the middleware and URL prefix according to your application's configuration.")]),t._v(" "),s("h2",{attrs:{id:"loading-routes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#loading-routes"}},[t._v("#")]),t._v(" Loading Routes")]),t._v(" "),s("h3",{attrs:{id:"register-routes-in-serviceprovider"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#register-routes-in-serviceprovider"}},[t._v("#")]),t._v(" Register Routes in ServiceProvider")]),t._v(" "),s("p",[t._v("In the CategoryServiceProvider.php` class, load the routes using the loadRoutesFrom method inside the boot method.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("loadRoutesFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/../Routes/routes.php'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register services.\n * \n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("register")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),s("h4",{attrs:{id:"explanation-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("loadRoutesFrom")]),t._v(" method registers the routes defined in "),s("code",[t._v("routes.php")]),t._v(", within the Laravel application, integrating them into the routing system.")]),t._v(" "),s("h2",{attrs:{id:"available-http-methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#available-http-methods"}},[t._v("#")]),t._v(" Available HTTP methods")]),t._v(" "),s("p",[t._v("Basic routes are the most common type of routes in Laravel. They respond to HTTP requests like "),s("code",[t._v("GET")]),t._v(", "),s("code",[t._v("POST")]),t._v(", "),s("code",[t._v("PUT")]),t._v(", "),s("code",[t._v("DELETE")]),t._v(", etc., and map the URL to a specific controller method or closure function. For example:")]),t._v(" "),s("h3",{attrs:{id:"get"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get"}},[t._v("#")]),t._v(" GET")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("GET")]),t._v(" method is used to retrieve data from the server. It is typically used to display pages or retrieve information.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a GET request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"post"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#post"}},[t._v("#")]),t._v(" POST")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("POST")]),t._v(" method is used to submit data to the server. It is commonly used for form submissions.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a Category request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("post")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'store'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"put"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#put"}},[t._v("#")]),t._v(" PUT")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("PUT")]),t._v(" method is used to update existing data on the server. It is usually used for updating resources.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a PUT request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'update'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"delete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#delete"}},[t._v("#")]),t._v(" DELETE")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DELETE")]),t._v(" method is used to delete data from the server. It is used to remove resources.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a DELETE request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("delete")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'destroy'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"patch"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#patch"}},[t._v("#")]),t._v(" PATCH")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("PATCH")]),t._v(" method is similar to "),s("code",[t._v("PUT")]),t._v(", but it is used to make partial updates to data on the server.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a PATCH request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("patch")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'partialUpdate'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[131],{430:function(t,s,a){"use strict";a.r(s);var e=a(10),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"routes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#routes"}},[t._v("#")]),t._v(" Routes")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#create-a-new-route"}},[t._v("Create a new Route")]),s("ul",[s("li",[s("a",{attrs:{href:"#routes"}},[t._v("Routes")])])])]),s("li",[s("a",{attrs:{href:"#loading-routes"}},[t._v("Loading Routes")]),s("ul",[s("li",[s("a",{attrs:{href:"#register-routes-in-serviceprovider"}},[t._v("Register Routes in ServiceProvider")])])])]),s("li",[s("a",{attrs:{href:"#available-http-methods"}},[t._v("Available HTTP methods")]),s("ul",[s("li",[s("a",{attrs:{href:"#get"}},[t._v("GET")])]),s("li",[s("a",{attrs:{href:"#post"}},[t._v("POST")])]),s("li",[s("a",{attrs:{href:"#put"}},[t._v("PUT")])]),s("li",[s("a",{attrs:{href:"#delete"}},[t._v("DELETE")])]),s("li",[s("a",{attrs:{href:"#patch"}},[t._v("PATCH")])])])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("Routes in Laravel define the entry points of your application, mapping HTTP requests to specific controllers or closures. They play a crucial role in defining how users interact with your web application's endpoints.")]),t._v(" "),s("p",[t._v("Routes can be defined to handle various HTTP methods (GET, Category, PUT, DELETE, etc.) and can include parameters and route parameters to capture dynamic values from the URL. Laravel's routing system is powerful and flexible, allowing for easy RESTful routing and middleware application to routes.")]),t._v(" "),s("p",[t._v("For detailed information on Laravel routes, including how to define routes, use route parameters, and apply middleware, refer to the "),s("a",{attrs:{href:"https://laravel.com/docs/11.x/routing",target:"_blank",rel:"noopener noreferrer"}},[t._v("Laravel Documentation on Routing"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"create-a-new-route"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-route"}},[t._v("#")]),t._v(" Create a new Route")]),t._v(" "),s("p",[t._v('Let\'s start by creating a route to display the categories. We will assume that the package name is "Category".')]),t._v(" "),s("p",[t._v("Start by creating a "),s("code",[t._v("Routes")]),t._v(" directory inside "),s("code",[t._v("packages/Webkul/Category/src")]),t._v(".")]),t._v(" "),s("p",[t._v("Inside the "),s("code",[t._v("Routes")]),t._v(" directory, create file named "),s("code",[t._v("routes.php")]),t._v(".")]),t._v(" "),s("p",[t._v("The updated directory structure will look like this:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("packages\n└── Webkul\n └── Category\n └── src\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Routes\n └── routes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),s("h3",{attrs:{id:"routes-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#routes-2"}},[t._v("#")]),t._v(" Routes")]),t._v(" "),s("p",[s("code",[t._v("routes.php")]),t._v(" This file is for Routes. Add the following code to this file:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'web'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin_locale'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'prefix'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'app.admin_path'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),s("h4",{attrs:{id:"explanation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("Routes inside "),s("code",[t._v("routes.php")]),t._v(" are prefixed with the admin URL ("),s("code",[t._v("config('app.admin_path')")]),t._v(") and apply the "),s("code",[t._v("web")]),t._v(" and "),s("code",[t._v("admin_locale")]),t._v(" middleware groups. Adjust the middleware and URL prefix according to your application's configuration.")]),t._v(" "),s("h2",{attrs:{id:"loading-routes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#loading-routes"}},[t._v("#")]),t._v(" Loading Routes")]),t._v(" "),s("h3",{attrs:{id:"register-routes-in-serviceprovider"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#register-routes-in-serviceprovider"}},[t._v("#")]),t._v(" Register Routes in ServiceProvider")]),t._v(" "),s("p",[t._v("In the CategoryServiceProvider.php` class, load the routes using the loadRoutesFrom method inside the boot method.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("loadRoutesFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/../Routes/routes.php'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register services.\n * \n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("register")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),s("h4",{attrs:{id:"explanation-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("loadRoutesFrom")]),t._v(" method registers the routes defined in "),s("code",[t._v("routes.php")]),t._v(", within the Laravel application, integrating them into the routing system.")]),t._v(" "),s("h2",{attrs:{id:"available-http-methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#available-http-methods"}},[t._v("#")]),t._v(" Available HTTP methods")]),t._v(" "),s("p",[t._v("Basic routes are the most common type of routes in Laravel. They respond to HTTP requests like "),s("code",[t._v("GET")]),t._v(", "),s("code",[t._v("POST")]),t._v(", "),s("code",[t._v("PUT")]),t._v(", "),s("code",[t._v("DELETE")]),t._v(", etc., and map the URL to a specific controller method or closure function. For example:")]),t._v(" "),s("h3",{attrs:{id:"get"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get"}},[t._v("#")]),t._v(" GET")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("GET")]),t._v(" method is used to retrieve data from the server. It is typically used to display pages or retrieve information.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a GET request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"post"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#post"}},[t._v("#")]),t._v(" POST")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("POST")]),t._v(" method is used to submit data to the server. It is commonly used for form submissions.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a Category request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("post")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'store'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"put"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#put"}},[t._v("#")]),t._v(" PUT")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("PUT")]),t._v(" method is used to update existing data on the server. It is usually used for updating resources.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a PUT request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'update'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"delete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#delete"}},[t._v("#")]),t._v(" DELETE")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DELETE")]),t._v(" method is used to delete data from the server. It is used to remove resources.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a DELETE request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("delete")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'destroy'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"patch"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#patch"}},[t._v("#")]),t._v(" PATCH")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("PATCH")]),t._v(" method is similar to "),s("code",[t._v("PUT")]),t._v(", but it is used to make partial updates to data on the server.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a PATCH request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("patch")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'partialUpdate'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/132.c68df1dc.js b/assets/js/132.da6ced46.js similarity index 99% rename from assets/js/132.c68df1dc.js rename to assets/js/132.da6ced46.js index 4de79d4..ea27b1d 100644 --- a/assets/js/132.c68df1dc.js +++ b/assets/js/132.da6ced46.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[132],{433:function(t,e,a){"use strict";a.r(e);var s=a(10),r=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"repositories"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#repositories"}},[t._v("#")]),t._v(" Repositories")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#dependency-injection"}},[t._v("Dependency Injection")])]),e("li",[e("a",{attrs:{href:"#using-krayin-package-generator"}},[t._v("Using Krayin Package Generator")]),e("ul",[e("li",[e("a",{attrs:{href:"#create-a-new-repository-class"}},[t._v("Create a New Repository Class")])]),e("li",[e("a",{attrs:{href:"#explanation"}},[t._v("Explanation")])])])]),e("li",[e("a",{attrs:{href:"#manually-setting-up-repository-files"}},[t._v("Manually Setting Up Repository Files")]),e("ul",[e("li",[e("a",{attrs:{href:"#setting-up-categoryrepository-in-webkul-category-package"}},[t._v("Setting Up CategoryRepository in Webkul/Category Package")])])])]),e("li",[e("a",{attrs:{href:"#available-methods"}},[t._v("Available Methods")]),e("ul",[e("li",[e("a",{attrs:{href:"#all"}},[t._v("all")])]),e("li",[e("a",{attrs:{href:"#find"}},[t._v("Find")])]),e("li",[e("a",{attrs:{href:"#findorfail"}},[t._v("FindOrFail")])]),e("li",[e("a",{attrs:{href:"#create"}},[t._v("Create")])]),e("li",[e("a",{attrs:{href:"#update"}},[t._v("Update")])]),e("li",[e("a",{attrs:{href:"#delete"}},[t._v("Delete")])]),e("li",[e("a",{attrs:{href:"#paginate"}},[t._v("Paginate")])]),e("li",[e("a",{attrs:{href:"#findwhere"}},[t._v("FindWhere")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("In traditional development, application logic is often embedded in controllers. An alternative approach uses Repositories to abstract database operations and queries, promoting cleaner, more maintainable code.")]),t._v(" "),e("p",[t._v("Repositories decouple models from controllers and provide readable names for complex queries. Each Repository class binds to an Eloquent model in its constructor, enabling the use of methods like "),e("code",[t._v("findOrFail")]),t._v(", "),e("code",[t._v("update")]),t._v(", and "),e("code",[t._v("all")]),t._v(". This separation enhances code readability, reusability, and adherence to the separation of concerns principle, making the application easier to manage and scale.")]),t._v(" "),e("h2",{attrs:{id:"dependency-injection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dependency-injection"}},[t._v("#")]),t._v(" Dependency Injection")]),t._v(" "),e("p",[t._v("Dependency Injection (DI) is a design pattern widely used in Laravel for managing class dependencies. It allows classes to receive their dependencies from an external source rather than creating them internally. This promotes loose coupling between classes, enhances reusability, and simplifies unit testing.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("__construct")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[t._v("CategoryRepository")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categoryRepository")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("__construct()")]),t._v(" method is defined with a parameter "),e("code",[t._v("$categoryRepository")]),t._v(" typed as "),e("code",[t._v("CategoryRepository")]),t._v(".\nLaravel's service container automatically resolves and injects an instance of "),e("code",[t._v("CategoryRepository")]),t._v(" when an instance of the class containing this constructor is instantiated.")]),t._v(" "),e("p",[t._v("This is a form of dependency injection where the "),e("code",[t._v("CategoryRepository")]),t._v(" dependency is injected into the class through its constructor.")]),t._v(" "),e("h2",{attrs:{id:"using-krayin-package-generator"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[t._v("#")]),t._v(" Using Krayin Package Generator")]),t._v(" "),e("p",[t._v("The Krayin package generator provides a convenient way to create new components for your Krayin application. One of these components is the Repository class, which is essential for abstracting database interactions and promoting clean code architecture.")]),t._v(" "),e("h3",{attrs:{id:"create-a-new-repository-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-repository-class"}},[t._v("#")]),t._v(" Create a New Repository Class")]),t._v(" "),e("p",[t._v("To create a new Repository class, use the following command. This command creates a new Repository class in the "),e("code",[t._v("packages/Webkul/Category/src/Repository")]),t._v(" directory.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("php artisan package:make "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-repository")]),t._v(" CategoryRepository Webkul/Category\n")])])]),e("h3",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),e("ul",[e("li",[e("strong",[t._v("Command:")]),t._v(" The command "),e("code",[t._v("php artisan package:make -repository")]),t._v(" is used to generate a new Repository class.")]),t._v(" "),e("li",[e("strong",[t._v("Repository Name:")]),t._v(" "),e("code",[t._v("CategoryRepository")]),t._v(" is the name of the new Repository class that will be created.")]),t._v(" "),e("li",[e("strong",[t._v("Package Path:")]),t._v(" "),e("code",[t._v("Webkul/Category")]),t._v(" specifies the package within the packages directory where the new Repository class will be created.")])]),t._v(" "),e("h2",{attrs:{id:"manually-setting-up-repository-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#manually-setting-up-repository-files"}},[t._v("#")]),t._v(" Manually Setting Up Repository Files")]),t._v(" "),e("p",[t._v("Manually setting up repository files involves creating and organizing repository classes in your application without relying on automated generators. This approach allows for custom structuring and naming conventions tailored to your project's needs. By manually managing repository files, developers can ensure precise control over code organization and maintain consistency across the application architecture.")]),t._v(" "),e("h3",{attrs:{id:"setting-up-categoryrepository-in-webkul-category-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-categoryrepository-in-webkul-category-package"}},[t._v("#")]),t._v(" Setting Up CategoryRepository in Webkul/Category Package")]),t._v(" "),e("p",[t._v("Start by creating a "),e("code",[t._v("Repository")]),t._v(" directory within the "),e("code",[t._v("Webkul/Category/src/")]),t._v(" directory. This directory will house the repository class responsible for handling category-related database operations.Create a file named "),e("code",[t._v("CategoryRepository.php")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Repository\n └── CategoryRepository.php\n")])])]),e("p",[t._v("This file will contain the "),e("code",[t._v("CategoryRepository")]),t._v(" class, which will encapsulate methods for interacting with category data.\nCopy the following code into your newly created repository file.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"find"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#find"}},[t._v("#")]),t._v(" Find")]),t._v(" "),e("p",[t._v("The find method is called on the categoryRepository instance. This method attempts to retrieve a Category model by its primary key.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"findorfail"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#findorfail"}},[t._v("#")]),t._v(" FindOrFail")]),t._v(" "),e("p",[t._v("The findOrFail method is called on the categoryRepository instance. This method attempts to retrieve a Category model by its primary key and throws ModelNotFound Exception.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findOrFail")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"create"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create"}},[t._v("#")]),t._v(" Create")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("create")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for creating and saving a new instance of the "),e("code",[t._v("Category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"update"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update"}},[t._v("#")]),t._v(" Update")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("update")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for updating a existing instance of the "),e("code",[t._v("Category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"delete"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#delete"}},[t._v("#")]),t._v(" Delete")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("delete")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for delete a existing instance of the "),e("code",[t._v("category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("delete")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"paginate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#paginate"}},[t._v("#")]),t._v(" Paginate")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("paginate")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for retrieving a paginated set of records for the "),e("code",[t._v("Category")]),t._v(" model from the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Number of categories to be displayed per page.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$perPage")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Paginate the categories.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categories")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("paginate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$perPage")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"findwhere"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#findwhere"}},[t._v("#")]),t._v(" FindWhere")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("findWhere")]),t._v(" method is called on the categoryRepository instance. This method adds a query constraint to filter the results based on a specified condition.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categories")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findWhere")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'status'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'active'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("model()")]),t._v(" method within CategoryRepository.php returns the path of your contract class ("),e("code",[t._v("CategoryContract")]),t._v(" in this example). This method initializes the model instance used throughout the repository for database interactions.")]),t._v(" "),e("p",[t._v("Your "),e("code",[t._v("CategoryRepository")]),t._v(" is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.")]),t._v(" "),e("p",[t._v("By utilizing the "),e("code",[t._v("CategoryRepository")]),t._v(", you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[132],{427:function(t,e,a){"use strict";a.r(e);var s=a(10),r=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"repositories"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#repositories"}},[t._v("#")]),t._v(" Repositories")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#dependency-injection"}},[t._v("Dependency Injection")])]),e("li",[e("a",{attrs:{href:"#using-krayin-package-generator"}},[t._v("Using Krayin Package Generator")]),e("ul",[e("li",[e("a",{attrs:{href:"#create-a-new-repository-class"}},[t._v("Create a New Repository Class")])]),e("li",[e("a",{attrs:{href:"#explanation"}},[t._v("Explanation")])])])]),e("li",[e("a",{attrs:{href:"#manually-setting-up-repository-files"}},[t._v("Manually Setting Up Repository Files")]),e("ul",[e("li",[e("a",{attrs:{href:"#setting-up-categoryrepository-in-webkul-category-package"}},[t._v("Setting Up CategoryRepository in Webkul/Category Package")])])])]),e("li",[e("a",{attrs:{href:"#available-methods"}},[t._v("Available Methods")]),e("ul",[e("li",[e("a",{attrs:{href:"#all"}},[t._v("all")])]),e("li",[e("a",{attrs:{href:"#find"}},[t._v("Find")])]),e("li",[e("a",{attrs:{href:"#findorfail"}},[t._v("FindOrFail")])]),e("li",[e("a",{attrs:{href:"#create"}},[t._v("Create")])]),e("li",[e("a",{attrs:{href:"#update"}},[t._v("Update")])]),e("li",[e("a",{attrs:{href:"#delete"}},[t._v("Delete")])]),e("li",[e("a",{attrs:{href:"#paginate"}},[t._v("Paginate")])]),e("li",[e("a",{attrs:{href:"#findwhere"}},[t._v("FindWhere")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("In traditional development, application logic is often embedded in controllers. An alternative approach uses Repositories to abstract database operations and queries, promoting cleaner, more maintainable code.")]),t._v(" "),e("p",[t._v("Repositories decouple models from controllers and provide readable names for complex queries. Each Repository class binds to an Eloquent model in its constructor, enabling the use of methods like "),e("code",[t._v("findOrFail")]),t._v(", "),e("code",[t._v("update")]),t._v(", and "),e("code",[t._v("all")]),t._v(". This separation enhances code readability, reusability, and adherence to the separation of concerns principle, making the application easier to manage and scale.")]),t._v(" "),e("h2",{attrs:{id:"dependency-injection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dependency-injection"}},[t._v("#")]),t._v(" Dependency Injection")]),t._v(" "),e("p",[t._v("Dependency Injection (DI) is a design pattern widely used in Laravel for managing class dependencies. It allows classes to receive their dependencies from an external source rather than creating them internally. This promotes loose coupling between classes, enhances reusability, and simplifies unit testing.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("__construct")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[t._v("CategoryRepository")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categoryRepository")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("__construct()")]),t._v(" method is defined with a parameter "),e("code",[t._v("$categoryRepository")]),t._v(" typed as "),e("code",[t._v("CategoryRepository")]),t._v(".\nLaravel's service container automatically resolves and injects an instance of "),e("code",[t._v("CategoryRepository")]),t._v(" when an instance of the class containing this constructor is instantiated.")]),t._v(" "),e("p",[t._v("This is a form of dependency injection where the "),e("code",[t._v("CategoryRepository")]),t._v(" dependency is injected into the class through its constructor.")]),t._v(" "),e("h2",{attrs:{id:"using-krayin-package-generator"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[t._v("#")]),t._v(" Using Krayin Package Generator")]),t._v(" "),e("p",[t._v("The Krayin package generator provides a convenient way to create new components for your Krayin application. One of these components is the Repository class, which is essential for abstracting database interactions and promoting clean code architecture.")]),t._v(" "),e("h3",{attrs:{id:"create-a-new-repository-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-repository-class"}},[t._v("#")]),t._v(" Create a New Repository Class")]),t._v(" "),e("p",[t._v("To create a new Repository class, use the following command. This command creates a new Repository class in the "),e("code",[t._v("packages/Webkul/Category/src/Repository")]),t._v(" directory.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("php artisan package:make "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-repository")]),t._v(" CategoryRepository Webkul/Category\n")])])]),e("h3",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),e("ul",[e("li",[e("strong",[t._v("Command:")]),t._v(" The command "),e("code",[t._v("php artisan package:make -repository")]),t._v(" is used to generate a new Repository class.")]),t._v(" "),e("li",[e("strong",[t._v("Repository Name:")]),t._v(" "),e("code",[t._v("CategoryRepository")]),t._v(" is the name of the new Repository class that will be created.")]),t._v(" "),e("li",[e("strong",[t._v("Package Path:")]),t._v(" "),e("code",[t._v("Webkul/Category")]),t._v(" specifies the package within the packages directory where the new Repository class will be created.")])]),t._v(" "),e("h2",{attrs:{id:"manually-setting-up-repository-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#manually-setting-up-repository-files"}},[t._v("#")]),t._v(" Manually Setting Up Repository Files")]),t._v(" "),e("p",[t._v("Manually setting up repository files involves creating and organizing repository classes in your application without relying on automated generators. This approach allows for custom structuring and naming conventions tailored to your project's needs. By manually managing repository files, developers can ensure precise control over code organization and maintain consistency across the application architecture.")]),t._v(" "),e("h3",{attrs:{id:"setting-up-categoryrepository-in-webkul-category-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-categoryrepository-in-webkul-category-package"}},[t._v("#")]),t._v(" Setting Up CategoryRepository in Webkul/Category Package")]),t._v(" "),e("p",[t._v("Start by creating a "),e("code",[t._v("Repository")]),t._v(" directory within the "),e("code",[t._v("Webkul/Category/src/")]),t._v(" directory. This directory will house the repository class responsible for handling category-related database operations.Create a file named "),e("code",[t._v("CategoryRepository.php")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Repository\n └── CategoryRepository.php\n")])])]),e("p",[t._v("This file will contain the "),e("code",[t._v("CategoryRepository")]),t._v(" class, which will encapsulate methods for interacting with category data.\nCopy the following code into your newly created repository file.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"find"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#find"}},[t._v("#")]),t._v(" Find")]),t._v(" "),e("p",[t._v("The find method is called on the categoryRepository instance. This method attempts to retrieve a Category model by its primary key.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"findorfail"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#findorfail"}},[t._v("#")]),t._v(" FindOrFail")]),t._v(" "),e("p",[t._v("The findOrFail method is called on the categoryRepository instance. This method attempts to retrieve a Category model by its primary key and throws ModelNotFound Exception.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findOrFail")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"create"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create"}},[t._v("#")]),t._v(" Create")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("create")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for creating and saving a new instance of the "),e("code",[t._v("Category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"update"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update"}},[t._v("#")]),t._v(" Update")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("update")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for updating a existing instance of the "),e("code",[t._v("Category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"delete"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#delete"}},[t._v("#")]),t._v(" Delete")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("delete")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for delete a existing instance of the "),e("code",[t._v("category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("delete")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"paginate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#paginate"}},[t._v("#")]),t._v(" Paginate")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("paginate")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for retrieving a paginated set of records for the "),e("code",[t._v("Category")]),t._v(" model from the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Number of categories to be displayed per page.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$perPage")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Paginate the categories.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categories")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("paginate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$perPage")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"findwhere"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#findwhere"}},[t._v("#")]),t._v(" FindWhere")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("findWhere")]),t._v(" method is called on the categoryRepository instance. This method adds a query constraint to filter the results based on a specified condition.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categories")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findWhere")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'status'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'active'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("model()")]),t._v(" method within CategoryRepository.php returns the path of your contract class ("),e("code",[t._v("CategoryContract")]),t._v(" in this example). This method initializes the model instance used throughout the repository for database interactions.")]),t._v(" "),e("p",[t._v("Your "),e("code",[t._v("CategoryRepository")]),t._v(" is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.")]),t._v(" "),e("p",[t._v("By utilizing the "),e("code",[t._v("CategoryRepository")]),t._v(", you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/133.29a043da.js b/assets/js/133.d09bb0e6.js similarity index 99% rename from assets/js/133.29a043da.js rename to assets/js/133.d09bb0e6.js index 31802f4..be9d237 100644 --- a/assets/js/133.29a043da.js +++ b/assets/js/133.d09bb0e6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[133],{431:function(t,a,s){"use strict";s.r(a);var n=s(10),e=Object(n.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"validation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation"}},[t._v("#")]),t._v(" Validation")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#validation-using-laravel"}},[t._v("Validation Using Laravel")]),a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#usage"}},[t._v("Usage")])])])]),a("li",[a("a",{attrs:{href:"#validation-using-vue"}},[t._v("Validation Using Vue")]),a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#installation"}},[t._v("Installation")])]),a("li",[a("a",{attrs:{href:"#configuration"}},[t._v("Configuration")])]),a("li",[a("a",{attrs:{href:"#examples"}},[t._v("Examples")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"validation-using-laravel"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation-using-laravel"}},[t._v("#")]),t._v(" Validation Using Laravel")]),t._v(" "),a("h3",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Laravel provides various approaches to validate incoming data in your application. The most common method is to use the "),a("strong",[a("code",[t._v("validate")])]),t._v(" method available on incoming HTTP requests.")]),t._v(" "),a("p",[t._v("For detailed information about validation in Laravel, refer to the "),a("a",{attrs:{href:"https://laravel.com/docs/10.x/validation",target:"_blank",rel:"noopener noreferrer"}},[t._v("Laravel documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),a("p",[t._v("To use the "),a("strong",[a("code",[t._v("validate")])]),t._v(" method, you can follow this example:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Store the newly created resource.\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("store")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[t._v("Request")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|max:255|min:3Krayin'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'body'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Alternatively, you can manually create a validator instance using the Validator facade, as shown in this example:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'email'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|email'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'message'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|max:250'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$customMessages")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'The :attribute field is required.'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$rules")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$customMessages")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),a("h2",{attrs:{id:"validation-using-vue"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation-using-vue"}},[t._v("#")]),t._v(" Validation Using Vue")]),t._v(" "),a("h3",{attrs:{id:"introduction-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction-2"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("VeeValidate is a validation library for Vue.js that provides plenty of validation rules out of the box, along with support for custom rules. It is template-based and similar to the HTML5 validation API, making it easy to validate HTML5 inputs as well as custom Vue components. VeeValidate also supports localization with 44 languages maintained by the community.")]),t._v(" "),a("p",[t._v("For detailed information about validation in Vue.js using VeeValidate, refer to the "),a("a",{attrs:{href:"https://vee-validate.logaretm.com/v2/guide/",target:"_blank",rel:"noopener noreferrer"}},[t._v("VeeValidate documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"installation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),a("p",[t._v("Krayin already comes with the VeeValidate library, so there is no need to install it separately.")]),t._v(" "),a("h3",{attrs:{id:"configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#configuration"}},[t._v("#")]),t._v(" Configuration")]),t._v(" "),a("p",[t._v("Krayin includes the configuration for "),a("strong",[a("code",[t._v("vee-validate")])]),t._v(". For example, you can find the configuration in the following path: "),a("strong",[a("code",[t._v("krayin/packages/Webkul/Admin/src/Resources/assets/js/app.js")])]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Vue "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" VeeValidate "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Language imports.\n*/")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" de "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/en'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" de "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/de'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fa "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/fa'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Vue plugins.\n*/")]),t._v("\nVue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("use")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("VeeValidate"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("dictionary")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("en")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" en"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("de")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" de"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("fa")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fa"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("events")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'input|change|blur'")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),a("p",[t._v("Here are some examples of Vue validation using VeeValidate:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("alpha'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("username"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("required|email'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("email"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("required|min:6'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[133],{432:function(t,a,s){"use strict";s.r(a);var n=s(10),e=Object(n.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"validation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation"}},[t._v("#")]),t._v(" Validation")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#validation-using-laravel"}},[t._v("Validation Using Laravel")]),a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#usage"}},[t._v("Usage")])])])]),a("li",[a("a",{attrs:{href:"#validation-using-vue"}},[t._v("Validation Using Vue")]),a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#installation"}},[t._v("Installation")])]),a("li",[a("a",{attrs:{href:"#configuration"}},[t._v("Configuration")])]),a("li",[a("a",{attrs:{href:"#examples"}},[t._v("Examples")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"validation-using-laravel"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation-using-laravel"}},[t._v("#")]),t._v(" Validation Using Laravel")]),t._v(" "),a("h3",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Laravel provides various approaches to validate incoming data in your application. The most common method is to use the "),a("strong",[a("code",[t._v("validate")])]),t._v(" method available on incoming HTTP requests.")]),t._v(" "),a("p",[t._v("For detailed information about validation in Laravel, refer to the "),a("a",{attrs:{href:"https://laravel.com/docs/10.x/validation",target:"_blank",rel:"noopener noreferrer"}},[t._v("Laravel documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),a("p",[t._v("To use the "),a("strong",[a("code",[t._v("validate")])]),t._v(" method, you can follow this example:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Store the newly created resource.\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("store")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[t._v("Request")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|max:255|min:3Krayin'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'body'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Alternatively, you can manually create a validator instance using the Validator facade, as shown in this example:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'email'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|email'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'message'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|max:250'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$customMessages")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'The :attribute field is required.'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$rules")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$customMessages")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),a("h2",{attrs:{id:"validation-using-vue"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation-using-vue"}},[t._v("#")]),t._v(" Validation Using Vue")]),t._v(" "),a("h3",{attrs:{id:"introduction-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction-2"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("VeeValidate is a validation library for Vue.js that provides plenty of validation rules out of the box, along with support for custom rules. It is template-based and similar to the HTML5 validation API, making it easy to validate HTML5 inputs as well as custom Vue components. VeeValidate also supports localization with 44 languages maintained by the community.")]),t._v(" "),a("p",[t._v("For detailed information about validation in Vue.js using VeeValidate, refer to the "),a("a",{attrs:{href:"https://vee-validate.logaretm.com/v2/guide/",target:"_blank",rel:"noopener noreferrer"}},[t._v("VeeValidate documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"installation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),a("p",[t._v("Krayin already comes with the VeeValidate library, so there is no need to install it separately.")]),t._v(" "),a("h3",{attrs:{id:"configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#configuration"}},[t._v("#")]),t._v(" Configuration")]),t._v(" "),a("p",[t._v("Krayin includes the configuration for "),a("strong",[a("code",[t._v("vee-validate")])]),t._v(". For example, you can find the configuration in the following path: "),a("strong",[a("code",[t._v("krayin/packages/Webkul/Admin/src/Resources/assets/js/app.js")])]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Vue "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" VeeValidate "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Language imports.\n*/")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" de "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/en'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" de "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/de'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fa "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/fa'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Vue plugins.\n*/")]),t._v("\nVue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("use")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("VeeValidate"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("dictionary")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("en")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" en"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("de")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" de"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("fa")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fa"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("events")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'input|change|blur'")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),a("p",[t._v("Here are some examples of Vue validation using VeeValidate:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("alpha'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("username"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("required|email'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("email"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("required|min:6'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/134.e2bdba24.js b/assets/js/134.4af1c4e7.js similarity index 99% rename from assets/js/134.e2bdba24.js rename to assets/js/134.4af1c4e7.js index fba7df6..c91f5b5 100644 --- a/assets/js/134.e2bdba24.js +++ b/assets/js/134.4af1c4e7.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[134],{434:function(t,e,a){"use strict";a.r(e);var s=a(10),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"views"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#views"}},[t._v("#")]),t._v(" Views")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#directory-structure"}},[t._v("Directory Structure")]),e("ul",[e("li",[e("a",{attrs:{href:"#adding-html-content"}},[t._v("Adding HTML Content")])])])]),e("li",[e("a",{attrs:{href:"#load-views-from-package"}},[t._v("Load Views from Package")])]),e("li",[e("a",{attrs:{href:"#rendering-views"}},[t._v("Rendering Views")])]),e("li",[e("a",{attrs:{href:"#blade-file-naming-convention"}},[t._v("Blade File Naming Convention")]),e("ul",[e("li",[e("a",{attrs:{href:"#listing-index-blade"}},[t._v("Listing (Index Blade):")])]),e("li",[e("a",{attrs:{href:"#creation-create-blade"}},[t._v("Creation (Create Blade):")])]),e("li",[e("a",{attrs:{href:"#updating-edit-blade"}},[t._v("Updating (Edit Blade):")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Views in Laravel are responsible for separating the application's logic from the presentation layer. They provide a clean way to manage and organize the HTML content of your application. Views are typically stored in the "),e("code",[t._v("resources/views")]),t._v(" directory and are rendered using the Blade templating engine, which offers a simple and powerful way to create dynamic content.")]),t._v(" "),e("p",[t._v("By using views, you can create reusable templates and components, making your code more maintainable and easier to understand. Blade templates allow you to use control structures like loops and conditionals, as well as to include other templates, which helps to keep your views organized and modular.")]),t._v(" "),e("p",[t._v("To learn in detail about Views, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/views",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("Here's a basic example of a Blade template:")]),t._v(" "),e("h2",{attrs:{id:"directory-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[t._v("#")]),t._v(" Directory Structure")]),t._v(" "),e("p",[t._v("To organize the views for our "),e("code",[t._v("Category")]),t._v(" package, we need to set up a specific directory structure. Follow the steps below to create the necessary directories.")]),t._v(" "),e("h4",{attrs:{id:"create-the-resources-directory"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-resources-directory"}},[t._v("#")]),t._v(" Create the "),e("code",[t._v("Resources")]),t._v(" Directory")]),t._v(" "),e("ul",[e("li",[t._v("Navigate to the "),e("code",[t._v("packages/Webkul/Category/src")]),t._v(" directory.")]),t._v(" "),e("li",[t._v("Create a directory named "),e("code",[t._v("Resources")]),t._v(".")])]),t._v(" "),e("h4",{attrs:{id:"create-the-views-directory"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-views-directory"}},[t._v("#")]),t._v(" Create the "),e("code",[t._v("views")]),t._v(" Directory")]),t._v(" "),e("ul",[e("li",[t._v("Inside the "),e("code",[t._v("Resources")]),t._v(" directory, create another directory named "),e("code",[t._v("views")]),t._v(" and inside the views directory create category directory.")]),t._v(" "),e("li",[t._v("Inside the "),e("code",[t._v("views/category")]),t._v(" directory, create a file named "),e("code",[t._v("index.blade.php")]),t._v(", "),e("code",[t._v("create.blade.php")]),t._v(", "),e("code",[t._v("edit.blade.php")]),t._v(" .")])]),t._v(" "),e("p",[t._v("The updated directory structure will look like this:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\n └── Resources\n └── views\n └── category\n ├── create.blade.php\n ├── edit.blade.php\n └── index.blade.php\n")])])]),e("h3",{attrs:{id:"adding-html-content"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#adding-html-content"}},[t._v("#")]),t._v(" Adding HTML Content")]),t._v(" "),e("p",[t._v("Below is an example of basic HTML content that you can add to each "),e("code",[t._v("index.blade.php")]),t._v(" file.")]),t._v(" "),e("h4",{attrs:{id:"index-blade-php-in-the-category-directory"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#index-blade-php-in-the-category-directory"}},[t._v("#")]),t._v(" "),e("code",[t._v("index.blade.php")]),t._v(" in the "),e("code",[t._v("category")]),t._v(" Directory")]),t._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-admin:")]),t._v(":layouts")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-slot:")]),t._v("title")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n @lang('category::app.categories.index.title')\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- Content --\x3e")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("flex gap-4"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("h2",{attrs:{id:"load-views-from-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#load-views-from-package"}},[t._v("#")]),t._v(" Load Views from Package")]),t._v(" "),e("p",[t._v("To make the views in our package accessible, we need to register them in the service provider's "),e("code",[t._v("boot")]),t._v(" method. This involves updating the "),e("code",[t._v("CategoryServiceProvider.php")]),t._v(" file to include the view loading logic. Follow the steps below:")]),t._v(" "),e("h4",{attrs:{id:"open-the-service-provider-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#open-the-service-provider-file"}},[t._v("#")]),t._v(" Open the Service Provider File")]),t._v(" "),e("ul",[e("li",[t._v("Navigate to the "),e("code",[t._v("packages/Webkul/Category/src/Providers")]),t._v(" directory.")]),t._v(" "),e("li",[t._v("Open the "),e("code",[t._v("CategoryServiceProvider.php")]),t._v(" file.")])]),t._v(" "),e("h4",{attrs:{id:"update-the-boot-method"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update-the-boot-method"}},[t._v("#")]),t._v(" Update the "),e("code",[t._v("boot")]),t._v(" Method")]),t._v(" "),e("ul",[e("li",[t._v("Inside the "),e("code",[t._v("boot")]),t._v(" method of the "),e("code",[t._v("CategoryServiceProvider")]),t._v(" class, add the logic to load views from the package.")])]),t._v(" "),e("h4",{attrs:{id:"updated-categoryserviceprovider-php"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#updated-categoryserviceprovider-php"}},[t._v("#")]),t._v(" Updated "),e("code",[t._v("CategoryServiceProvider.php")])]),t._v(" "),e("p",[t._v("Here is the updated code for "),e("code",[t._v("CategoryServiceProvider.php")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("loadViewsFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/../Resources/views'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("h4",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("namespace")]),t._v(" keyword defines the namespace for the "),e("code",[t._v("CategoryServiceProvider")]),t._v(" class, which is "),e("code",[t._v("Webkul\\Category\\Providers")]),t._v(".")])]),t._v(" "),e("li",[e("p",[t._v("The "),e("code",[t._v("CategoryServiceProvider")]),t._v(" class extends Laravel's base "),e("code",[t._v("ServiceProvider")]),t._v(" class.")])]),t._v(" "),e("li",[e("p",[t._v("The "),e("code",[t._v("boot")]),t._v(" method is used to bootstrap any application services.")])]),t._v(" "),e("li",[e("p",[t._v("Inside the "),e("code",[t._v("boot")]),t._v(" method, we use the "),e("code",[t._v("$this->loadViewsFrom")]),t._v(" method to register the views from the package.")])]),t._v(" "),e("li",[e("p",[t._v("The "),e("code",[t._v("loadViewsFrom")]),t._v(" method takes two arguments:")]),t._v(" "),e("ul",[e("li",[t._v("The path to the views directory within the package: "),e("code",[t._v("__DIR__ . '/../Resources/views'")]),t._v(".")]),t._v(" "),e("li",[t._v("A namespace for the views: "),e("code",[t._v("'category'")]),t._v(".")])])])]),t._v(" "),e("h2",{attrs:{id:"rendering-views"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rendering-views"}},[t._v("#")]),t._v(" Rendering Views")]),t._v(" "),e("p",[t._v("In Laravel applications, views are typically rendered from controller methods using the "),e("code",[t._v("view")]),t._v(" helper function. This section describes how views are invoked and passed data from a controller.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("with")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'author'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("view")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::category.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("compact")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("h4",{attrs:{id:"explanation-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("view")]),t._v(" helper function in Laravel is used within the "),e("code",[t._v("index")]),t._v(" method of the "),e("code",[t._v("CategoryController")]),t._v(" to render the "),e("code",[t._v("category::category.index")]),t._v(" view.")])]),t._v(" "),e("li",[e("p",[t._v("It accepts two parameters the name of the view ("),e("code",[t._v("category::category.index")]),t._v(") and an array of data ("),e("code",[t._v("compact('categories')")]),t._v(") to pass to the "),e("code",[t._v("view")]),t._v(".")])])]),t._v(" "),e("h2",{attrs:{id:"blade-file-naming-convention"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#blade-file-naming-convention"}},[t._v("#")]),t._v(" Blade File Naming Convention")]),t._v(" "),e("p",[t._v("Krayin utilizes Blade templates to handle "),e("code",[t._v("listing")]),t._v(", "),e("code",[t._v("creation")]),t._v(", and "),e("code",[t._v("updating")]),t._v(" operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.")]),t._v(" "),e("h3",{attrs:{id:"listing-index-blade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#listing-index-blade"}},[t._v("#")]),t._v(" Listing (Index Blade):")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("index.blade.php")]),t._v(" template is used to display a list of all records (categories).")])]),t._v(" "),e("li",[e("p",[t._v("The controller's "),e("code",[t._v("index")]),t._v(" method fetches all categories and passes them to the view.")])])]),t._v(" "),e("h3",{attrs:{id:"creation-create-blade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#creation-create-blade"}},[t._v("#")]),t._v(" Creation (Create Blade):")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("create.blade.php")]),t._v(" template contains a form for creating new records.")])]),t._v(" "),e("li",[e("p",[t._v("The controller's "),e("code",[t._v("create")]),t._v(" method renders this view.")])])]),t._v(" "),e("h3",{attrs:{id:"updating-edit-blade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#updating-edit-blade"}},[t._v("#")]),t._v(" Updating (Edit Blade):")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("edit.blade.php")]),t._v(" template contains a form for editing existing records.")])]),t._v(" "),e("li",[e("p",[t._v("The controller's "),e("code",[t._v("edit")]),t._v(" method fetches the specific categories and passes it to the view.")])])]),t._v(" "),e("p",[t._v("By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[134],{436:function(t,e,a){"use strict";a.r(e);var s=a(10),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"views"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#views"}},[t._v("#")]),t._v(" Views")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#directory-structure"}},[t._v("Directory Structure")]),e("ul",[e("li",[e("a",{attrs:{href:"#adding-html-content"}},[t._v("Adding HTML Content")])])])]),e("li",[e("a",{attrs:{href:"#load-views-from-package"}},[t._v("Load Views from Package")])]),e("li",[e("a",{attrs:{href:"#rendering-views"}},[t._v("Rendering Views")])]),e("li",[e("a",{attrs:{href:"#blade-file-naming-convention"}},[t._v("Blade File Naming Convention")]),e("ul",[e("li",[e("a",{attrs:{href:"#listing-index-blade"}},[t._v("Listing (Index Blade):")])]),e("li",[e("a",{attrs:{href:"#creation-create-blade"}},[t._v("Creation (Create Blade):")])]),e("li",[e("a",{attrs:{href:"#updating-edit-blade"}},[t._v("Updating (Edit Blade):")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Views in Laravel are responsible for separating the application's logic from the presentation layer. They provide a clean way to manage and organize the HTML content of your application. Views are typically stored in the "),e("code",[t._v("resources/views")]),t._v(" directory and are rendered using the Blade templating engine, which offers a simple and powerful way to create dynamic content.")]),t._v(" "),e("p",[t._v("By using views, you can create reusable templates and components, making your code more maintainable and easier to understand. Blade templates allow you to use control structures like loops and conditionals, as well as to include other templates, which helps to keep your views organized and modular.")]),t._v(" "),e("p",[t._v("To learn in detail about Views, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/views",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("Here's a basic example of a Blade template:")]),t._v(" "),e("h2",{attrs:{id:"directory-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[t._v("#")]),t._v(" Directory Structure")]),t._v(" "),e("p",[t._v("To organize the views for our "),e("code",[t._v("Category")]),t._v(" package, we need to set up a specific directory structure. Follow the steps below to create the necessary directories.")]),t._v(" "),e("h4",{attrs:{id:"create-the-resources-directory"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-resources-directory"}},[t._v("#")]),t._v(" Create the "),e("code",[t._v("Resources")]),t._v(" Directory")]),t._v(" "),e("ul",[e("li",[t._v("Navigate to the "),e("code",[t._v("packages/Webkul/Category/src")]),t._v(" directory.")]),t._v(" "),e("li",[t._v("Create a directory named "),e("code",[t._v("Resources")]),t._v(".")])]),t._v(" "),e("h4",{attrs:{id:"create-the-views-directory"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-views-directory"}},[t._v("#")]),t._v(" Create the "),e("code",[t._v("views")]),t._v(" Directory")]),t._v(" "),e("ul",[e("li",[t._v("Inside the "),e("code",[t._v("Resources")]),t._v(" directory, create another directory named "),e("code",[t._v("views")]),t._v(" and inside the views directory create category directory.")]),t._v(" "),e("li",[t._v("Inside the "),e("code",[t._v("views/category")]),t._v(" directory, create a file named "),e("code",[t._v("index.blade.php")]),t._v(", "),e("code",[t._v("create.blade.php")]),t._v(", "),e("code",[t._v("edit.blade.php")]),t._v(" .")])]),t._v(" "),e("p",[t._v("The updated directory structure will look like this:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\n └── Resources\n └── views\n └── category\n ├── create.blade.php\n ├── edit.blade.php\n └── index.blade.php\n")])])]),e("h3",{attrs:{id:"adding-html-content"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#adding-html-content"}},[t._v("#")]),t._v(" Adding HTML Content")]),t._v(" "),e("p",[t._v("Below is an example of basic HTML content that you can add to each "),e("code",[t._v("index.blade.php")]),t._v(" file.")]),t._v(" "),e("h4",{attrs:{id:"index-blade-php-in-the-category-directory"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#index-blade-php-in-the-category-directory"}},[t._v("#")]),t._v(" "),e("code",[t._v("index.blade.php")]),t._v(" in the "),e("code",[t._v("category")]),t._v(" Directory")]),t._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-admin:")]),t._v(":layouts")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("x-slot:")]),t._v("title")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n @lang('category::app.categories.index.title')\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- Content --\x3e")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("flex gap-4"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("h2",{attrs:{id:"load-views-from-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#load-views-from-package"}},[t._v("#")]),t._v(" Load Views from Package")]),t._v(" "),e("p",[t._v("To make the views in our package accessible, we need to register them in the service provider's "),e("code",[t._v("boot")]),t._v(" method. This involves updating the "),e("code",[t._v("CategoryServiceProvider.php")]),t._v(" file to include the view loading logic. Follow the steps below:")]),t._v(" "),e("h4",{attrs:{id:"open-the-service-provider-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#open-the-service-provider-file"}},[t._v("#")]),t._v(" Open the Service Provider File")]),t._v(" "),e("ul",[e("li",[t._v("Navigate to the "),e("code",[t._v("packages/Webkul/Category/src/Providers")]),t._v(" directory.")]),t._v(" "),e("li",[t._v("Open the "),e("code",[t._v("CategoryServiceProvider.php")]),t._v(" file.")])]),t._v(" "),e("h4",{attrs:{id:"update-the-boot-method"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update-the-boot-method"}},[t._v("#")]),t._v(" Update the "),e("code",[t._v("boot")]),t._v(" Method")]),t._v(" "),e("ul",[e("li",[t._v("Inside the "),e("code",[t._v("boot")]),t._v(" method of the "),e("code",[t._v("CategoryServiceProvider")]),t._v(" class, add the logic to load views from the package.")])]),t._v(" "),e("h4",{attrs:{id:"updated-categoryserviceprovider-php"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#updated-categoryserviceprovider-php"}},[t._v("#")]),t._v(" Updated "),e("code",[t._v("CategoryServiceProvider.php")])]),t._v(" "),e("p",[t._v("Here is the updated code for "),e("code",[t._v("CategoryServiceProvider.php")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("loadViewsFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/../Resources/views'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("h4",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("namespace")]),t._v(" keyword defines the namespace for the "),e("code",[t._v("CategoryServiceProvider")]),t._v(" class, which is "),e("code",[t._v("Webkul\\Category\\Providers")]),t._v(".")])]),t._v(" "),e("li",[e("p",[t._v("The "),e("code",[t._v("CategoryServiceProvider")]),t._v(" class extends Laravel's base "),e("code",[t._v("ServiceProvider")]),t._v(" class.")])]),t._v(" "),e("li",[e("p",[t._v("The "),e("code",[t._v("boot")]),t._v(" method is used to bootstrap any application services.")])]),t._v(" "),e("li",[e("p",[t._v("Inside the "),e("code",[t._v("boot")]),t._v(" method, we use the "),e("code",[t._v("$this->loadViewsFrom")]),t._v(" method to register the views from the package.")])]),t._v(" "),e("li",[e("p",[t._v("The "),e("code",[t._v("loadViewsFrom")]),t._v(" method takes two arguments:")]),t._v(" "),e("ul",[e("li",[t._v("The path to the views directory within the package: "),e("code",[t._v("__DIR__ . '/../Resources/views'")]),t._v(".")]),t._v(" "),e("li",[t._v("A namespace for the views: "),e("code",[t._v("'category'")]),t._v(".")])])])]),t._v(" "),e("h2",{attrs:{id:"rendering-views"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rendering-views"}},[t._v("#")]),t._v(" Rendering Views")]),t._v(" "),e("p",[t._v("In Laravel applications, views are typically rendered from controller methods using the "),e("code",[t._v("view")]),t._v(" helper function. This section describes how views are invoked and passed data from a controller.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("with")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'author'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("view")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::category.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("compact")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("h4",{attrs:{id:"explanation-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("view")]),t._v(" helper function in Laravel is used within the "),e("code",[t._v("index")]),t._v(" method of the "),e("code",[t._v("CategoryController")]),t._v(" to render the "),e("code",[t._v("category::category.index")]),t._v(" view.")])]),t._v(" "),e("li",[e("p",[t._v("It accepts two parameters the name of the view ("),e("code",[t._v("category::category.index")]),t._v(") and an array of data ("),e("code",[t._v("compact('categories')")]),t._v(") to pass to the "),e("code",[t._v("view")]),t._v(".")])])]),t._v(" "),e("h2",{attrs:{id:"blade-file-naming-convention"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#blade-file-naming-convention"}},[t._v("#")]),t._v(" Blade File Naming Convention")]),t._v(" "),e("p",[t._v("Krayin utilizes Blade templates to handle "),e("code",[t._v("listing")]),t._v(", "),e("code",[t._v("creation")]),t._v(", and "),e("code",[t._v("updating")]),t._v(" operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.")]),t._v(" "),e("h3",{attrs:{id:"listing-index-blade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#listing-index-blade"}},[t._v("#")]),t._v(" Listing (Index Blade):")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("index.blade.php")]),t._v(" template is used to display a list of all records (categories).")])]),t._v(" "),e("li",[e("p",[t._v("The controller's "),e("code",[t._v("index")]),t._v(" method fetches all categories and passes them to the view.")])])]),t._v(" "),e("h3",{attrs:{id:"creation-create-blade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#creation-create-blade"}},[t._v("#")]),t._v(" Creation (Create Blade):")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("create.blade.php")]),t._v(" template contains a form for creating new records.")])]),t._v(" "),e("li",[e("p",[t._v("The controller's "),e("code",[t._v("create")]),t._v(" method renders this view.")])])]),t._v(" "),e("h3",{attrs:{id:"updating-edit-blade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#updating-edit-blade"}},[t._v("#")]),t._v(" Updating (Edit Blade):")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The "),e("code",[t._v("edit.blade.php")]),t._v(" template contains a form for editing existing records.")])]),t._v(" "),e("li",[e("p",[t._v("The controller's "),e("code",[t._v("edit")]),t._v(" method fetches the specific categories and passes it to the view.")])])]),t._v(" "),e("p",[t._v("By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/135.c50bd19f.js b/assets/js/135.86b91b5b.js similarity index 99% rename from assets/js/135.c50bd19f.js rename to assets/js/135.86b91b5b.js index a1d0b52..fc9870c 100644 --- a/assets/js/135.c50bd19f.js +++ b/assets/js/135.86b91b5b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[135],{432:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"prologue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#prologue"}},[e._v("#")]),e._v(" Prologue")]),e._v(" "),t("h2",{attrs:{id:"introduction-to-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction-to-krayin"}},[e._v("#")]),e._v(" Introduction to Krayin")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" CRM is a hand tailored CRM framework built on some of the hottest opensource technologies such as "),t("a",{attrs:{href:"https://laravel.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Laravel"),t("OutboundLink")],1),e._v(" (a PHP framework), "),t("a",{attrs:{href:"https://tailwindcss.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Tailwind Css"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Vue.js"),t("OutboundLink")],1),e._v(" a progressive Javascript framework.")]),e._v(" "),t("p",[e._v("Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.")]),e._v(" "),t("p",[e._v("We also have a forum for any type of concerns, feature requests, or discussions. Try our "),t("a",{attrs:{href:"https://demo.krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("demo"),t("OutboundLink")],1),e._v(" or you can visit: "),t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"key-features-of-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features-of-krayin"}},[e._v("#")]),e._v(" Key Features of Krayin")]),e._v(" "),t("p",[e._v("Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.")]),e._v(" "),t("h3",{attrs:{id:"crm-dashboard"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#crm-dashboard"}},[e._v("#")]),e._v(" CRM Dashboard")]),e._v(" "),t("p",[e._v("Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.")]),e._v(" "),t("h3",{attrs:{id:"convert-opportunities-into-revenue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#convert-opportunities-into-revenue"}},[e._v("#")]),e._v(" Convert Opportunities into Revenue")]),e._v(" "),t("p",[e._v("Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.")]),e._v(" "),t("h3",{attrs:{id:"manage-interaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manage-interaction"}},[e._v("#")]),e._v(" Manage Interaction")]),e._v(" "),t("p",[e._v("Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.")]),e._v(" "),t("h3",{attrs:{id:"access-control-list-acl"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-control-list-acl"}},[e._v("#")]),e._v(" Access Control List (ACL)")]),e._v(" "),t("p",[e._v("Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.")]),e._v(" "),t("h3",{attrs:{id:"activities-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#activities-management"}},[e._v("#")]),e._v(" Activities Management")]),e._v(" "),t("p",[e._v("Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.")]),e._v(" "),t("h3",{attrs:{id:"kanban-visual-leads"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#kanban-visual-leads"}},[e._v("#")]),e._v(" Kanban Visual Leads")]),e._v(" "),t("p",[e._v("The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.")]),e._v(" "),t("h3",{attrs:{id:"unlimited-custom-fields"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#unlimited-custom-fields"}},[e._v("#")]),e._v(" Unlimited Custom Fields")]),e._v(" "),t("p",[e._v("Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.")]),e._v(" "),t("h3",{attrs:{id:"product-creation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#product-creation"}},[e._v("#")]),e._v(" Product Creation")]),e._v(" "),t("p",[e._v("Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.")]),e._v(" "),t("h3",{attrs:{id:"contact-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#contact-management"}},[e._v("#")]),e._v(" Contact Management")]),e._v(" "),t("p",[e._v("Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.")]),e._v(" "),t("h3",{attrs:{id:"modular-design"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#modular-design"}},[e._v("#")]),e._v(" Modular Design")]),e._v(" "),t("p",[e._v("Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.")]),e._v(" "),t("h2",{attrs:{id:"community-and-support"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-and-support"}},[e._v("#")]),e._v(" Community and Support")]),e._v(" "),t("p",[e._v("Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Explore Krayin")]),e._v(": Visit our website at "),t("a",{attrs:{href:"https://krayincrm.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" to discover more about Krayin's features and experience a demo.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("GitHub Repository")]),e._v(": Access the Krayin repository on "),t("a",{attrs:{href:"https://github.com/krayin/laravel-crm",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub"),t("OutboundLink")],1),e._v(" with over 8.8K+ stars, reflecting its popularity and community support.")])])]),e._v(" "),t("p",[e._v("Join the Krayin community today and manage your customer relationships with ease.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[135],{435:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"prologue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#prologue"}},[e._v("#")]),e._v(" Prologue")]),e._v(" "),t("h2",{attrs:{id:"introduction-to-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction-to-krayin"}},[e._v("#")]),e._v(" Introduction to Krayin")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" CRM is a hand tailored CRM framework built on some of the hottest opensource technologies such as "),t("a",{attrs:{href:"https://laravel.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Laravel"),t("OutboundLink")],1),e._v(" (a PHP framework), "),t("a",{attrs:{href:"https://tailwindcss.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Tailwind Css"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Vue.js"),t("OutboundLink")],1),e._v(" a progressive Javascript framework.")]),e._v(" "),t("p",[e._v("Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.")]),e._v(" "),t("p",[e._v("We also have a forum for any type of concerns, feature requests, or discussions. Try our "),t("a",{attrs:{href:"https://demo.krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("demo"),t("OutboundLink")],1),e._v(" or you can visit: "),t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"key-features-of-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features-of-krayin"}},[e._v("#")]),e._v(" Key Features of Krayin")]),e._v(" "),t("p",[e._v("Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.")]),e._v(" "),t("h3",{attrs:{id:"crm-dashboard"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#crm-dashboard"}},[e._v("#")]),e._v(" CRM Dashboard")]),e._v(" "),t("p",[e._v("Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.")]),e._v(" "),t("h3",{attrs:{id:"convert-opportunities-into-revenue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#convert-opportunities-into-revenue"}},[e._v("#")]),e._v(" Convert Opportunities into Revenue")]),e._v(" "),t("p",[e._v("Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.")]),e._v(" "),t("h3",{attrs:{id:"manage-interaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manage-interaction"}},[e._v("#")]),e._v(" Manage Interaction")]),e._v(" "),t("p",[e._v("Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.")]),e._v(" "),t("h3",{attrs:{id:"access-control-list-acl"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-control-list-acl"}},[e._v("#")]),e._v(" Access Control List (ACL)")]),e._v(" "),t("p",[e._v("Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.")]),e._v(" "),t("h3",{attrs:{id:"activities-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#activities-management"}},[e._v("#")]),e._v(" Activities Management")]),e._v(" "),t("p",[e._v("Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.")]),e._v(" "),t("h3",{attrs:{id:"kanban-visual-leads"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#kanban-visual-leads"}},[e._v("#")]),e._v(" Kanban Visual Leads")]),e._v(" "),t("p",[e._v("The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.")]),e._v(" "),t("h3",{attrs:{id:"unlimited-custom-fields"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#unlimited-custom-fields"}},[e._v("#")]),e._v(" Unlimited Custom Fields")]),e._v(" "),t("p",[e._v("Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.")]),e._v(" "),t("h3",{attrs:{id:"product-creation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#product-creation"}},[e._v("#")]),e._v(" Product Creation")]),e._v(" "),t("p",[e._v("Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.")]),e._v(" "),t("h3",{attrs:{id:"contact-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#contact-management"}},[e._v("#")]),e._v(" Contact Management")]),e._v(" "),t("p",[e._v("Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.")]),e._v(" "),t("h3",{attrs:{id:"modular-design"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#modular-design"}},[e._v("#")]),e._v(" Modular Design")]),e._v(" "),t("p",[e._v("Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.")]),e._v(" "),t("h2",{attrs:{id:"community-and-support"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-and-support"}},[e._v("#")]),e._v(" Community and Support")]),e._v(" "),t("p",[e._v("Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Explore Krayin")]),e._v(": Visit our website at "),t("a",{attrs:{href:"https://krayincrm.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" to discover more about Krayin's features and experience a demo.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("GitHub Repository")]),e._v(": Access the Krayin repository on "),t("a",{attrs:{href:"https://github.com/krayin/laravel-crm",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub"),t("OutboundLink")],1),e._v(" with over 8.8K+ stars, reflecting its popularity and community support.")])])]),e._v(" "),t("p",[e._v("Join the Krayin community today and manage your customer relationships with ease.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/136.397269c4.js b/assets/js/136.8bf40b8d.js similarity index 99% rename from assets/js/136.397269c4.js rename to assets/js/136.8bf40b8d.js index 82ac8fc..2a6bfc7 100644 --- a/assets/js/136.397269c4.js +++ b/assets/js/136.8bf40b8d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[136],{435:function(t,e,a){"use strict";a.r(e);var r=a(10),s=Object(r.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"contribution-guide"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contribution-guide"}},[t._v("#")]),t._v(" Contribution Guide")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#bug-reports"}},[t._v("Bug Reports")])]),e("li",[e("a",{attrs:{href:"#projects-to-contribute"}},[t._v("Projects to Contribute")])]),e("li",[e("a",{attrs:{href:"#feature-requests"}},[t._v("Feature Requests")])]),e("li",[e("a",{attrs:{href:"#branch-selection"}},[t._v("Branch Selection")])]),e("li",[e("a",{attrs:{href:"#compiled-assets"}},[t._v("Compiled Assets")])]),e("li",[e("a",{attrs:{href:"#tailwind-class-reordering"}},[t._v("Tailwind Class Reordering")])]),e("li",[e("a",{attrs:{href:"#pint-tests"}},[t._v("Pint Tests")])]),e("li",[e("a",{attrs:{href:"#security-vulnerabilities"}},[t._v("Security Vulnerabilities")])]),e("li",[e("a",{attrs:{href:"#coding-style"}},[t._v("Coding Style")])]),e("li",[e("a",{attrs:{href:"#phpdoc"}},[t._v("PHPDoc")])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"bug-reports"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bug-reports"}},[t._v("#")]),t._v(" Bug Reports")]),t._v(" "),e("p",[t._v("At Krayin, we highly value active collaboration among our community members to continually enhance our platform's performance and reliability. To facilitate this collaborative effort, we extend a warm invitation to both report bugs and submit pull requests.")]),t._v(" "),e("p",[t._v("Rather than solely reporting bugs, we encourage you to take an active role in resolving issues by submitting pull requests containing fixes or negative test cases that effectively highlight the problem. This approach not only identifies issues but also provides practical solutions for their resolution.")]),t._v(" "),e("p",[t._v("When filing a bug report, we kindly request you to include a clear and descriptive title, along with a detailed description of the encountered problem. Additionally, please provide as much relevant information as possible, including a code sample that can reproduce the bug. Such comprehensive reports significantly expedite the troubleshooting process and enable swift resolution.")]),t._v(" "),e("p",[t._v("It is our collective goal to foster collaboration and find effective solutions to the challenges encountered. By actively participating in bug reporting, you not only engage fellow community members in problem-solving but also contribute significantly to the ongoing enhancement of the Krayin project.")]),t._v(" "),e("h2",{attrs:{id:"projects-to-contribute"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#projects-to-contribute"}},[t._v("#")]),t._v(" Projects to Contribute")]),t._v(" "),e("p",[t._v("You can contribute to the following projects:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/krayin/laravel-crm/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/krayin/krayin-docs",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin docs"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/krayin/rest-api",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin rest-api"),e("OutboundLink")],1)])]),t._v(" "),e("h2",{attrs:{id:"feature-requests"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#feature-requests"}},[t._v("#")]),t._v(" Feature Requests")]),t._v(" "),e("p",[t._v("We welcome proposals for new features and enhancements to the existing Krayin app. If you have a new feature in mind, please be prepared to contribute some of the code required to implement it.")]),t._v(" "),e("h2",{attrs:{id:"branch-selection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#branch-selection"}},[t._v("#")]),t._v(" Branch Selection")]),t._v(" "),e("p",[t._v("Before submitting a pull request, it's important to consider the following points to help you choose the appropriate branch:")]),t._v(" "),e("ul",[e("li",[e("strong",[t._v("Bug Fixes")]),t._v(": If you're fixing a bug, make sure to port the fix to the master version.")]),t._v(" "),e("li",[e("strong",[t._v("Critical Bug Fixes")]),t._v(": If you're fixing a critical bug, make sure to port the fix to the latest stable version that supports it (currently vmaster).")]),t._v(" "),e("li",[e("strong",[t._v("Feature Requests")]),t._v(": If your request involves a feature with potential breaking changes, send it to the master branch, which corresponds to the upcoming release (v2.1).")])]),t._v(" "),e("h2",{attrs:{id:"compiled-assets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#compiled-assets"}},[t._v("#")]),t._v(" Compiled Assets")]),t._v(" "),e("p",[t._v("To determine the sorting order for Tailwind CSS classes, consult the official Tailwind CSS documentation for guidelines on class organization. Additionally, consider using the Tailwind Raw Reorder extension for VS Code to streamline the sorting process.")]),t._v(" "),e("h2",{attrs:{id:"tailwind-class-reordering"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tailwind-class-reordering"}},[t._v("#")]),t._v(" Tailwind Class Reordering")]),t._v(" "),e("p",[t._v("When making changes to blade files that utilize Tailwind CSS classes, it's essential to maintain consistency and organization. Tailwind CSS classes should be ordered according to a predefined structure to enhance readability and maintain a clean codebase.")]),t._v(" "),e("p",[t._v("To determine how Tailwind CSS classes should be sorted, refer to the official Tailwind CSS documentation for guidelines on class ordering.")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://tailwindcss.com/blog/automatic-class-sorting-with-prettier#how-classes-are-sorted",target:"_blank",rel:"noopener noreferrer"}},[t._v("Class Reordering"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"pint-tests"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#pint-tests"}},[t._v("#")]),t._v(" Pint Tests")]),t._v(" "),e("p",[t._v("Pint tests are an essential part of ensuring the quality and reliability of code changes in Krayin. When making changes to the code, ensure that all Pint tests pass before submitting your pull request.Before submitting your changes, run the Pint tests locally to verify that all test cases pass. It is important to confirm that the modifications do not cause any Pint test failures or regressions.")]),t._v(" "),e("ul",[e("li",[t._v("To run the Pint tests locally, execute the following command in your terminal:")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("vendor"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("bin"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("pint\n")])])]),e("h2",{attrs:{id:"security-vulnerabilities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#security-vulnerabilities"}},[t._v("#")]),t._v(" Security Vulnerabilities")]),t._v(" "),e("p",[t._v("If you discover a security vulnerability within Krayin, please notify us immediately by sending an email to Jitendra Singh at "),e("a",{attrs:{href:"mailto:jitendra@webkul.in"}},[t._v("jitendra@webkul.in")]),t._v(". We take security vulnerabilities seriously and will address them promptly.")]),t._v(" "),e("h2",{attrs:{id:"coding-style"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#coding-style"}},[t._v("#")]),t._v(" Coding Style")]),t._v(" "),e("p",[t._v("Krayin follows the "),e("a",{attrs:{href:"https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("PSR-2"),e("OutboundLink")],1),t._v(" coding standard and the "),e("a",{attrs:{href:"https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("PSR-4"),e("OutboundLink")],1),t._v(" autoloading standard. These standards ensure consistency and readability in the codebase, similar to Laravel.")]),t._v(" "),e("h2",{attrs:{id:"phpdoc"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#phpdoc"}},[t._v("#")]),t._v(" PHPDoc")]),t._v(" "),e("p",[t._v("Below is an example of a valid Krayin doc block that follows the coding style:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register a service with CoreServiceProvider.\n *\n * @param string|array $loader\n * @param \\Closure|string|null $concrete\n * @param bool $shared\n */")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("registerFacades")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$loader")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$concrete")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$shared")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("false")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword return-type"}},[t._v("void")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[136],{434:function(t,e,a){"use strict";a.r(e);var r=a(10),s=Object(r.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"contribution-guide"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contribution-guide"}},[t._v("#")]),t._v(" Contribution Guide")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#bug-reports"}},[t._v("Bug Reports")])]),e("li",[e("a",{attrs:{href:"#projects-to-contribute"}},[t._v("Projects to Contribute")])]),e("li",[e("a",{attrs:{href:"#feature-requests"}},[t._v("Feature Requests")])]),e("li",[e("a",{attrs:{href:"#branch-selection"}},[t._v("Branch Selection")])]),e("li",[e("a",{attrs:{href:"#compiled-assets"}},[t._v("Compiled Assets")])]),e("li",[e("a",{attrs:{href:"#tailwind-class-reordering"}},[t._v("Tailwind Class Reordering")])]),e("li",[e("a",{attrs:{href:"#pint-tests"}},[t._v("Pint Tests")])]),e("li",[e("a",{attrs:{href:"#security-vulnerabilities"}},[t._v("Security Vulnerabilities")])]),e("li",[e("a",{attrs:{href:"#coding-style"}},[t._v("Coding Style")])]),e("li",[e("a",{attrs:{href:"#phpdoc"}},[t._v("PHPDoc")])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"bug-reports"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bug-reports"}},[t._v("#")]),t._v(" Bug Reports")]),t._v(" "),e("p",[t._v("At Krayin, we highly value active collaboration among our community members to continually enhance our platform's performance and reliability. To facilitate this collaborative effort, we extend a warm invitation to both report bugs and submit pull requests.")]),t._v(" "),e("p",[t._v("Rather than solely reporting bugs, we encourage you to take an active role in resolving issues by submitting pull requests containing fixes or negative test cases that effectively highlight the problem. This approach not only identifies issues but also provides practical solutions for their resolution.")]),t._v(" "),e("p",[t._v("When filing a bug report, we kindly request you to include a clear and descriptive title, along with a detailed description of the encountered problem. Additionally, please provide as much relevant information as possible, including a code sample that can reproduce the bug. Such comprehensive reports significantly expedite the troubleshooting process and enable swift resolution.")]),t._v(" "),e("p",[t._v("It is our collective goal to foster collaboration and find effective solutions to the challenges encountered. By actively participating in bug reporting, you not only engage fellow community members in problem-solving but also contribute significantly to the ongoing enhancement of the Krayin project.")]),t._v(" "),e("h2",{attrs:{id:"projects-to-contribute"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#projects-to-contribute"}},[t._v("#")]),t._v(" Projects to Contribute")]),t._v(" "),e("p",[t._v("You can contribute to the following projects:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/krayin/laravel-crm/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/krayin/krayin-docs",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin docs"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/krayin/rest-api",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin rest-api"),e("OutboundLink")],1)])]),t._v(" "),e("h2",{attrs:{id:"feature-requests"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#feature-requests"}},[t._v("#")]),t._v(" Feature Requests")]),t._v(" "),e("p",[t._v("We welcome proposals for new features and enhancements to the existing Krayin app. If you have a new feature in mind, please be prepared to contribute some of the code required to implement it.")]),t._v(" "),e("h2",{attrs:{id:"branch-selection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#branch-selection"}},[t._v("#")]),t._v(" Branch Selection")]),t._v(" "),e("p",[t._v("Before submitting a pull request, it's important to consider the following points to help you choose the appropriate branch:")]),t._v(" "),e("ul",[e("li",[e("strong",[t._v("Bug Fixes")]),t._v(": If you're fixing a bug, make sure to port the fix to the master version.")]),t._v(" "),e("li",[e("strong",[t._v("Critical Bug Fixes")]),t._v(": If you're fixing a critical bug, make sure to port the fix to the latest stable version that supports it (currently vmaster).")]),t._v(" "),e("li",[e("strong",[t._v("Feature Requests")]),t._v(": If your request involves a feature with potential breaking changes, send it to the master branch, which corresponds to the upcoming release (v2.1).")])]),t._v(" "),e("h2",{attrs:{id:"compiled-assets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#compiled-assets"}},[t._v("#")]),t._v(" Compiled Assets")]),t._v(" "),e("p",[t._v("To determine the sorting order for Tailwind CSS classes, consult the official Tailwind CSS documentation for guidelines on class organization. Additionally, consider using the Tailwind Raw Reorder extension for VS Code to streamline the sorting process.")]),t._v(" "),e("h2",{attrs:{id:"tailwind-class-reordering"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tailwind-class-reordering"}},[t._v("#")]),t._v(" Tailwind Class Reordering")]),t._v(" "),e("p",[t._v("When making changes to blade files that utilize Tailwind CSS classes, it's essential to maintain consistency and organization. Tailwind CSS classes should be ordered according to a predefined structure to enhance readability and maintain a clean codebase.")]),t._v(" "),e("p",[t._v("To determine how Tailwind CSS classes should be sorted, refer to the official Tailwind CSS documentation for guidelines on class ordering.")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://tailwindcss.com/blog/automatic-class-sorting-with-prettier#how-classes-are-sorted",target:"_blank",rel:"noopener noreferrer"}},[t._v("Class Reordering"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"pint-tests"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#pint-tests"}},[t._v("#")]),t._v(" Pint Tests")]),t._v(" "),e("p",[t._v("Pint tests are an essential part of ensuring the quality and reliability of code changes in Krayin. When making changes to the code, ensure that all Pint tests pass before submitting your pull request.Before submitting your changes, run the Pint tests locally to verify that all test cases pass. It is important to confirm that the modifications do not cause any Pint test failures or regressions.")]),t._v(" "),e("ul",[e("li",[t._v("To run the Pint tests locally, execute the following command in your terminal:")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("vendor"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("bin"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("pint\n")])])]),e("h2",{attrs:{id:"security-vulnerabilities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#security-vulnerabilities"}},[t._v("#")]),t._v(" Security Vulnerabilities")]),t._v(" "),e("p",[t._v("If you discover a security vulnerability within Krayin, please notify us immediately by sending an email to Jitendra Singh at "),e("a",{attrs:{href:"mailto:jitendra@webkul.in"}},[t._v("jitendra@webkul.in")]),t._v(". We take security vulnerabilities seriously and will address them promptly.")]),t._v(" "),e("h2",{attrs:{id:"coding-style"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#coding-style"}},[t._v("#")]),t._v(" Coding Style")]),t._v(" "),e("p",[t._v("Krayin follows the "),e("a",{attrs:{href:"https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("PSR-2"),e("OutboundLink")],1),t._v(" coding standard and the "),e("a",{attrs:{href:"https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("PSR-4"),e("OutboundLink")],1),t._v(" autoloading standard. These standards ensure consistency and readability in the codebase, similar to Laravel.")]),t._v(" "),e("h2",{attrs:{id:"phpdoc"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#phpdoc"}},[t._v("#")]),t._v(" PHPDoc")]),t._v(" "),e("p",[t._v("Below is an example of a valid Krayin doc block that follows the coding style:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register a service with CoreServiceProvider.\n *\n * @param string|array $loader\n * @param \\Closure|string|null $concrete\n * @param bool $shared\n */")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("registerFacades")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$loader")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$concrete")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$shared")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("false")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword return-type"}},[t._v("void")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/137.91fb202f.js b/assets/js/137.6b578a62.js similarity index 99% rename from assets/js/137.91fb202f.js rename to assets/js/137.6b578a62.js index 8683c5f..5718883 100644 --- a/assets/js/137.91fb202f.js +++ b/assets/js/137.6b578a62.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[137],{436:function(e,t,a){"use strict";a.r(t);var o=a(10),s=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"upgrade-guide"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrade-guide"}},[e._v("#")]),e._v(" Upgrade Guide")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#upgrade-steps"}},[e._v("Upgrade Steps")])]),t("li",[t("a",{attrs:{href:"#composer-dependencies"}},[e._v("Composer Dependencies")]),t("ul",[t("li",[t("a",{attrs:{href:"#differences-in-composer-dependencies"}},[e._v("Differences in Composer Dependencies")])]),t("li",[t("a",{attrs:{href:"#differences-in-development-dependencies"}},[e._v("Differences in Development Dependencies")])]),t("li",[t("a",{attrs:{href:"#differences-in-autoloading"}},[e._v("Differences in Autoloading")])]),t("li",[t("a",{attrs:{href:"#summary-of-changes"}},[e._v("Summary of Changes")])]),t("li",[t("a",{attrs:{href:"#upgrade-instructions"}},[e._v("Upgrade Instructions")])]),t("li",[t("a",{attrs:{href:"#conclusion"}},[e._v("Conclusion")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"upgrade-steps"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrade-steps"}},[e._v("#")]),e._v(" Upgrade Steps")]),e._v(" "),t("p",[e._v("To upgrade your current version to the latest version of Krayin, follow these steps:")]),e._v(" "),t("ol",[t("li",[t("p",[e._v("Download the latest version of Krayin from one of the following links:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://krayincrm.com/download/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download From Official Krayin Site"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/krayin/laravel-crm",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download From GitHub"),t("OutboundLink")],1)])])]),e._v(" "),t("li",[t("p",[e._v("Extract the downloaded Krayin zip file to the desired deployment location.")])]),e._v(" "),t("li",[t("p",[e._v("Open the terminal and navigate to the root dictory of the extracted Krayin dictory.")])]),e._v(" "),t("li",[t("p",[e._v("Run the following command in the terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("composer")]),e._v(" create-project\n")])])]),t("p",[e._v("This command will install the necessary dependencies for the latest version of Krayin.")])]),e._v(" "),t("li",[t("p",[e._v("Open the "),t("strong",[t("code",[e._v(".env")])]),e._v(" file in your project's root dictory. Provide the database credentials of your old project, which you want to upgrade using Krayin.")])]),e._v(" "),t("li",[t("p",[e._v("Run one of the following commands to cache the new changes:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan optimize\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# -- OR --")]),e._v("\n\nphp artisan config:cache\n")])])]),t("p",[e._v("These commands will cache the configuration files and optimize the project.")])]),e._v(" "),t("li",[t("p",[e._v("Now, your project is ready to run the migration command. Execute the following command in the terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan migrate\n")])])]),t("div",{staticClass:"custom-block danger"},[t("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),t("p",[e._v("Be cautious when using the seeder command as it may reset settings and categories. Add default settings manually if necessary.")])])]),e._v(" "),t("li",[t("p",[e._v("Create a symbolic link to link public assets to the storage dictory by running the following command:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan storage:link\n")])])])]),e._v(" "),t("li",[t("p",[e._v("Copy the contents of the previous version's dictory (e.g., "),t("strong",[t("code",[e._v("old-project/storage/app/public")])]),e._v(") to the corresponding dictory in the latest version (e.g., "),t("strong",[t("code",[e._v("new-project/storage/app/public")])]),e._v(").")]),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("TIP")]),e._v(" "),t("p",[e._v("If your existing project depends on local storage, has changed paths, or requires previous logs, ensure to include those as well.")])])]),e._v(" "),t("li",[t("p",[e._v("Once the copying is complete, publish the new files by running the following command:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan vendor:publish "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--all")]),e._v("\n")])])]),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),t("p",[e._v("Avoid using the "),t("strong",[t("code",[e._v("--force")])]),e._v(" flag, as it will reset all your views. Only use it if you understand the consequences.")])])]),e._v(" "),t("li",[t("p",[e._v("Congratulations! Your project is now upgraded to the latest version of Krayin. However, keep in mind that if you have made significant customizations, ensure compatibility with the latest version.")])])]),e._v(" "),t("h2",{attrs:{id:"composer-dependencies"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#composer-dependencies"}},[e._v("#")]),e._v(" Composer Dependencies")]),e._v(" "),t("p",[e._v("This documentation compares the dependencies between the old and latest versions of a Laravel-based project and provides guidance on the differences and upgrade paths.")]),e._v(" "),t("h3",{attrs:{id:"differences-in-composer-dependencies"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#differences-in-composer-dependencies"}},[e._v("#")]),e._v(" Differences in Composer Dependencies")]),e._v(" "),t("p",[e._v("Here’s a detailed comparison between the two projects:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Dependency")]),e._v(" "),t("th",[e._v("Old Project Version")]),e._v(" "),t("th",[e._v("Latest Project Version")]),e._v(" "),t("th",[e._v("Difference/Notes")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[t("strong",[e._v("PHP")])]),e._v(" "),t("td",[t("code",[e._v("^8.1")])]),e._v(" "),t("td",[t("code",[e._v("^8.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("barryvdh/laravel-dompdf")])]),e._v(" "),t("td",[t("code",[e._v("^master.0")])]),e._v(" "),t("td",[t("code",[e._v("^master.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("diglactic/laravel-breadcrumbs")])]),e._v(" "),t("td",[t("code",[e._v("^8.0")])]),e._v(" "),t("td",[t("code",[e._v("^8.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("doctrine/dbal")])]),e._v(" "),t("td",[t("code",[e._v("^3.0")])]),e._v(" "),t("td",[t("code",[e._v("^3.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("guzzlehttp/guzzle")])]),e._v(" "),t("td",[t("code",[e._v("^7.0.1")])]),e._v(" "),t("td",[t("code",[e._v("^7.0.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("khaled.alshamaa/ar-php")])]),e._v(" "),t("td",[t("strong",[e._v("Not Present")])]),e._v(" "),t("td",[t("code",[e._v("^6.3")])]),e._v(" "),t("td",[e._v("Newly added in the latest project.")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("konekt/concord")])]),e._v(" "),t("td",[t("code",[e._v("^1.10")])]),e._v(" "),t("td",[t("code",[e._v("^1.10")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("krayin/rest-api")])]),e._v(" "),t("td",[t("code",[e._v("dev-master")])]),e._v(" "),t("td",[t("strong",[e._v("Removed")])]),e._v(" "),t("td",[e._v("The "),t("code",[e._v("krayin/rest-api")]),e._v(" package is not included in the latest project.")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/framework")])]),e._v(" "),t("td",[t("code",[e._v("^10.0")])]),e._v(" "),t("td",[t("code",[e._v("^10.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/sanctum")])]),e._v(" "),t("td",[t("code",[e._v("^3.2")])]),e._v(" "),t("td",[t("code",[e._v("^3.2")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/tinker")])]),e._v(" "),t("td",[t("code",[e._v("^2.5")])]),e._v(" "),t("td",[t("code",[e._v("^2.5")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/ui")])]),e._v(" "),t("td",[t("code",[e._v("^4.0")])]),e._v(" "),t("td",[t("code",[e._v("^4.5")])]),e._v(" "),t("td",[e._v("Upgraded from "),t("code",[e._v("^4.0")]),e._v(" to "),t("code",[e._v("^4.5")])])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("maatwebsite/excel")])]),e._v(" "),t("td",[t("code",[e._v("^3.1")])]),e._v(" "),t("td",[t("code",[e._v("^3.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("mpdf/mpdf")])]),e._v(" "),t("td",[t("strong",[e._v("Not Present")])]),e._v(" "),t("td",[t("code",[e._v("^8.2")])]),e._v(" "),t("td",[e._v("Newly added in the latest project.")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("prettus/l5-repository")])]),e._v(" "),t("td",[t("code",[e._v("^2.7.9")])]),e._v(" "),t("td",[t("code",[e._v("^2.7.9")])]),e._v(" "),t("td",[e._v("No change")])])])]),e._v(" "),t("h3",{attrs:{id:"differences-in-development-dependencies"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#differences-in-development-dependencies"}},[e._v("#")]),e._v(" Differences in Development Dependencies")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Dependency")]),e._v(" "),t("th",[e._v("Old Project Version")]),e._v(" "),t("th",[e._v("Latest Project Version")]),e._v(" "),t("th",[e._v("Difference/Notes")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[t("strong",[e._v("barryvdh/laravel-debugbar")])]),e._v(" "),t("td",[t("code",[e._v("^3.6")])]),e._v(" "),t("td",[t("code",[e._v("^3.6")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("fakerphp/faker")])]),e._v(" "),t("td",[t("code",[e._v("^1.9.1")])]),e._v(" "),t("td",[t("code",[e._v("^1.9.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("krayin/krayin-package-generator")])]),e._v(" "),t("td",[t("code",[e._v("dev-master")])]),e._v(" "),t("td",[t("code",[e._v("dev-master")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/pint")])]),e._v(" "),t("td",[t("strong",[e._v("Not Present")])]),e._v(" "),t("td",[t("code",[e._v("^1.16")])]),e._v(" "),t("td",[e._v("Newly added in the latest project.")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/sail")])]),e._v(" "),t("td",[t("code",[e._v("^1.0.1")])]),e._v(" "),t("td",[t("code",[e._v("^1.0.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("mockery/mockery")])]),e._v(" "),t("td",[t("code",[e._v("^1.4.2")])]),e._v(" "),t("td",[t("code",[e._v("^1.4.2")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("nunomaduro/collision")])]),e._v(" "),t("td",[t("code",[e._v("^7.0")])]),e._v(" "),t("td",[t("code",[e._v("^7.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("pestphp/pest")])]),e._v(" "),t("td",[t("code",[e._v("^2.6")])]),e._v(" "),t("td",[t("code",[e._v("^2.6")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("pestphp/pest-plugin-laravel")])]),e._v(" "),t("td",[t("code",[e._v("^2.1")])]),e._v(" "),t("td",[t("code",[e._v("^2.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("phpunit/phpunit")])]),e._v(" "),t("td",[t("code",[e._v("^10.0")])]),e._v(" "),t("td",[t("code",[e._v("^10.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("spatie/laravel-ignition")])]),e._v(" "),t("td",[t("code",[e._v("^master")])]),e._v(" "),t("td",[t("code",[e._v("^master")])]),e._v(" "),t("td",[e._v("No change")])])])]),e._v(" "),t("h3",{attrs:{id:"differences-in-autoloading"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#differences-in-autoloading"}},[e._v("#")]),e._v(" Differences in Autoloading")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("New Packages in Latest Project:")]),e._v(" "),t("ul",[t("li",[t("code",[e._v('"Webkul\\\\Warehouse\\\\": "packages/Webkul/Warehouse/src",')])]),e._v(" "),t("li",[t("code",[e._v('"Webkul\\\\Automation\\\\": "packages/Webkul/Automation/src",')])]),e._v(" "),t("li",[t("code",[e._v('"Webkul\\\\DataGrid\\\\": "packages/Webkul/DataGrid/src"')])])])])]),e._v(" "),t("h3",{attrs:{id:"summary-of-changes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#summary-of-changes"}},[e._v("#")]),e._v(" Summary of Changes")]),e._v(" "),t("ol",[t("li",[t("p",[t("strong",[e._v("Removed Packages:")])]),e._v(" "),t("ul",[t("li",[t("code",[e._v("krayin/rest-api")]),e._v(" has been removed in the latest project.")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Added Packages:")])]),e._v(" "),t("ul",[t("li",[t("code",[e._v("khaled.alshamaa/ar-php")]),e._v(" was added in the latest project.")]),e._v(" "),t("li",[t("code",[e._v("mpdf/mpdf")]),e._v(" was added in the latest project.")]),e._v(" "),t("li",[t("code",[e._v("laravel/pint")]),e._v(" was added as a new development dependency.")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Updated Packages:")])]),e._v(" "),t("ul",[t("li",[t("code",[e._v("laravel/ui")]),e._v(" was upgraded from version "),t("code",[e._v("^4.0")]),e._v(" to "),t("code",[e._v("^4.5")]),e._v(".")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("New Autoloaded Packages:")])]),e._v(" "),t("ul",[t("li",[e._v("Added new autoload paths for "),t("code",[e._v("Webkul\\\\Warehouse")]),e._v(", "),t("code",[e._v("Webkul\\\\Automation")]),e._v(", and "),t("code",[e._v("Webkul\\\\DataGrid")]),e._v(".")])])])]),e._v(" "),t("h3",{attrs:{id:"upgrade-instructions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrade-instructions"}},[e._v("#")]),e._v(" Upgrade Instructions")]),e._v(" "),t("p",[e._v("To upgrade your project to the latest dependencies, follow these steps:")]),e._v(" "),t("ol",[t("li",[t("p",[t("strong",[e._v("Update "),t("code",[e._v("composer.json")]),e._v(":")])]),e._v(" "),t("ul",[t("li",[e._v("Replace the old package list with the updated one provided in the latest project.")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Run Composer Update:")])]),e._v(" "),t("ul",[t("li",[e._v("Execute the following command to update your dependencies:"),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("composer")]),e._v(" update\n")])])])])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Verify Autoloading:")])]),e._v(" "),t("ul",[t("li",[e._v("Ensure that the new autoload paths are properly configured by running:"),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("composer")]),e._v(" dump-autoload\n")])])])])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Test Your Project:")])]),e._v(" "),t("ul",[t("li",[e._v("After updating dependencies, thoroughly test your project to ensure that the changes do not introduce any issues.")])])])]),e._v(" "),t("h3",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("By following these instructions, your project will be updated to use the latest dependencies and autoload configurations. Ensure that you perform adequate testing after the update to confirm everything is functioning as expected.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[137],{433:function(e,t,a){"use strict";a.r(t);var o=a(10),s=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"upgrade-guide"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrade-guide"}},[e._v("#")]),e._v(" Upgrade Guide")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#upgrade-steps"}},[e._v("Upgrade Steps")])]),t("li",[t("a",{attrs:{href:"#composer-dependencies"}},[e._v("Composer Dependencies")]),t("ul",[t("li",[t("a",{attrs:{href:"#differences-in-composer-dependencies"}},[e._v("Differences in Composer Dependencies")])]),t("li",[t("a",{attrs:{href:"#differences-in-development-dependencies"}},[e._v("Differences in Development Dependencies")])]),t("li",[t("a",{attrs:{href:"#differences-in-autoloading"}},[e._v("Differences in Autoloading")])]),t("li",[t("a",{attrs:{href:"#summary-of-changes"}},[e._v("Summary of Changes")])]),t("li",[t("a",{attrs:{href:"#upgrade-instructions"}},[e._v("Upgrade Instructions")])]),t("li",[t("a",{attrs:{href:"#conclusion"}},[e._v("Conclusion")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"upgrade-steps"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrade-steps"}},[e._v("#")]),e._v(" Upgrade Steps")]),e._v(" "),t("p",[e._v("To upgrade your current version to the latest version of Krayin, follow these steps:")]),e._v(" "),t("ol",[t("li",[t("p",[e._v("Download the latest version of Krayin from one of the following links:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://krayincrm.com/download/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download From Official Krayin Site"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/krayin/laravel-crm",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download From GitHub"),t("OutboundLink")],1)])])]),e._v(" "),t("li",[t("p",[e._v("Extract the downloaded Krayin zip file to the desired deployment location.")])]),e._v(" "),t("li",[t("p",[e._v("Open the terminal and navigate to the root dictory of the extracted Krayin dictory.")])]),e._v(" "),t("li",[t("p",[e._v("Run the following command in the terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("composer")]),e._v(" create-project\n")])])]),t("p",[e._v("This command will install the necessary dependencies for the latest version of Krayin.")])]),e._v(" "),t("li",[t("p",[e._v("Open the "),t("strong",[t("code",[e._v(".env")])]),e._v(" file in your project's root dictory. Provide the database credentials of your old project, which you want to upgrade using Krayin.")])]),e._v(" "),t("li",[t("p",[e._v("Run one of the following commands to cache the new changes:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan optimize\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# -- OR --")]),e._v("\n\nphp artisan config:cache\n")])])]),t("p",[e._v("These commands will cache the configuration files and optimize the project.")])]),e._v(" "),t("li",[t("p",[e._v("Now, your project is ready to run the migration command. Execute the following command in the terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan migrate\n")])])]),t("div",{staticClass:"custom-block danger"},[t("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),t("p",[e._v("Be cautious when using the seeder command as it may reset settings and categories. Add default settings manually if necessary.")])])]),e._v(" "),t("li",[t("p",[e._v("Create a symbolic link to link public assets to the storage dictory by running the following command:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan storage:link\n")])])])]),e._v(" "),t("li",[t("p",[e._v("Copy the contents of the previous version's dictory (e.g., "),t("strong",[t("code",[e._v("old-project/storage/app/public")])]),e._v(") to the corresponding dictory in the latest version (e.g., "),t("strong",[t("code",[e._v("new-project/storage/app/public")])]),e._v(").")]),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("TIP")]),e._v(" "),t("p",[e._v("If your existing project depends on local storage, has changed paths, or requires previous logs, ensure to include those as well.")])])]),e._v(" "),t("li",[t("p",[e._v("Once the copying is complete, publish the new files by running the following command:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan vendor:publish "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--all")]),e._v("\n")])])]),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),t("p",[e._v("Avoid using the "),t("strong",[t("code",[e._v("--force")])]),e._v(" flag, as it will reset all your views. Only use it if you understand the consequences.")])])]),e._v(" "),t("li",[t("p",[e._v("Congratulations! Your project is now upgraded to the latest version of Krayin. However, keep in mind that if you have made significant customizations, ensure compatibility with the latest version.")])])]),e._v(" "),t("h2",{attrs:{id:"composer-dependencies"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#composer-dependencies"}},[e._v("#")]),e._v(" Composer Dependencies")]),e._v(" "),t("p",[e._v("This documentation compares the dependencies between the old and latest versions of a Laravel-based project and provides guidance on the differences and upgrade paths.")]),e._v(" "),t("h3",{attrs:{id:"differences-in-composer-dependencies"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#differences-in-composer-dependencies"}},[e._v("#")]),e._v(" Differences in Composer Dependencies")]),e._v(" "),t("p",[e._v("Here’s a detailed comparison between the two projects:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Dependency")]),e._v(" "),t("th",[e._v("Old Project Version")]),e._v(" "),t("th",[e._v("Latest Project Version")]),e._v(" "),t("th",[e._v("Difference/Notes")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[t("strong",[e._v("PHP")])]),e._v(" "),t("td",[t("code",[e._v("^8.1")])]),e._v(" "),t("td",[t("code",[e._v("^8.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("barryvdh/laravel-dompdf")])]),e._v(" "),t("td",[t("code",[e._v("^master.0")])]),e._v(" "),t("td",[t("code",[e._v("^master.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("diglactic/laravel-breadcrumbs")])]),e._v(" "),t("td",[t("code",[e._v("^8.0")])]),e._v(" "),t("td",[t("code",[e._v("^8.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("doctrine/dbal")])]),e._v(" "),t("td",[t("code",[e._v("^3.0")])]),e._v(" "),t("td",[t("code",[e._v("^3.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("guzzlehttp/guzzle")])]),e._v(" "),t("td",[t("code",[e._v("^7.0.1")])]),e._v(" "),t("td",[t("code",[e._v("^7.0.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("khaled.alshamaa/ar-php")])]),e._v(" "),t("td",[t("strong",[e._v("Not Present")])]),e._v(" "),t("td",[t("code",[e._v("^6.3")])]),e._v(" "),t("td",[e._v("Newly added in the latest project.")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("konekt/concord")])]),e._v(" "),t("td",[t("code",[e._v("^1.10")])]),e._v(" "),t("td",[t("code",[e._v("^1.10")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("krayin/rest-api")])]),e._v(" "),t("td",[t("code",[e._v("dev-master")])]),e._v(" "),t("td",[t("strong",[e._v("Removed")])]),e._v(" "),t("td",[e._v("The "),t("code",[e._v("krayin/rest-api")]),e._v(" package is not included in the latest project.")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/framework")])]),e._v(" "),t("td",[t("code",[e._v("^10.0")])]),e._v(" "),t("td",[t("code",[e._v("^10.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/sanctum")])]),e._v(" "),t("td",[t("code",[e._v("^3.2")])]),e._v(" "),t("td",[t("code",[e._v("^3.2")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/tinker")])]),e._v(" "),t("td",[t("code",[e._v("^2.5")])]),e._v(" "),t("td",[t("code",[e._v("^2.5")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/ui")])]),e._v(" "),t("td",[t("code",[e._v("^4.0")])]),e._v(" "),t("td",[t("code",[e._v("^4.5")])]),e._v(" "),t("td",[e._v("Upgraded from "),t("code",[e._v("^4.0")]),e._v(" to "),t("code",[e._v("^4.5")])])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("maatwebsite/excel")])]),e._v(" "),t("td",[t("code",[e._v("^3.1")])]),e._v(" "),t("td",[t("code",[e._v("^3.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("mpdf/mpdf")])]),e._v(" "),t("td",[t("strong",[e._v("Not Present")])]),e._v(" "),t("td",[t("code",[e._v("^8.2")])]),e._v(" "),t("td",[e._v("Newly added in the latest project.")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("prettus/l5-repository")])]),e._v(" "),t("td",[t("code",[e._v("^2.7.9")])]),e._v(" "),t("td",[t("code",[e._v("^2.7.9")])]),e._v(" "),t("td",[e._v("No change")])])])]),e._v(" "),t("h3",{attrs:{id:"differences-in-development-dependencies"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#differences-in-development-dependencies"}},[e._v("#")]),e._v(" Differences in Development Dependencies")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Dependency")]),e._v(" "),t("th",[e._v("Old Project Version")]),e._v(" "),t("th",[e._v("Latest Project Version")]),e._v(" "),t("th",[e._v("Difference/Notes")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[t("strong",[e._v("barryvdh/laravel-debugbar")])]),e._v(" "),t("td",[t("code",[e._v("^3.6")])]),e._v(" "),t("td",[t("code",[e._v("^3.6")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("fakerphp/faker")])]),e._v(" "),t("td",[t("code",[e._v("^1.9.1")])]),e._v(" "),t("td",[t("code",[e._v("^1.9.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("krayin/krayin-package-generator")])]),e._v(" "),t("td",[t("code",[e._v("dev-master")])]),e._v(" "),t("td",[t("code",[e._v("dev-master")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/pint")])]),e._v(" "),t("td",[t("strong",[e._v("Not Present")])]),e._v(" "),t("td",[t("code",[e._v("^1.16")])]),e._v(" "),t("td",[e._v("Newly added in the latest project.")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("laravel/sail")])]),e._v(" "),t("td",[t("code",[e._v("^1.0.1")])]),e._v(" "),t("td",[t("code",[e._v("^1.0.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("mockery/mockery")])]),e._v(" "),t("td",[t("code",[e._v("^1.4.2")])]),e._v(" "),t("td",[t("code",[e._v("^1.4.2")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("nunomaduro/collision")])]),e._v(" "),t("td",[t("code",[e._v("^7.0")])]),e._v(" "),t("td",[t("code",[e._v("^7.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("pestphp/pest")])]),e._v(" "),t("td",[t("code",[e._v("^2.6")])]),e._v(" "),t("td",[t("code",[e._v("^2.6")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("pestphp/pest-plugin-laravel")])]),e._v(" "),t("td",[t("code",[e._v("^2.1")])]),e._v(" "),t("td",[t("code",[e._v("^2.1")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("phpunit/phpunit")])]),e._v(" "),t("td",[t("code",[e._v("^10.0")])]),e._v(" "),t("td",[t("code",[e._v("^10.0")])]),e._v(" "),t("td",[e._v("No change")])]),e._v(" "),t("tr",[t("td",[t("strong",[e._v("spatie/laravel-ignition")])]),e._v(" "),t("td",[t("code",[e._v("^master")])]),e._v(" "),t("td",[t("code",[e._v("^master")])]),e._v(" "),t("td",[e._v("No change")])])])]),e._v(" "),t("h3",{attrs:{id:"differences-in-autoloading"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#differences-in-autoloading"}},[e._v("#")]),e._v(" Differences in Autoloading")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("New Packages in Latest Project:")]),e._v(" "),t("ul",[t("li",[t("code",[e._v('"Webkul\\\\Warehouse\\\\": "packages/Webkul/Warehouse/src",')])]),e._v(" "),t("li",[t("code",[e._v('"Webkul\\\\Automation\\\\": "packages/Webkul/Automation/src",')])]),e._v(" "),t("li",[t("code",[e._v('"Webkul\\\\DataGrid\\\\": "packages/Webkul/DataGrid/src"')])])])])]),e._v(" "),t("h3",{attrs:{id:"summary-of-changes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#summary-of-changes"}},[e._v("#")]),e._v(" Summary of Changes")]),e._v(" "),t("ol",[t("li",[t("p",[t("strong",[e._v("Removed Packages:")])]),e._v(" "),t("ul",[t("li",[t("code",[e._v("krayin/rest-api")]),e._v(" has been removed in the latest project.")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Added Packages:")])]),e._v(" "),t("ul",[t("li",[t("code",[e._v("khaled.alshamaa/ar-php")]),e._v(" was added in the latest project.")]),e._v(" "),t("li",[t("code",[e._v("mpdf/mpdf")]),e._v(" was added in the latest project.")]),e._v(" "),t("li",[t("code",[e._v("laravel/pint")]),e._v(" was added as a new development dependency.")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Updated Packages:")])]),e._v(" "),t("ul",[t("li",[t("code",[e._v("laravel/ui")]),e._v(" was upgraded from version "),t("code",[e._v("^4.0")]),e._v(" to "),t("code",[e._v("^4.5")]),e._v(".")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("New Autoloaded Packages:")])]),e._v(" "),t("ul",[t("li",[e._v("Added new autoload paths for "),t("code",[e._v("Webkul\\\\Warehouse")]),e._v(", "),t("code",[e._v("Webkul\\\\Automation")]),e._v(", and "),t("code",[e._v("Webkul\\\\DataGrid")]),e._v(".")])])])]),e._v(" "),t("h3",{attrs:{id:"upgrade-instructions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrade-instructions"}},[e._v("#")]),e._v(" Upgrade Instructions")]),e._v(" "),t("p",[e._v("To upgrade your project to the latest dependencies, follow these steps:")]),e._v(" "),t("ol",[t("li",[t("p",[t("strong",[e._v("Update "),t("code",[e._v("composer.json")]),e._v(":")])]),e._v(" "),t("ul",[t("li",[e._v("Replace the old package list with the updated one provided in the latest project.")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Run Composer Update:")])]),e._v(" "),t("ul",[t("li",[e._v("Execute the following command to update your dependencies:"),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("composer")]),e._v(" update\n")])])])])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Verify Autoloading:")])]),e._v(" "),t("ul",[t("li",[e._v("Ensure that the new autoload paths are properly configured by running:"),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("composer")]),e._v(" dump-autoload\n")])])])])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Test Your Project:")])]),e._v(" "),t("ul",[t("li",[e._v("After updating dependencies, thoroughly test your project to ensure that the changes do not introduce any issues.")])])])]),e._v(" "),t("h3",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("By following these instructions, your project will be updated to use the latest dependencies and autoload configurations. Ensure that you perform adequate testing after the update to confirm everything is functioning as expected.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/22.31867b2d.js b/assets/js/22.ca1708f8.js similarity index 99% rename from assets/js/22.31867b2d.js rename to assets/js/22.ca1708f8.js index 83d38ff..0189b4e 100644 --- a/assets/js/22.31867b2d.js +++ b/assets/js/22.ca1708f8.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{273:function(t,e,s){t.exports=s.p+"assets/img/limiting-error-messages.36e9c79d.jpg"},324:function(t,e,s){"use strict";s.r(e);var a=s(10),r=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"best-security-practices"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#best-security-practices"}},[t._v("#")]),t._v(" Best Security Practices")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#software-updates"}},[t._v("Software Updates")])]),e("li",[e("a",{attrs:{href:"#limiting-error-messages"}},[t._v("Limiting Error Messages")])]),e("li",[e("a",{attrs:{href:"#limiting-admin-access"}},[t._v("Limiting Admin Access")])]),e("li",[e("a",{attrs:{href:"#restricting-unnecessary-files"}},[t._v("Restricting Unnecessary Files")])]),e("li",[e("a",{attrs:{href:"#restricting-php-execution-inside-storage"}},[t._v("Restricting PHP Execution Inside Storage")])]),e("li",[e("a",{attrs:{href:"#server-hardening"}},[t._v("Server Hardening")])]),e("li",[e("a",{attrs:{href:"#strong-passwords"}},[t._v("Strong Passwords")])]),e("li",[e("a",{attrs:{href:"#implementation-of-http-security-headers"}},[t._v("Implementation of HTTP Security Headers")]),e("ul",[e("li",[e("a",{attrs:{href:"#http-strict-transport-security-hsts"}},[t._v("HTTP Strict Transport Security (HSTS)")])]),e("li",[e("a",{attrs:{href:"#cross-site-scripting-protection-x-xss-protection"}},[t._v("Cross-Site Scripting Protection (X-XSS Protection)")])]),e("li",[e("a",{attrs:{href:"#x-frame-options​"}},[t._v("X-Frame-Options​")])]),e("li",[e("a",{attrs:{href:"#x-content-type-options​"}},[t._v("X-Content-Type-Options​")])]),e("li",[e("a",{attrs:{href:"#content-security-policy-csp"}},[t._v("Content Security Policy (CSP)")])]),e("li",[e("a",{attrs:{href:"#continuous-logging-and-monitoring"}},[t._v("Continuous Logging And Monitoring")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"software-updates"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#software-updates"}},[t._v("#")]),t._v(" Software Updates")]),t._v(" "),e("p",[t._v("To ensure the security of your system, follow these best practices:")]),t._v(" "),e("ul",[e("li",[t._v("Use HTTPS to encrypt communication. Google now considers HTTPS as a ranking factor.")]),t._v(" "),e("li",[t._v("Keep all software on the server up-to-date, including Krayin, the database, Adminer/phpMyAdmin, Apache, Redis, etc.")]),t._v(" "),e("li",[t._v("Regularly update the server operating system to apply available security patches.")]),t._v(" "),e("li",[t._v("Manage files only through secure communication protocols like SSH, SFTP, or HTTPS. Disable FTP.")]),t._v(" "),e("li",[t._v("Use the "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file to protect system files when using the Apache web server.")]),t._v(" "),e("li",[t._v("Disable unused ports and stop unnecessary services running on the server.")]),t._v(" "),e("li",[t._v("Restrict access to the admin panel by allowing only specific IP addresses and enforcing two-factor authorization for admin logins.")]),t._v(" "),e("li",[t._v("Ensure the use of strong and unique passwords.")]),t._v(" "),e("li",[t._v("Configure and update the firewall properly to secure the connection between payment card data and the public network.")])]),t._v(" "),e("h2",{attrs:{id:"limiting-error-messages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#limiting-error-messages"}},[t._v("#")]),t._v(" Limiting Error Messages")]),t._v(" "),e("p",[t._v("To limit the exposure of sensitive information in error messages, follow these steps:")]),t._v(" "),e("ul",[e("li",[t._v("Edit your Apache configuration file to avoid displaying server and operating system details.")]),t._v(" "),e("li",[t._v("Set "),e("strong",[e("code",[t._v("ServerSignature")])]),t._v(" to "),e("strong",[e("code",[t._v("Off")])]),t._v(" (by default, it is "),e("strong",[e("code",[t._v("On")])]),t._v(").")]),t._v(" "),e("li",[t._v("Add "),e("strong",[e("code",[t._v("ServerTokens Prod")])]),t._v(" to display Apache only as the product.")])]),t._v(" "),e("details",{staticClass:"custom-block details"},[e("summary",[t._v("Screenshot")]),t._v(" "),e("p",[e("img",{attrs:{src:s(273),alt:"limiting-error-messages"}})])]),t._v(" "),e("h2",{attrs:{id:"limiting-admin-access"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#limiting-admin-access"}},[t._v("#")]),t._v(" Limiting Admin Access")]),t._v(" "),e("p",[t._v("To restrict access to the admin area, modify the "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file with the following code:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteEngine")]),t._v(" On\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REQUEST_URI}")]),t._v(" .*/admin\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REMOTE_ADDR}")]),t._v(" !=\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REMOTE_ADDR}")]),t._v(" !=\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteRule")]),e("span",{pre:!0,attrs:{class:"token regex"}},[t._v(" ^(.*)$")]),t._v(" - "),e("span",{pre:!0,attrs:{class:"token directive-flags keyword"}},[t._v("[R=403,L]")]),t._v("\n")])])]),e("p",[t._v('Ensure that there are no accessible development leftovers on the server, such as "log files," ".git directories," "database dumps," or "zip files."')]),t._v(" "),e("h2",{attrs:{id:"restricting-unnecessary-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#restricting-unnecessary-files"}},[t._v("#")]),t._v(" Restricting Unnecessary Files")]),t._v(" "),e("p",[t._v("To restrict access to unnecessary files, add the following code to your "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("FilesMatch")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\.(git|zip|tar|sql)$"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("Require")]),t._v(" all denied\n"),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("p",[t._v("Consider using a Web Application Firewall (WAF) to analyze traffic and detect suspicious patterns, such as credit card information being sent to attackers. Additionally, restrict public access to only ports 80 (HTTP) and 443 (HTTPS), while blocking other ports.")]),t._v(" "),e("h2",{attrs:{id:"restricting-php-execution-inside-storage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#restricting-php-execution-inside-storage"}},[t._v("#")]),t._v(" Restricting PHP Execution Inside Storage")]),t._v(" "),e("p",[t._v("To restrict PHP execution inside the storage directory, modify your Apache configuration file:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Directory")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"~/www/krayin/public/storage/"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("FilesMatch")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\.php$"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("Require")]),t._v(" all denied\n "),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n php_flag engine off\n"),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("p",[t._v("Don't forget to restart Apache after making these changes.")]),t._v(" "),e("h2",{attrs:{id:"server-hardening"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#server-hardening"}},[t._v("#")]),t._v(" Server Hardening")]),t._v(" "),e("p",[t._v("Take the following measures to harden your server:")]),t._v(" "),e("ul",[e("li",[t._v("Use the "),e("strong",[e("code",[t._v("mod_security")])]),t._v(" module to detect and prevent intrusions.")]),t._v(" "),e("li",[t._v("Implement the "),e("strong",[e("code",[t._v("mod_passive")])]),t._v(" module to prevent brute force attacks.")]),t._v(" "),e("li",[t._v("Allow only specific users to log in.")]),t._v(" "),e("li",[t._v("Disable login for users with empty passwords.")]),t._v(" "),e("li",[t._v("Review and configure iptable rules to prevent unauthorized access and activity.")]),t._v(" "),e("li",[t._v("Regularly back up important files and store them remotely in a secure environment.")])]),t._v(" "),e("h2",{attrs:{id:"strong-passwords"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#strong-passwords"}},[t._v("#")]),t._v(" Strong Passwords")]),t._v(" "),e("p",[t._v("Ensure the use of strong and unique passwords and encourage periodic password changes. You can use a password generator tool ("),e("a",{attrs:{href:"https://passwords-generator.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Password Generator"),e("OutboundLink")],1),t._v(") to create strong passwords. Limit access to the Krayin admin")]),t._v(" "),e("p",[t._v("panel by updating the whitelist with authorized IP addresses.")]),t._v(" "),e("h2",{attrs:{id:"implementation-of-http-security-headers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-of-http-security-headers"}},[t._v("#")]),t._v(" Implementation of HTTP Security Headers")]),t._v(" "),e("p",[t._v("Implementing the following HTTP security headers enhances web security:")]),t._v(" "),e("h3",{attrs:{id:"http-strict-transport-security-hsts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#http-strict-transport-security-hsts"}},[t._v("#")]),t._v(" HTTP Strict Transport Security (HSTS)")]),t._v(" "),e("p",[t._v("Set the "),e("strong",[e("code",[t._v("Strict-Transport-Security")])]),t._v(" response header to instruct the browser to only access the application using HTTPS:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("Strict-Transport-Security: max-age=\n")])])]),e("h3",{attrs:{id:"cross-site-scripting-protection-x-xss-protection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cross-site-scripting-protection-x-xss-protection"}},[t._v("#")]),t._v(" Cross-Site Scripting Protection (X-XSS Protection)")]),t._v(" "),e("p",[t._v("Set the "),e("strong",[e("code",[t._v("X-XSS-Protection")])]),t._v(" response header to enable browsers to detect and prevent cross-site scripting (XSS) attacks:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-XSS-Protection: 1; mode=block\n")])])]),e("h3",{attrs:{id:"x-frame-options​"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#x-frame-options​"}},[t._v("#")]),t._v(" X-Frame-Options​")]),t._v(" "),e("p",[t._v("The "),e("strong",[e("code",[t._v("X-Frame-Options")])]),t._v(" response header protects applications against clickjacking. It specifies whether the content can be displayed within frames:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-Frame-Options: deny\n")])])]),e("h3",{attrs:{id:"x-content-type-options​"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#x-content-type-options​"}},[t._v("#")]),t._v(" X-Content-Type-Options​")]),t._v(" "),e("p",[t._v("The "),e("strong",[e("code",[t._v("X-Content-Type-Options")])]),t._v(" response header forces the browser to disable MIME sniffing, preventing MIME sniffing vulnerabilities:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-Content-Type-Options: nosniff\n")])])]),e("h3",{attrs:{id:"content-security-policy-csp"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#content-security-policy-csp"}},[t._v("#")]),t._v(" Content Security Policy (CSP)")]),t._v(" "),e("p",[t._v("Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.")]),t._v(" "),e("h3",{attrs:{id:"continuous-logging-and-monitoring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#continuous-logging-and-monitoring"}},[t._v("#")]),t._v(" Continuous Logging And Monitoring")]),t._v(" "),e("p",[t._v("Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.")]),t._v(" "),e("p",[t._v("By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{273:function(t,e,s){t.exports=s.p+"assets/img/limiting-error-messages.36e9c79d.jpg"},325:function(t,e,s){"use strict";s.r(e);var a=s(10),r=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"best-security-practices"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#best-security-practices"}},[t._v("#")]),t._v(" Best Security Practices")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#software-updates"}},[t._v("Software Updates")])]),e("li",[e("a",{attrs:{href:"#limiting-error-messages"}},[t._v("Limiting Error Messages")])]),e("li",[e("a",{attrs:{href:"#limiting-admin-access"}},[t._v("Limiting Admin Access")])]),e("li",[e("a",{attrs:{href:"#restricting-unnecessary-files"}},[t._v("Restricting Unnecessary Files")])]),e("li",[e("a",{attrs:{href:"#restricting-php-execution-inside-storage"}},[t._v("Restricting PHP Execution Inside Storage")])]),e("li",[e("a",{attrs:{href:"#server-hardening"}},[t._v("Server Hardening")])]),e("li",[e("a",{attrs:{href:"#strong-passwords"}},[t._v("Strong Passwords")])]),e("li",[e("a",{attrs:{href:"#implementation-of-http-security-headers"}},[t._v("Implementation of HTTP Security Headers")]),e("ul",[e("li",[e("a",{attrs:{href:"#http-strict-transport-security-hsts"}},[t._v("HTTP Strict Transport Security (HSTS)")])]),e("li",[e("a",{attrs:{href:"#cross-site-scripting-protection-x-xss-protection"}},[t._v("Cross-Site Scripting Protection (X-XSS Protection)")])]),e("li",[e("a",{attrs:{href:"#x-frame-options​"}},[t._v("X-Frame-Options​")])]),e("li",[e("a",{attrs:{href:"#x-content-type-options​"}},[t._v("X-Content-Type-Options​")])]),e("li",[e("a",{attrs:{href:"#content-security-policy-csp"}},[t._v("Content Security Policy (CSP)")])]),e("li",[e("a",{attrs:{href:"#continuous-logging-and-monitoring"}},[t._v("Continuous Logging And Monitoring")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"software-updates"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#software-updates"}},[t._v("#")]),t._v(" Software Updates")]),t._v(" "),e("p",[t._v("To ensure the security of your system, follow these best practices:")]),t._v(" "),e("ul",[e("li",[t._v("Use HTTPS to encrypt communication. Google now considers HTTPS as a ranking factor.")]),t._v(" "),e("li",[t._v("Keep all software on the server up-to-date, including Krayin, the database, Adminer/phpMyAdmin, Apache, Redis, etc.")]),t._v(" "),e("li",[t._v("Regularly update the server operating system to apply available security patches.")]),t._v(" "),e("li",[t._v("Manage files only through secure communication protocols like SSH, SFTP, or HTTPS. Disable FTP.")]),t._v(" "),e("li",[t._v("Use the "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file to protect system files when using the Apache web server.")]),t._v(" "),e("li",[t._v("Disable unused ports and stop unnecessary services running on the server.")]),t._v(" "),e("li",[t._v("Restrict access to the admin panel by allowing only specific IP addresses and enforcing two-factor authorization for admin logins.")]),t._v(" "),e("li",[t._v("Ensure the use of strong and unique passwords.")]),t._v(" "),e("li",[t._v("Configure and update the firewall properly to secure the connection between payment card data and the public network.")])]),t._v(" "),e("h2",{attrs:{id:"limiting-error-messages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#limiting-error-messages"}},[t._v("#")]),t._v(" Limiting Error Messages")]),t._v(" "),e("p",[t._v("To limit the exposure of sensitive information in error messages, follow these steps:")]),t._v(" "),e("ul",[e("li",[t._v("Edit your Apache configuration file to avoid displaying server and operating system details.")]),t._v(" "),e("li",[t._v("Set "),e("strong",[e("code",[t._v("ServerSignature")])]),t._v(" to "),e("strong",[e("code",[t._v("Off")])]),t._v(" (by default, it is "),e("strong",[e("code",[t._v("On")])]),t._v(").")]),t._v(" "),e("li",[t._v("Add "),e("strong",[e("code",[t._v("ServerTokens Prod")])]),t._v(" to display Apache only as the product.")])]),t._v(" "),e("details",{staticClass:"custom-block details"},[e("summary",[t._v("Screenshot")]),t._v(" "),e("p",[e("img",{attrs:{src:s(273),alt:"limiting-error-messages"}})])]),t._v(" "),e("h2",{attrs:{id:"limiting-admin-access"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#limiting-admin-access"}},[t._v("#")]),t._v(" Limiting Admin Access")]),t._v(" "),e("p",[t._v("To restrict access to the admin area, modify the "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file with the following code:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteEngine")]),t._v(" On\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REQUEST_URI}")]),t._v(" .*/admin\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REMOTE_ADDR}")]),t._v(" !=\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REMOTE_ADDR}")]),t._v(" !=\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteRule")]),e("span",{pre:!0,attrs:{class:"token regex"}},[t._v(" ^(.*)$")]),t._v(" - "),e("span",{pre:!0,attrs:{class:"token directive-flags keyword"}},[t._v("[R=403,L]")]),t._v("\n")])])]),e("p",[t._v('Ensure that there are no accessible development leftovers on the server, such as "log files," ".git directories," "database dumps," or "zip files."')]),t._v(" "),e("h2",{attrs:{id:"restricting-unnecessary-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#restricting-unnecessary-files"}},[t._v("#")]),t._v(" Restricting Unnecessary Files")]),t._v(" "),e("p",[t._v("To restrict access to unnecessary files, add the following code to your "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("FilesMatch")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\.(git|zip|tar|sql)$"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("Require")]),t._v(" all denied\n"),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("p",[t._v("Consider using a Web Application Firewall (WAF) to analyze traffic and detect suspicious patterns, such as credit card information being sent to attackers. Additionally, restrict public access to only ports 80 (HTTP) and 443 (HTTPS), while blocking other ports.")]),t._v(" "),e("h2",{attrs:{id:"restricting-php-execution-inside-storage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#restricting-php-execution-inside-storage"}},[t._v("#")]),t._v(" Restricting PHP Execution Inside Storage")]),t._v(" "),e("p",[t._v("To restrict PHP execution inside the storage directory, modify your Apache configuration file:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Directory")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"~/www/krayin/public/storage/"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("FilesMatch")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\.php$"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("Require")]),t._v(" all denied\n "),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n php_flag engine off\n"),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("p",[t._v("Don't forget to restart Apache after making these changes.")]),t._v(" "),e("h2",{attrs:{id:"server-hardening"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#server-hardening"}},[t._v("#")]),t._v(" Server Hardening")]),t._v(" "),e("p",[t._v("Take the following measures to harden your server:")]),t._v(" "),e("ul",[e("li",[t._v("Use the "),e("strong",[e("code",[t._v("mod_security")])]),t._v(" module to detect and prevent intrusions.")]),t._v(" "),e("li",[t._v("Implement the "),e("strong",[e("code",[t._v("mod_passive")])]),t._v(" module to prevent brute force attacks.")]),t._v(" "),e("li",[t._v("Allow only specific users to log in.")]),t._v(" "),e("li",[t._v("Disable login for users with empty passwords.")]),t._v(" "),e("li",[t._v("Review and configure iptable rules to prevent unauthorized access and activity.")]),t._v(" "),e("li",[t._v("Regularly back up important files and store them remotely in a secure environment.")])]),t._v(" "),e("h2",{attrs:{id:"strong-passwords"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#strong-passwords"}},[t._v("#")]),t._v(" Strong Passwords")]),t._v(" "),e("p",[t._v("Ensure the use of strong and unique passwords and encourage periodic password changes. You can use a password generator tool ("),e("a",{attrs:{href:"https://passwords-generator.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Password Generator"),e("OutboundLink")],1),t._v(") to create strong passwords. Limit access to the Krayin admin")]),t._v(" "),e("p",[t._v("panel by updating the whitelist with authorized IP addresses.")]),t._v(" "),e("h2",{attrs:{id:"implementation-of-http-security-headers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-of-http-security-headers"}},[t._v("#")]),t._v(" Implementation of HTTP Security Headers")]),t._v(" "),e("p",[t._v("Implementing the following HTTP security headers enhances web security:")]),t._v(" "),e("h3",{attrs:{id:"http-strict-transport-security-hsts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#http-strict-transport-security-hsts"}},[t._v("#")]),t._v(" HTTP Strict Transport Security (HSTS)")]),t._v(" "),e("p",[t._v("Set the "),e("strong",[e("code",[t._v("Strict-Transport-Security")])]),t._v(" response header to instruct the browser to only access the application using HTTPS:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("Strict-Transport-Security: max-age=\n")])])]),e("h3",{attrs:{id:"cross-site-scripting-protection-x-xss-protection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cross-site-scripting-protection-x-xss-protection"}},[t._v("#")]),t._v(" Cross-Site Scripting Protection (X-XSS Protection)")]),t._v(" "),e("p",[t._v("Set the "),e("strong",[e("code",[t._v("X-XSS-Protection")])]),t._v(" response header to enable browsers to detect and prevent cross-site scripting (XSS) attacks:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-XSS-Protection: 1; mode=block\n")])])]),e("h3",{attrs:{id:"x-frame-options​"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#x-frame-options​"}},[t._v("#")]),t._v(" X-Frame-Options​")]),t._v(" "),e("p",[t._v("The "),e("strong",[e("code",[t._v("X-Frame-Options")])]),t._v(" response header protects applications against clickjacking. It specifies whether the content can be displayed within frames:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-Frame-Options: deny\n")])])]),e("h3",{attrs:{id:"x-content-type-options​"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#x-content-type-options​"}},[t._v("#")]),t._v(" X-Content-Type-Options​")]),t._v(" "),e("p",[t._v("The "),e("strong",[e("code",[t._v("X-Content-Type-Options")])]),t._v(" response header forces the browser to disable MIME sniffing, preventing MIME sniffing vulnerabilities:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-Content-Type-Options: nosniff\n")])])]),e("h3",{attrs:{id:"content-security-policy-csp"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#content-security-policy-csp"}},[t._v("#")]),t._v(" Content Security Policy (CSP)")]),t._v(" "),e("p",[t._v("Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.")]),t._v(" "),e("h3",{attrs:{id:"continuous-logging-and-monitoring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#continuous-logging-and-monitoring"}},[t._v("#")]),t._v(" Continuous Logging And Monitoring")]),t._v(" "),e("p",[t._v("Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.")]),t._v(" "),e("p",[t._v("By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/24.1f970c73.js b/assets/js/24.b07e5381.js similarity index 99% rename from assets/js/24.1f970c73.js rename to assets/js/24.b07e5381.js index d7cf231..3d33ff1 100644 --- a/assets/js/24.1f970c73.js +++ b/assets/js/24.b07e5381.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{273:function(t,e,s){t.exports=s.p+"assets/img/limiting-error-messages.36e9c79d.jpg"},403:function(t,e,s){"use strict";s.r(e);var a=s(10),r=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"best-security-practices"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#best-security-practices"}},[t._v("#")]),t._v(" Best Security Practices")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#software-updates"}},[t._v("Software Updates")])]),e("li",[e("a",{attrs:{href:"#limiting-error-messages"}},[t._v("Limiting Error Messages")])]),e("li",[e("a",{attrs:{href:"#limiting-admin-access"}},[t._v("Limiting Admin Access")])]),e("li",[e("a",{attrs:{href:"#restricting-unnecessary-files"}},[t._v("Restricting Unnecessary Files")])]),e("li",[e("a",{attrs:{href:"#restricting-php-execution-inside-storage"}},[t._v("Restricting PHP Execution Inside Storage")])]),e("li",[e("a",{attrs:{href:"#server-hardening"}},[t._v("Server Hardening")])]),e("li",[e("a",{attrs:{href:"#strong-passwords"}},[t._v("Strong Passwords")])]),e("li",[e("a",{attrs:{href:"#implementation-of-http-security-headers"}},[t._v("Implementation of HTTP Security Headers")]),e("ul",[e("li",[e("a",{attrs:{href:"#http-strict-transport-security-hsts"}},[t._v("HTTP Strict Transport Security (HSTS)")])]),e("li",[e("a",{attrs:{href:"#cross-site-scripting-protection-x-xss-protection"}},[t._v("Cross-Site Scripting Protection (X-XSS Protection)")])]),e("li",[e("a",{attrs:{href:"#x-frame-options​"}},[t._v("X-Frame-Options​")])]),e("li",[e("a",{attrs:{href:"#x-content-type-options​"}},[t._v("X-Content-Type-Options​")])]),e("li",[e("a",{attrs:{href:"#content-security-policy-csp"}},[t._v("Content Security Policy (CSP)")])]),e("li",[e("a",{attrs:{href:"#continuous-logging-and-monitoring"}},[t._v("Continuous Logging And Monitoring")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"software-updates"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#software-updates"}},[t._v("#")]),t._v(" Software Updates")]),t._v(" "),e("p",[t._v("To ensure the security of your system, follow these best practices:")]),t._v(" "),e("ul",[e("li",[t._v("Use HTTPS to encrypt communication. Google now considers HTTPS as a ranking factor.")]),t._v(" "),e("li",[t._v("Keep all software on the server up-to-date, including Krayin, the database, Adminer/phpMyAdmin, Apache, Redis, etc.")]),t._v(" "),e("li",[t._v("Regularly update the server operating system to apply available security patches.")]),t._v(" "),e("li",[t._v("Manage files only through secure communication protocols like SSH, SFTP, or HTTPS. Disable FTP.")]),t._v(" "),e("li",[t._v("Use the "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file to protect system files when using the Apache web server.")]),t._v(" "),e("li",[t._v("Disable unused ports and stop unnecessary services running on the server.")]),t._v(" "),e("li",[t._v("Restrict access to the admin panel by allowing only specific IP addresses and enforcing two-factor authorization for admin logins.")]),t._v(" "),e("li",[t._v("Ensure the use of strong and unique passwords.")]),t._v(" "),e("li",[t._v("Configure and update the firewall properly to secure the connection between payment card data and the public network.")])]),t._v(" "),e("h2",{attrs:{id:"limiting-error-messages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#limiting-error-messages"}},[t._v("#")]),t._v(" Limiting Error Messages")]),t._v(" "),e("p",[t._v("To limit the exposure of sensitive information in error messages, follow these steps:")]),t._v(" "),e("ul",[e("li",[t._v("Edit your Apache configuration file to avoid displaying server and operating system details.")]),t._v(" "),e("li",[t._v("Set "),e("strong",[e("code",[t._v("ServerSignature")])]),t._v(" to "),e("strong",[e("code",[t._v("Off")])]),t._v(" (by default, it is "),e("strong",[e("code",[t._v("On")])]),t._v(").")]),t._v(" "),e("li",[t._v("Add "),e("strong",[e("code",[t._v("ServerTokens Prod")])]),t._v(" to display Apache only as the product.")])]),t._v(" "),e("details",{staticClass:"custom-block details"},[e("summary",[t._v("Screenshot")]),t._v(" "),e("p",[e("img",{attrs:{src:s(273),alt:"limiting-error-messages"}})])]),t._v(" "),e("h2",{attrs:{id:"limiting-admin-access"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#limiting-admin-access"}},[t._v("#")]),t._v(" Limiting Admin Access")]),t._v(" "),e("p",[t._v("To restrict access to the admin area, modify the "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file with the following code:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteEngine")]),t._v(" On\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REQUEST_URI}")]),t._v(" .*/admin\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REMOTE_ADDR}")]),t._v(" !=\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REMOTE_ADDR}")]),t._v(" !=\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteRule")]),e("span",{pre:!0,attrs:{class:"token regex"}},[t._v(" ^(.*)$")]),t._v(" - "),e("span",{pre:!0,attrs:{class:"token directive-flags keyword"}},[t._v("[R=403,L]")]),t._v("\n")])])]),e("p",[t._v('Ensure that there are no accessible development leftovers on the server, such as "log files," ".git directories," "database dumps," or "zip files."')]),t._v(" "),e("h2",{attrs:{id:"restricting-unnecessary-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#restricting-unnecessary-files"}},[t._v("#")]),t._v(" Restricting Unnecessary Files")]),t._v(" "),e("p",[t._v("To restrict access to unnecessary files, add the following code to your "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("FilesMatch")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\.(git|zip|tar|sql)$"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("Require")]),t._v(" all denied\n"),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("p",[t._v("Consider using a Web Application Firewall (WAF) to analyze traffic and detect suspicious patterns, such as credit card information being sent to attackers. Additionally, restrict public access to only ports 80 (HTTP) and 443 (HTTPS), while blocking other ports.")]),t._v(" "),e("h2",{attrs:{id:"restricting-php-execution-inside-storage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#restricting-php-execution-inside-storage"}},[t._v("#")]),t._v(" Restricting PHP Execution Inside Storage")]),t._v(" "),e("p",[t._v("To restrict PHP execution inside the storage directory, modify your Apache configuration file:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Directory")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"~/www/krayin/public/storage/"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("FilesMatch")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\.php$"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("Require")]),t._v(" all denied\n "),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n php_flag engine off\n"),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("p",[t._v("Don't forget to restart Apache after making these changes.")]),t._v(" "),e("h2",{attrs:{id:"server-hardening"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#server-hardening"}},[t._v("#")]),t._v(" Server Hardening")]),t._v(" "),e("p",[t._v("Take the following measures to harden your server:")]),t._v(" "),e("ul",[e("li",[t._v("Use the "),e("strong",[e("code",[t._v("mod_security")])]),t._v(" module to detect and prevent intrusions.")]),t._v(" "),e("li",[t._v("Implement the "),e("strong",[e("code",[t._v("mod_passive")])]),t._v(" module to prevent brute force attacks.")]),t._v(" "),e("li",[t._v("Allow only specific users to log in.")]),t._v(" "),e("li",[t._v("Disable login for users with empty passwords.")]),t._v(" "),e("li",[t._v("Review and configure iptable rules to prevent unauthorized access and activity.")]),t._v(" "),e("li",[t._v("Regularly back up important files and store them remotely in a secure environment.")])]),t._v(" "),e("h2",{attrs:{id:"strong-passwords"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#strong-passwords"}},[t._v("#")]),t._v(" Strong Passwords")]),t._v(" "),e("p",[t._v("Ensure the use of strong and unique passwords and encourage periodic password changes. You can use a password generator tool ("),e("a",{attrs:{href:"https://passwords-generator.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Password Generator"),e("OutboundLink")],1),t._v(") to create strong passwords. Limit access to the Krayin admin")]),t._v(" "),e("p",[t._v("panel by updating the whitelist with authorized IP addresses.")]),t._v(" "),e("h2",{attrs:{id:"implementation-of-http-security-headers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-of-http-security-headers"}},[t._v("#")]),t._v(" Implementation of HTTP Security Headers")]),t._v(" "),e("p",[t._v("Implementing the following HTTP security headers enhances web security:")]),t._v(" "),e("h3",{attrs:{id:"http-strict-transport-security-hsts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#http-strict-transport-security-hsts"}},[t._v("#")]),t._v(" HTTP Strict Transport Security (HSTS)")]),t._v(" "),e("p",[t._v("Set the "),e("strong",[e("code",[t._v("Strict-Transport-Security")])]),t._v(" response header to instruct the browser to only access the application using HTTPS:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("Strict-Transport-Security: max-age=\n")])])]),e("h3",{attrs:{id:"cross-site-scripting-protection-x-xss-protection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cross-site-scripting-protection-x-xss-protection"}},[t._v("#")]),t._v(" Cross-Site Scripting Protection (X-XSS Protection)")]),t._v(" "),e("p",[t._v("Set the "),e("strong",[e("code",[t._v("X-XSS-Protection")])]),t._v(" response header to enable browsers to detect and prevent cross-site scripting (XSS) attacks:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-XSS-Protection: 1; mode=block\n")])])]),e("h3",{attrs:{id:"x-frame-options​"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#x-frame-options​"}},[t._v("#")]),t._v(" X-Frame-Options​")]),t._v(" "),e("p",[t._v("The "),e("strong",[e("code",[t._v("X-Frame-Options")])]),t._v(" response header protects applications against clickjacking. It specifies whether the content can be displayed within frames:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-Frame-Options: deny\n")])])]),e("h3",{attrs:{id:"x-content-type-options​"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#x-content-type-options​"}},[t._v("#")]),t._v(" X-Content-Type-Options​")]),t._v(" "),e("p",[t._v("The "),e("strong",[e("code",[t._v("X-Content-Type-Options")])]),t._v(" response header forces the browser to disable MIME sniffing, preventing MIME sniffing vulnerabilities:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-Content-Type-Options: nosniff\n")])])]),e("h3",{attrs:{id:"content-security-policy-csp"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#content-security-policy-csp"}},[t._v("#")]),t._v(" Content Security Policy (CSP)")]),t._v(" "),e("p",[t._v("Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.")]),t._v(" "),e("h3",{attrs:{id:"continuous-logging-and-monitoring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#continuous-logging-and-monitoring"}},[t._v("#")]),t._v(" Continuous Logging And Monitoring")]),t._v(" "),e("p",[t._v("Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.")]),t._v(" "),e("p",[t._v("By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{273:function(t,e,s){t.exports=s.p+"assets/img/limiting-error-messages.36e9c79d.jpg"},405:function(t,e,s){"use strict";s.r(e);var a=s(10),r=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"best-security-practices"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#best-security-practices"}},[t._v("#")]),t._v(" Best Security Practices")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#software-updates"}},[t._v("Software Updates")])]),e("li",[e("a",{attrs:{href:"#limiting-error-messages"}},[t._v("Limiting Error Messages")])]),e("li",[e("a",{attrs:{href:"#limiting-admin-access"}},[t._v("Limiting Admin Access")])]),e("li",[e("a",{attrs:{href:"#restricting-unnecessary-files"}},[t._v("Restricting Unnecessary Files")])]),e("li",[e("a",{attrs:{href:"#restricting-php-execution-inside-storage"}},[t._v("Restricting PHP Execution Inside Storage")])]),e("li",[e("a",{attrs:{href:"#server-hardening"}},[t._v("Server Hardening")])]),e("li",[e("a",{attrs:{href:"#strong-passwords"}},[t._v("Strong Passwords")])]),e("li",[e("a",{attrs:{href:"#implementation-of-http-security-headers"}},[t._v("Implementation of HTTP Security Headers")]),e("ul",[e("li",[e("a",{attrs:{href:"#http-strict-transport-security-hsts"}},[t._v("HTTP Strict Transport Security (HSTS)")])]),e("li",[e("a",{attrs:{href:"#cross-site-scripting-protection-x-xss-protection"}},[t._v("Cross-Site Scripting Protection (X-XSS Protection)")])]),e("li",[e("a",{attrs:{href:"#x-frame-options​"}},[t._v("X-Frame-Options​")])]),e("li",[e("a",{attrs:{href:"#x-content-type-options​"}},[t._v("X-Content-Type-Options​")])]),e("li",[e("a",{attrs:{href:"#content-security-policy-csp"}},[t._v("Content Security Policy (CSP)")])]),e("li",[e("a",{attrs:{href:"#continuous-logging-and-monitoring"}},[t._v("Continuous Logging And Monitoring")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"software-updates"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#software-updates"}},[t._v("#")]),t._v(" Software Updates")]),t._v(" "),e("p",[t._v("To ensure the security of your system, follow these best practices:")]),t._v(" "),e("ul",[e("li",[t._v("Use HTTPS to encrypt communication. Google now considers HTTPS as a ranking factor.")]),t._v(" "),e("li",[t._v("Keep all software on the server up-to-date, including Krayin, the database, Adminer/phpMyAdmin, Apache, Redis, etc.")]),t._v(" "),e("li",[t._v("Regularly update the server operating system to apply available security patches.")]),t._v(" "),e("li",[t._v("Manage files only through secure communication protocols like SSH, SFTP, or HTTPS. Disable FTP.")]),t._v(" "),e("li",[t._v("Use the "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file to protect system files when using the Apache web server.")]),t._v(" "),e("li",[t._v("Disable unused ports and stop unnecessary services running on the server.")]),t._v(" "),e("li",[t._v("Restrict access to the admin panel by allowing only specific IP addresses and enforcing two-factor authorization for admin logins.")]),t._v(" "),e("li",[t._v("Ensure the use of strong and unique passwords.")]),t._v(" "),e("li",[t._v("Configure and update the firewall properly to secure the connection between payment card data and the public network.")])]),t._v(" "),e("h2",{attrs:{id:"limiting-error-messages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#limiting-error-messages"}},[t._v("#")]),t._v(" Limiting Error Messages")]),t._v(" "),e("p",[t._v("To limit the exposure of sensitive information in error messages, follow these steps:")]),t._v(" "),e("ul",[e("li",[t._v("Edit your Apache configuration file to avoid displaying server and operating system details.")]),t._v(" "),e("li",[t._v("Set "),e("strong",[e("code",[t._v("ServerSignature")])]),t._v(" to "),e("strong",[e("code",[t._v("Off")])]),t._v(" (by default, it is "),e("strong",[e("code",[t._v("On")])]),t._v(").")]),t._v(" "),e("li",[t._v("Add "),e("strong",[e("code",[t._v("ServerTokens Prod")])]),t._v(" to display Apache only as the product.")])]),t._v(" "),e("details",{staticClass:"custom-block details"},[e("summary",[t._v("Screenshot")]),t._v(" "),e("p",[e("img",{attrs:{src:s(273),alt:"limiting-error-messages"}})])]),t._v(" "),e("h2",{attrs:{id:"limiting-admin-access"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#limiting-admin-access"}},[t._v("#")]),t._v(" Limiting Admin Access")]),t._v(" "),e("p",[t._v("To restrict access to the admin area, modify the "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file with the following code:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteEngine")]),t._v(" On\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REQUEST_URI}")]),t._v(" .*/admin\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REMOTE_ADDR}")]),t._v(" !=\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteCond")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("%{REMOTE_ADDR}")]),t._v(" !=\n"),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("RewriteRule")]),e("span",{pre:!0,attrs:{class:"token regex"}},[t._v(" ^(.*)$")]),t._v(" - "),e("span",{pre:!0,attrs:{class:"token directive-flags keyword"}},[t._v("[R=403,L]")]),t._v("\n")])])]),e("p",[t._v('Ensure that there are no accessible development leftovers on the server, such as "log files," ".git directories," "database dumps," or "zip files."')]),t._v(" "),e("h2",{attrs:{id:"restricting-unnecessary-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#restricting-unnecessary-files"}},[t._v("#")]),t._v(" Restricting Unnecessary Files")]),t._v(" "),e("p",[t._v("To restrict access to unnecessary files, add the following code to your "),e("strong",[e("code",[t._v(".htaccess")])]),t._v(" file:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("FilesMatch")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\.(git|zip|tar|sql)$"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("Require")]),t._v(" all denied\n"),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("p",[t._v("Consider using a Web Application Firewall (WAF) to analyze traffic and detect suspicious patterns, such as credit card information being sent to attackers. Additionally, restrict public access to only ports 80 (HTTP) and 443 (HTTPS), while blocking other ports.")]),t._v(" "),e("h2",{attrs:{id:"restricting-php-execution-inside-storage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#restricting-php-execution-inside-storage"}},[t._v("#")]),t._v(" Restricting PHP Execution Inside Storage")]),t._v(" "),e("p",[t._v("To restrict PHP execution inside the storage directory, modify your Apache configuration file:")]),t._v(" "),e("div",{staticClass:"language-apacheconf extra-class"},[e("pre",{pre:!0,attrs:{class:"language-apacheconf"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Directory")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"~/www/krayin/public/storage/"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("FilesMatch")]),e("span",{pre:!0,attrs:{class:"token directive-block-parameter attr-value"}},[t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\.php$"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token directive-inline property"}},[t._v("Require")]),t._v(" all denied\n "),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n php_flag engine off\n"),e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token directive-block tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),e("p",[t._v("Don't forget to restart Apache after making these changes.")]),t._v(" "),e("h2",{attrs:{id:"server-hardening"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#server-hardening"}},[t._v("#")]),t._v(" Server Hardening")]),t._v(" "),e("p",[t._v("Take the following measures to harden your server:")]),t._v(" "),e("ul",[e("li",[t._v("Use the "),e("strong",[e("code",[t._v("mod_security")])]),t._v(" module to detect and prevent intrusions.")]),t._v(" "),e("li",[t._v("Implement the "),e("strong",[e("code",[t._v("mod_passive")])]),t._v(" module to prevent brute force attacks.")]),t._v(" "),e("li",[t._v("Allow only specific users to log in.")]),t._v(" "),e("li",[t._v("Disable login for users with empty passwords.")]),t._v(" "),e("li",[t._v("Review and configure iptable rules to prevent unauthorized access and activity.")]),t._v(" "),e("li",[t._v("Regularly back up important files and store them remotely in a secure environment.")])]),t._v(" "),e("h2",{attrs:{id:"strong-passwords"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#strong-passwords"}},[t._v("#")]),t._v(" Strong Passwords")]),t._v(" "),e("p",[t._v("Ensure the use of strong and unique passwords and encourage periodic password changes. You can use a password generator tool ("),e("a",{attrs:{href:"https://passwords-generator.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Password Generator"),e("OutboundLink")],1),t._v(") to create strong passwords. Limit access to the Krayin admin")]),t._v(" "),e("p",[t._v("panel by updating the whitelist with authorized IP addresses.")]),t._v(" "),e("h2",{attrs:{id:"implementation-of-http-security-headers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-of-http-security-headers"}},[t._v("#")]),t._v(" Implementation of HTTP Security Headers")]),t._v(" "),e("p",[t._v("Implementing the following HTTP security headers enhances web security:")]),t._v(" "),e("h3",{attrs:{id:"http-strict-transport-security-hsts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#http-strict-transport-security-hsts"}},[t._v("#")]),t._v(" HTTP Strict Transport Security (HSTS)")]),t._v(" "),e("p",[t._v("Set the "),e("strong",[e("code",[t._v("Strict-Transport-Security")])]),t._v(" response header to instruct the browser to only access the application using HTTPS:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("Strict-Transport-Security: max-age=\n")])])]),e("h3",{attrs:{id:"cross-site-scripting-protection-x-xss-protection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cross-site-scripting-protection-x-xss-protection"}},[t._v("#")]),t._v(" Cross-Site Scripting Protection (X-XSS Protection)")]),t._v(" "),e("p",[t._v("Set the "),e("strong",[e("code",[t._v("X-XSS-Protection")])]),t._v(" response header to enable browsers to detect and prevent cross-site scripting (XSS) attacks:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-XSS-Protection: 1; mode=block\n")])])]),e("h3",{attrs:{id:"x-frame-options​"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#x-frame-options​"}},[t._v("#")]),t._v(" X-Frame-Options​")]),t._v(" "),e("p",[t._v("The "),e("strong",[e("code",[t._v("X-Frame-Options")])]),t._v(" response header protects applications against clickjacking. It specifies whether the content can be displayed within frames:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-Frame-Options: deny\n")])])]),e("h3",{attrs:{id:"x-content-type-options​"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#x-content-type-options​"}},[t._v("#")]),t._v(" X-Content-Type-Options​")]),t._v(" "),e("p",[t._v("The "),e("strong",[e("code",[t._v("X-Content-Type-Options")])]),t._v(" response header forces the browser to disable MIME sniffing, preventing MIME sniffing vulnerabilities:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("X-Content-Type-Options: nosniff\n")])])]),e("h3",{attrs:{id:"content-security-policy-csp"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#content-security-policy-csp"}},[t._v("#")]),t._v(" Content Security Policy (CSP)")]),t._v(" "),e("p",[t._v("Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.")]),t._v(" "),e("h3",{attrs:{id:"continuous-logging-and-monitoring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#continuous-logging-and-monitoring"}},[t._v("#")]),t._v(" Continuous Logging And Monitoring")]),t._v(" "),e("p",[t._v("Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.")]),t._v(" "),e("p",[t._v("By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/25.1eadac28.js b/assets/js/25.c26ea879.js similarity index 97% rename from assets/js/25.1eadac28.js rename to assets/js/25.c26ea879.js index 4bc9f5e..8fa5b63 100644 --- a/assets/js/25.1eadac28.js +++ b/assets/js/25.c26ea879.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{320:function(e,t,a){"use strict";a.r(t);var o=a(10),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"digging-deeper"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#digging-deeper"}},[e._v("#")]),e._v(" Digging Deeper")]),e._v(" "),t("p",[e._v('Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.')]),e._v(" "),t("p",[e._v("We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the "),t("RouterLink",{attrs:{to:"/1.x/packages/create-package.html"}},[e._v("Package Development")]),e._v(" section for a primer on creating and managing packages in Laravel.")],1),e._v(" "),t("h3",{attrs:{id:"events-and-event-handlers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-and-event-handlers"}},[e._v("#")]),e._v(" Events and Event Handlers")]),e._v(" "),t("p",[e._v("Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.")]),e._v(" "),t("h3",{attrs:{id:"helpers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#helpers"}},[e._v("#")]),e._v(" Helpers")]),e._v(" "),t("p",[e._v("Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.")]),e._v(" "),t("h3",{attrs:{id:"overriding-core-models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overriding-core-models"}},[e._v("#")]),e._v(" Overriding Core Models")]),e._v(" "),t("p",[e._v("Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{329:function(e,t,a){"use strict";a.r(t);var o=a(10),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"digging-deeper"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#digging-deeper"}},[e._v("#")]),e._v(" Digging Deeper")]),e._v(" "),t("p",[e._v('Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.')]),e._v(" "),t("p",[e._v("We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the "),t("RouterLink",{attrs:{to:"/1.x/packages/create-package.html"}},[e._v("Package Development")]),e._v(" section for a primer on creating and managing packages in Laravel.")],1),e._v(" "),t("h3",{attrs:{id:"events-and-event-handlers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-and-event-handlers"}},[e._v("#")]),e._v(" Events and Event Handlers")]),e._v(" "),t("p",[e._v("Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.")]),e._v(" "),t("h3",{attrs:{id:"helpers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#helpers"}},[e._v("#")]),e._v(" Helpers")]),e._v(" "),t("p",[e._v("Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.")]),e._v(" "),t("h3",{attrs:{id:"overriding-core-models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overriding-core-models"}},[e._v("#")]),e._v(" Overriding Core Models")]),e._v(" "),t("p",[e._v("Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/26.5a2fc6eb.js b/assets/js/26.2fb60aac.js similarity index 99% rename from assets/js/26.5a2fc6eb.js rename to assets/js/26.2fb60aac.js index 0dbb278..c24c294 100644 --- a/assets/js/26.5a2fc6eb.js +++ b/assets/js/26.2fb60aac.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{321:function(e,n,t){"use strict";t.r(n);var i=t(10),a=Object(i.a)({},(function(){var e=this,n=e._self._c;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("p"),n("div",{staticClass:"table-of-contents"},[n("ul",[n("li",[n("a",{attrs:{href:"#sendgrid-inbound-parse"}},[e._v("SendGrid Inbound Parse")])])])]),n("p"),e._v(" "),n("h3",{attrs:{id:"sendgrid-inbound-parse"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#sendgrid-inbound-parse"}},[e._v("#")]),e._v(" "),n("strong",[e._v("SendGrid Inbound Parse")])]),e._v(" "),n("p",[e._v("Krayin CRM can be integrated with SendGrid’s "),n("strong",[e._v("Inbound Parse Webhook")]),e._v(" to handle incoming emails. This allows emails sent to a specific domain to be automatically processed by Krayin and displayed in the "),n("strong",[e._v("Mail > Inbox")]),e._v(" section.")]),e._v(" "),n("h4",{attrs:{id:"overview"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Overview")])]),e._v(" "),n("p",[e._v("The "),n("strong",[e._v("Inbound Parse Webhook")]),e._v(" feature of SendGrid allows emails to be converted into HTTP POST requests and forwarded to a specified URL in your application. By integrating SendGrid with Krayin CRM, you can seamlessly receive and display incoming emails.")]),e._v(" "),n("h4",{attrs:{id:"setting-up-sendgrid-inbound-parse-with-krayin-crm"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-sendgrid-inbound-parse-with-krayin-crm"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Setting Up SendGrid Inbound Parse with Krayin CRM")])]),e._v(" "),n("ol",[n("li",[n("p",[n("strong",[e._v("Create a Domain and Email in SendGrid")])]),e._v(" "),n("ul",[n("li",[e._v("Log into your "),n("a",{attrs:{href:"https://app.sendgrid.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("SendGrid account"),n("OutboundLink")],1),e._v(".")]),e._v(" "),n("li",[e._v("Go to "),n("strong",[e._v("Settings")]),e._v(" > "),n("strong",[e._v("Inbound Parse")]),e._v(".")]),e._v(" "),n("li",[e._v("Click "),n("strong",[e._v("Add Host & URL")]),e._v(" to configure a new Parse Webhook.")]),e._v(" "),n("li",[e._v("Add the domain from which you want to receive emails (e.g., "),n("code",[e._v("example.com")]),e._v(").")]),e._v(" "),n("li",[e._v("Under the "),n("strong",[e._v("URL")]),e._v(" field, specify your Krayin CRM webhook URL, which should be in the format:"),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse\n")])])]),e._v("Replace "),n("code",[e._v("yourdomain.com")]),e._v(" with your actual domain and ensure the endpoint matches your Krayin setup.")])])]),e._v(" "),n("li",[n("p",[n("strong",[e._v("Configure Krayin CRM to Receive Emails")])]),e._v(" "),n("ul",[n("li",[e._v("Once the webhook is set up in SendGrid, all emails sent to the configured domain will be forwarded to the specified Krayin webhook.")]),e._v(" "),n("li",[e._v("Krayin CRM will handle the incoming email data, including:\n"),n("ul",[n("li",[n("strong",[e._v("From Address:")]),e._v(" The sender's email.")]),e._v(" "),n("li",[n("strong",[e._v("To Address:")]),e._v(" The recipient (your configured email).")]),e._v(" "),n("li",[n("strong",[e._v("Subject:")]),e._v(" Email subject.")]),e._v(" "),n("li",[n("strong",[e._v("Text/HTML Body:")]),e._v(" Email content in plain text or HTML.")]),e._v(" "),n("li",[n("strong",[e._v("Attachments:")]),e._v(" Any files attached to the email.")])])])])]),e._v(" "),n("li",[n("p",[n("strong",[e._v("Krayin Endpoint for Inbound Parse")])]),e._v(" "),n("ul",[n("li",[e._v("Ensure that Krayin CRM is set up to receive the POST data from SendGrid. The email content will be sent to the following Krayin endpoint:"),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse\n")])])])]),e._v(" "),n("li",[e._v("Krayin will parse the data sent by SendGrid, store the email information in the database, and display it in the "),n("strong",[e._v("Mail > Inbox")]),e._v(" section.")])])])]),e._v(" "),n("h4",{attrs:{id:"handling-email-attachments"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#handling-email-attachments"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Handling Email Attachments")])]),e._v(" "),n("p",[e._v("Krayin CRM is capable of handling attachments that are sent via email. These attachments will be forwarded from SendGrid to your endpoint as "),n("code",[e._v("multipart/form-data")]),e._v(". Make sure your server can process and store these files for later retrieval in the "),n("strong",[e._v("Mail > Inbox")]),e._v(" section of the CRM.")]),e._v(" "),n("h4",{attrs:{id:"security-considerations"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#security-considerations"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Security Considerations")])]),e._v(" "),n("ul",[n("li",[n("strong",[e._v("Verify the Request Origin:")]),e._v(" Ensure that incoming requests to your webhook are actually coming from SendGrid. You can verify the origin by checking headers or configuring an API key in SendGrid for additional security.")]),e._v(" "),n("li",[n("strong",[e._v("HTTPS:")]),e._v(" Always use an HTTPS endpoint for secure communication between SendGrid and your server.")])]),e._v(" "),n("h4",{attrs:{id:"debugging-and-testing"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#debugging-and-testing"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Debugging and Testing")])]),e._v(" "),n("ul",[n("li",[e._v("SendGrid provides tools to simulate incoming emails, which can be used to test your webhook configuration.")]),e._v(" "),n("li",[e._v("Ensure that your server’s response time is efficient. SendGrid expects a response within 20 seconds. If the email processing takes longer (e.g., saving attachments), consider using asynchronous background tasks.")])]),e._v(" "),n("h4",{attrs:{id:"example-workflow"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#example-workflow"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Example Workflow")])]),e._v(" "),n("ol",[n("li",[e._v("A user sends an email to "),n("code",[e._v("contact@example.com")]),e._v(".")]),e._v(" "),n("li",[e._v("SendGrid captures the email and forwards it to your Krayin webhook ("),n("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse")]),e._v(").")]),e._v(" "),n("li",[e._v("Krayin CRM processes the incoming email, stores the details, and displays the email in the "),n("strong",[e._v("Mail > Inbox")]),e._v(" section.")])])])}),[],!1,null,null,null);n.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{320:function(e,n,t){"use strict";t.r(n);var i=t(10),a=Object(i.a)({},(function(){var e=this,n=e._self._c;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("p"),n("div",{staticClass:"table-of-contents"},[n("ul",[n("li",[n("a",{attrs:{href:"#sendgrid-inbound-parse"}},[e._v("SendGrid Inbound Parse")])])])]),n("p"),e._v(" "),n("h3",{attrs:{id:"sendgrid-inbound-parse"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#sendgrid-inbound-parse"}},[e._v("#")]),e._v(" "),n("strong",[e._v("SendGrid Inbound Parse")])]),e._v(" "),n("p",[e._v("Krayin CRM can be integrated with SendGrid’s "),n("strong",[e._v("Inbound Parse Webhook")]),e._v(" to handle incoming emails. This allows emails sent to a specific domain to be automatically processed by Krayin and displayed in the "),n("strong",[e._v("Mail > Inbox")]),e._v(" section.")]),e._v(" "),n("h4",{attrs:{id:"overview"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Overview")])]),e._v(" "),n("p",[e._v("The "),n("strong",[e._v("Inbound Parse Webhook")]),e._v(" feature of SendGrid allows emails to be converted into HTTP POST requests and forwarded to a specified URL in your application. By integrating SendGrid with Krayin CRM, you can seamlessly receive and display incoming emails.")]),e._v(" "),n("h4",{attrs:{id:"setting-up-sendgrid-inbound-parse-with-krayin-crm"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-sendgrid-inbound-parse-with-krayin-crm"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Setting Up SendGrid Inbound Parse with Krayin CRM")])]),e._v(" "),n("ol",[n("li",[n("p",[n("strong",[e._v("Create a Domain and Email in SendGrid")])]),e._v(" "),n("ul",[n("li",[e._v("Log into your "),n("a",{attrs:{href:"https://app.sendgrid.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("SendGrid account"),n("OutboundLink")],1),e._v(".")]),e._v(" "),n("li",[e._v("Go to "),n("strong",[e._v("Settings")]),e._v(" > "),n("strong",[e._v("Inbound Parse")]),e._v(".")]),e._v(" "),n("li",[e._v("Click "),n("strong",[e._v("Add Host & URL")]),e._v(" to configure a new Parse Webhook.")]),e._v(" "),n("li",[e._v("Add the domain from which you want to receive emails (e.g., "),n("code",[e._v("example.com")]),e._v(").")]),e._v(" "),n("li",[e._v("Under the "),n("strong",[e._v("URL")]),e._v(" field, specify your Krayin CRM webhook URL, which should be in the format:"),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse\n")])])]),e._v("Replace "),n("code",[e._v("yourdomain.com")]),e._v(" with your actual domain and ensure the endpoint matches your Krayin setup.")])])]),e._v(" "),n("li",[n("p",[n("strong",[e._v("Configure Krayin CRM to Receive Emails")])]),e._v(" "),n("ul",[n("li",[e._v("Once the webhook is set up in SendGrid, all emails sent to the configured domain will be forwarded to the specified Krayin webhook.")]),e._v(" "),n("li",[e._v("Krayin CRM will handle the incoming email data, including:\n"),n("ul",[n("li",[n("strong",[e._v("From Address:")]),e._v(" The sender's email.")]),e._v(" "),n("li",[n("strong",[e._v("To Address:")]),e._v(" The recipient (your configured email).")]),e._v(" "),n("li",[n("strong",[e._v("Subject:")]),e._v(" Email subject.")]),e._v(" "),n("li",[n("strong",[e._v("Text/HTML Body:")]),e._v(" Email content in plain text or HTML.")]),e._v(" "),n("li",[n("strong",[e._v("Attachments:")]),e._v(" Any files attached to the email.")])])])])]),e._v(" "),n("li",[n("p",[n("strong",[e._v("Krayin Endpoint for Inbound Parse")])]),e._v(" "),n("ul",[n("li",[e._v("Ensure that Krayin CRM is set up to receive the POST data from SendGrid. The email content will be sent to the following Krayin endpoint:"),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse\n")])])])]),e._v(" "),n("li",[e._v("Krayin will parse the data sent by SendGrid, store the email information in the database, and display it in the "),n("strong",[e._v("Mail > Inbox")]),e._v(" section.")])])])]),e._v(" "),n("h4",{attrs:{id:"handling-email-attachments"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#handling-email-attachments"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Handling Email Attachments")])]),e._v(" "),n("p",[e._v("Krayin CRM is capable of handling attachments that are sent via email. These attachments will be forwarded from SendGrid to your endpoint as "),n("code",[e._v("multipart/form-data")]),e._v(". Make sure your server can process and store these files for later retrieval in the "),n("strong",[e._v("Mail > Inbox")]),e._v(" section of the CRM.")]),e._v(" "),n("h4",{attrs:{id:"security-considerations"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#security-considerations"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Security Considerations")])]),e._v(" "),n("ul",[n("li",[n("strong",[e._v("Verify the Request Origin:")]),e._v(" Ensure that incoming requests to your webhook are actually coming from SendGrid. You can verify the origin by checking headers or configuring an API key in SendGrid for additional security.")]),e._v(" "),n("li",[n("strong",[e._v("HTTPS:")]),e._v(" Always use an HTTPS endpoint for secure communication between SendGrid and your server.")])]),e._v(" "),n("h4",{attrs:{id:"debugging-and-testing"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#debugging-and-testing"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Debugging and Testing")])]),e._v(" "),n("ul",[n("li",[e._v("SendGrid provides tools to simulate incoming emails, which can be used to test your webhook configuration.")]),e._v(" "),n("li",[e._v("Ensure that your server’s response time is efficient. SendGrid expects a response within 20 seconds. If the email processing takes longer (e.g., saving attachments), consider using asynchronous background tasks.")])]),e._v(" "),n("h4",{attrs:{id:"example-workflow"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#example-workflow"}},[e._v("#")]),e._v(" "),n("strong",[e._v("Example Workflow")])]),e._v(" "),n("ol",[n("li",[e._v("A user sends an email to "),n("code",[e._v("contact@example.com")]),e._v(".")]),e._v(" "),n("li",[e._v("SendGrid captures the email and forwards it to your Krayin webhook ("),n("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse")]),e._v(").")]),e._v(" "),n("li",[e._v("Krayin CRM processes the incoming email, stores the details, and displays the email in the "),n("strong",[e._v("Mail > Inbox")]),e._v(" section.")])])])}),[],!1,null,null,null);n.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/27.17d4b244.js b/assets/js/27.96e132ef.js similarity index 99% rename from assets/js/27.17d4b244.js rename to assets/js/27.96e132ef.js index 636348f..ae040ba 100644 --- a/assets/js/27.17d4b244.js +++ b/assets/js/27.96e132ef.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{325:function(e,t,s){"use strict";s.r(t);var a=s(10),r=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events"}},[e._v("#")]),e._v(" Events")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#creating-an-event-class"}},[e._v("Creating an Event Class")]),t("ul",[t("li",[t("a",{attrs:{href:"#using-package-generator"}},[e._v("Using Package Generator")])]),t("li",[t("a",{attrs:{href:"#manually-registering-events"}},[e._v("Manually Registering Events")])]),t("li",[t("a",{attrs:{href:"#manually-registering-listeners"}},[e._v("Manually Registering Listeners")])])])]),t("li",[t("a",{attrs:{href:"#specifying-events"}},[e._v("Specifying Events")])]),t("li",[t("a",{attrs:{href:"#events-fired-in-krayin"}},[e._v("Events Fired in Krayin")])]),t("li",[t("a",{attrs:{href:"#listening-to-existing-events"}},[e._v("Listening to Existing Events")]),t("ul",[t("li",[t("a",{attrs:{href:"#registering-a-listener"}},[e._v("Registering a Listener")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Event Listeners in Krayin are a way to implement the observer pattern, where listeners respond to events that occur in the application. Events can be thought of as announcements made by the application, and listeners are the actions taken in response to those announcements. All event classes in Krayin are stored in the "),t("code",[e._v("Providers")]),e._v(" directory, and the listeners are stored in the "),t("code",[e._v("Listeners")]),e._v(" directory.")]),e._v(" "),t("p",[e._v("In Krayin, events and listeners are organized in a clear and structured manner:")]),e._v(" "),t("ul",[t("li",[e._v("Events are typically stored in the Events directory.")]),e._v(" "),t("li",[e._v("Listeners are stored in the Listeners directory.")])]),e._v(" "),t("p",[e._v("This organization makes it easy to manage and locate the event-driven components of your application.")]),e._v(" "),t("p",[e._v("To learn in detail about Controllers, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/events",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"creating-an-event-class"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-an-event-class"}},[e._v("#")]),e._v(" Creating an Event Class")]),e._v(" "),t("h3",{attrs:{id:"using-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-package-generator"}},[e._v("#")]),e._v(" Using Package Generator")]),e._v(" "),t("p",[e._v("If you have the Krayin Package Generator installed, you can use the following command to create a new event class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category\n")])])]),t("p",[e._v("If the event class already exists, you can use the --force option to overwrite it:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--force")]),e._v("\n")])])]),t("p",[e._v("Alternatively, if you don't have the package generator, you can create the file manually by creating a new class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-events"}},[e._v("#")]),e._v(" Manually Registering Events")]),e._v(" "),t("p",[e._v("In Krayin, you register events manually in the "),t("code",[e._v("boot")]),e._v(" method of your "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file. Here is an example of how to register events:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Register any other events for your application.\n *\n * @return void\n */")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'event.name'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'path-upto-listener@function'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, "),t("code",[e._v("event.name")]),e._v(" is the name of the event, and "),t("code",[e._v("path-upto-listener@function")]),e._v(" is the listener method that will handle the event.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-listeners"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-listeners"}},[e._v("#")]),e._v(" Manually Registering Listeners")]),e._v(" "),t("p",[e._v("When registering events, you specify the listener function to be executed when an event is triggered. Here is an example of how to register a listener:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("EventServiceProvider")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ServiceProvider")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Bootstrap services.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, the "),t("code",[e._v("lead.create.after")]),e._v(" event will trigger the "),t("code",[e._v("linkToEmail")]),e._v(" method of the "),t("code",[e._v("Leads")]),e._v(" listener in the "),t("code",[e._v("Webkul\\Admin\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("h2",{attrs:{id:"specifying-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specifying-events"}},[e._v("#")]),e._v(" Specifying Events")]),e._v(" "),t("p",[e._v("In Krayin, events are typically fired before and after the execution of CRUD operations. This allows listeners to perform additional actions, such as logging, notifications, or data manipulation, at specific points in the lifecycle of an operation.")]),e._v(" "),t("p",[e._v("For example, you might have events fired during product creation, updating, or deletion. Here’s an example of firing events before and after saving an order:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("namespace")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Sales"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Repositories")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("use")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Admin"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Http"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Requests"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("LeadForm")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("LeadController")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Repository")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Create a new controller instance.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("__construct")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("protected")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadRepository")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$leadRepository")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'entity_type'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'leads'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Store a newly created resource in storage.\n * \n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("store")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadForm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("stageRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("findOrFail")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("lead_pipeline_id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("else")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("pipelineRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("getDefaultPipeline")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("stages")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("first")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("in_array")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("code")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'won'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lost'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'closed_at'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Carbon")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("now")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("leadRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("session")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("flash")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("trans")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin::app.leads.create-success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("redirect")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("route")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin.leads.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("h2",{attrs:{id:"events-fired-in-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-fired-in-krayin"}},[e._v("#")]),e._v(" Events Fired in Krayin")]),e._v(" "),t("p",[e._v("In Krayin, there are several events fired throughout its operations, allowing developers to hook into specific points in the application's lifecycle to customize behavior or add functionality. Here's a list of events that are fired in Krayin, which you can listen to and handle as needed by creating event listeners:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Events name")]),e._v(" "),t("th",[e._v("Functionality")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("activity.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.before")]),e._v(" "),t("td",[e._v("This event will be fired before configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.after")]),e._v(" "),t("td",[e._v("This event will be fired after configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization created .")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("user.account.update-password")]),e._v(" "),t("td",[e._v("This event will be fired after user password gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get deleted")])])])]),e._v(" "),t("h2",{attrs:{id:"listening-to-existing-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-existing-events"}},[e._v("#")]),e._v(" Listening to Existing Events")]),e._v(" "),t("p",[e._v("Krayin uses events and listeners to implement the observer pattern, allowing you to respond to various actions and events within the application. You can listen to specific events and execute custom code when those events are triggered.")]),e._v(" "),t("h3",{attrs:{id:"registering-a-listener"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#registering-a-listener"}},[e._v("#")]),e._v(" Registering a Listener")]),e._v(" "),t("p",[e._v("Open the "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file located in the "),t("code",[e._v("Providers")]),e._v(" directory of your Krayin application. This file is where you register event listeners.")]),e._v(" "),t("p",[e._v("Inside the "),t("code",[e._v("boot()")]),e._v(" method of "),t("code",[e._v("EventServiceProvider.php")]),e._v(", use the "),t("code",[e._v("Event::listen")]),e._v(" method to register your listener. This method takes the event name and a callback function or a class method that will handle the event.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])]),t("p",[e._v("In the example above, we are listening to the "),t("code",[e._v("lead.create.before")]),e._v(" event and specifying the "),t("code",[e._v("createOrder")]),e._v(" function from the "),t("code",[e._v("Order")]),e._v(" listener class in the "),t("code",[e._v("Webkul\\Notification\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("p",[e._v("Replace "),t("code",[e._v("'lead.create.before'")]),e._v(" with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.")]),e._v(" "),t("p",[e._v("By registering the listener, you have associated the "),t("strong",[t("code",[e._v("createOrder")])]),e._v(" function with the "),t("strong",[t("code",[e._v("lead.create.before")])]),e._v(" event. Whenever this event is triggered, the specified function will be executed.")]),e._v(" "),t("p",[e._v("You can modify the listener function according to your requirements to perform the desired operation.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{321:function(e,t,s){"use strict";s.r(t);var a=s(10),r=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events"}},[e._v("#")]),e._v(" Events")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#creating-an-event-class"}},[e._v("Creating an Event Class")]),t("ul",[t("li",[t("a",{attrs:{href:"#using-package-generator"}},[e._v("Using Package Generator")])]),t("li",[t("a",{attrs:{href:"#manually-registering-events"}},[e._v("Manually Registering Events")])]),t("li",[t("a",{attrs:{href:"#manually-registering-listeners"}},[e._v("Manually Registering Listeners")])])])]),t("li",[t("a",{attrs:{href:"#specifying-events"}},[e._v("Specifying Events")])]),t("li",[t("a",{attrs:{href:"#events-fired-in-krayin"}},[e._v("Events Fired in Krayin")])]),t("li",[t("a",{attrs:{href:"#listening-to-existing-events"}},[e._v("Listening to Existing Events")]),t("ul",[t("li",[t("a",{attrs:{href:"#registering-a-listener"}},[e._v("Registering a Listener")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Event Listeners in Krayin are a way to implement the observer pattern, where listeners respond to events that occur in the application. Events can be thought of as announcements made by the application, and listeners are the actions taken in response to those announcements. All event classes in Krayin are stored in the "),t("code",[e._v("Providers")]),e._v(" directory, and the listeners are stored in the "),t("code",[e._v("Listeners")]),e._v(" directory.")]),e._v(" "),t("p",[e._v("In Krayin, events and listeners are organized in a clear and structured manner:")]),e._v(" "),t("ul",[t("li",[e._v("Events are typically stored in the Events directory.")]),e._v(" "),t("li",[e._v("Listeners are stored in the Listeners directory.")])]),e._v(" "),t("p",[e._v("This organization makes it easy to manage and locate the event-driven components of your application.")]),e._v(" "),t("p",[e._v("To learn in detail about Controllers, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/events",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"creating-an-event-class"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-an-event-class"}},[e._v("#")]),e._v(" Creating an Event Class")]),e._v(" "),t("h3",{attrs:{id:"using-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-package-generator"}},[e._v("#")]),e._v(" Using Package Generator")]),e._v(" "),t("p",[e._v("If you have the Krayin Package Generator installed, you can use the following command to create a new event class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category\n")])])]),t("p",[e._v("If the event class already exists, you can use the --force option to overwrite it:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--force")]),e._v("\n")])])]),t("p",[e._v("Alternatively, if you don't have the package generator, you can create the file manually by creating a new class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-events"}},[e._v("#")]),e._v(" Manually Registering Events")]),e._v(" "),t("p",[e._v("In Krayin, you register events manually in the "),t("code",[e._v("boot")]),e._v(" method of your "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file. Here is an example of how to register events:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Register any other events for your application.\n *\n * @return void\n */")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'event.name'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'path-upto-listener@function'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, "),t("code",[e._v("event.name")]),e._v(" is the name of the event, and "),t("code",[e._v("path-upto-listener@function")]),e._v(" is the listener method that will handle the event.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-listeners"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-listeners"}},[e._v("#")]),e._v(" Manually Registering Listeners")]),e._v(" "),t("p",[e._v("When registering events, you specify the listener function to be executed when an event is triggered. Here is an example of how to register a listener:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("EventServiceProvider")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ServiceProvider")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Bootstrap services.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, the "),t("code",[e._v("lead.create.after")]),e._v(" event will trigger the "),t("code",[e._v("linkToEmail")]),e._v(" method of the "),t("code",[e._v("Leads")]),e._v(" listener in the "),t("code",[e._v("Webkul\\Admin\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("h2",{attrs:{id:"specifying-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specifying-events"}},[e._v("#")]),e._v(" Specifying Events")]),e._v(" "),t("p",[e._v("In Krayin, events are typically fired before and after the execution of CRUD operations. This allows listeners to perform additional actions, such as logging, notifications, or data manipulation, at specific points in the lifecycle of an operation.")]),e._v(" "),t("p",[e._v("For example, you might have events fired during product creation, updating, or deletion. Here’s an example of firing events before and after saving an order:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("namespace")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Sales"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Repositories")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("use")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Admin"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Http"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Requests"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("LeadForm")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("LeadController")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Repository")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Create a new controller instance.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("__construct")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("protected")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadRepository")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$leadRepository")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'entity_type'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'leads'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Store a newly created resource in storage.\n * \n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("store")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadForm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("stageRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("findOrFail")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("lead_pipeline_id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("else")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("pipelineRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("getDefaultPipeline")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("stages")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("first")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("in_array")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("code")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'won'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lost'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'closed_at'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Carbon")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("now")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("leadRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("session")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("flash")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("trans")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin::app.leads.create-success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("redirect")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("route")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin.leads.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("h2",{attrs:{id:"events-fired-in-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-fired-in-krayin"}},[e._v("#")]),e._v(" Events Fired in Krayin")]),e._v(" "),t("p",[e._v("In Krayin, there are several events fired throughout its operations, allowing developers to hook into specific points in the application's lifecycle to customize behavior or add functionality. Here's a list of events that are fired in Krayin, which you can listen to and handle as needed by creating event listeners:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Events name")]),e._v(" "),t("th",[e._v("Functionality")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("activity.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.before")]),e._v(" "),t("td",[e._v("This event will be fired before configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.after")]),e._v(" "),t("td",[e._v("This event will be fired after configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization created .")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("user.account.update-password")]),e._v(" "),t("td",[e._v("This event will be fired after user password gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get deleted")])])])]),e._v(" "),t("h2",{attrs:{id:"listening-to-existing-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-existing-events"}},[e._v("#")]),e._v(" Listening to Existing Events")]),e._v(" "),t("p",[e._v("Krayin uses events and listeners to implement the observer pattern, allowing you to respond to various actions and events within the application. You can listen to specific events and execute custom code when those events are triggered.")]),e._v(" "),t("h3",{attrs:{id:"registering-a-listener"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#registering-a-listener"}},[e._v("#")]),e._v(" Registering a Listener")]),e._v(" "),t("p",[e._v("Open the "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file located in the "),t("code",[e._v("Providers")]),e._v(" directory of your Krayin application. This file is where you register event listeners.")]),e._v(" "),t("p",[e._v("Inside the "),t("code",[e._v("boot()")]),e._v(" method of "),t("code",[e._v("EventServiceProvider.php")]),e._v(", use the "),t("code",[e._v("Event::listen")]),e._v(" method to register your listener. This method takes the event name and a callback function or a class method that will handle the event.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])]),t("p",[e._v("In the example above, we are listening to the "),t("code",[e._v("lead.create.before")]),e._v(" event and specifying the "),t("code",[e._v("createOrder")]),e._v(" function from the "),t("code",[e._v("Order")]),e._v(" listener class in the "),t("code",[e._v("Webkul\\Notification\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("p",[e._v("Replace "),t("code",[e._v("'lead.create.before'")]),e._v(" with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.")]),e._v(" "),t("p",[e._v("By registering the listener, you have associated the "),t("strong",[t("code",[e._v("createOrder")])]),e._v(" function with the "),t("strong",[t("code",[e._v("lead.create.before")])]),e._v(" event. Whenever this event is triggered, the specified function will be executed.")]),e._v(" "),t("p",[e._v("You can modify the listener function according to your requirements to perform the desired operation.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/30.c60eef57.js b/assets/js/30.a55bd7ed.js similarity index 99% rename from assets/js/30.c60eef57.js rename to assets/js/30.a55bd7ed.js index dfc0da9..3edde20 100644 --- a/assets/js/30.c60eef57.js +++ b/assets/js/30.a55bd7ed.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{327:function(t,e,n){"use strict";n.r(e);var a=n(10),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"view-render-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#view-render-event"}},[t._v("#")]),t._v(" View Render Event")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#render-view"}},[t._v("Render View")]),e("ul",[e("li",[e("a",{attrs:{href:"#listening-to-events"}},[t._v("Listening to Events")])]),e("li",[e("a",{attrs:{href:"#implementation-details"}},[t._v("Implementation Details")])]),e("li",[e("a",{attrs:{href:"#considerations"}},[t._v("Considerations")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin allows developers to inject content dynamically before or after the main content of a template. This functionality is useful for modifying template output without directly altering the template file itself, enhancing flexibility and maintainability in your application.")]),t._v(" "),e("h2",{attrs:{id:"render-view"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#render-view"}},[t._v("#")]),t._v(" Render View")]),t._v(" "),e("p",[t._v("To utilize the "),e("code",[t._v("view_render_event()")]),t._v(" function effectively, follow these steps:")]),t._v(" "),e("p",[t._v("In this example "),e("code",[t._v("admin.contacts.persons.create.header.before")]),t._v(" and "),e("code",[t._v("admin.contacts.persons.create.header.after")]),t._v(" are custom event names that denote where content should be injected before and after the page-header section, respectively inside the "),e("code",[t._v("packages/Webkul/Admin/src/Resources/views/contacts/persons/create.blade.php")]),t._v(" fie")]),t._v(" "),e("h3",{attrs:{id:"listening-to-events"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-events"}},[t._v("#")]),t._v(" Listening to Events")]),t._v(" "),e("p",[t._v("To handle these events and inject content dynamically, you need to listen to them in your application’s event system (typically in the "),e("code",[t._v("EventServiceProvider")]),t._v(").")]),t._v(" "),e("p",[t._v("Open your "),e("code",[t._v("EventServiceProvider.php")]),t._v(" file located in "),e("code",[t._v("app/Providers")]),t._v(" or similar directory.")]),t._v(" "),e("p",[t._v("In the "),e("code",[t._v("boot()")]),t._v(" method of your "),e("code",[t._v("EventServiceProvider")]),t._v(", add event listeners as follows:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/before_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Event")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("listen")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.contacts.persons.create.header.after'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/after_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("p",[t._v("Replace "),e("code",[t._v("'path/to/before_content_template.blade.php'")]),t._v(" and "),e("code",[t._v("'path/to/after_content_template.blade.php'")]),t._v(" with the actual paths to the Blade template files you want to inject.")]),t._v(" "),e("div",{staticClass:"custom-block warning"},[e("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),e("p",[t._v("Make sure that you have registered the "),e("strong",[e("code",[t._v("EventServiceProvider")])]),t._v(" in your own service provider.")])]),t._v(" "),e("h3",{attrs:{id:"implementation-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[t._v("#")]),t._v(" Implementation Details")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("$viewRenderEventManager->addTemplate()")]),t._v(": This method adds the specified template file to the rendering queue for the corresponding event. When the event is triggered during template rendering, Krayin will include the specified template's content at the designated injection point.")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Event Handling")]),t._v(": Ensure that you properly handle the events within your application’s event flow. This involves registering listeners correctly in EventServiceProvider and ensuring that the templates being injected are structured and formatted according to your application's requirements.")])])]),t._v(" "),e("h3",{attrs:{id:"considerations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#considerations"}},[t._v("#")]),t._v(" Considerations")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("Integration")]),t._v(": Integrate this functionality carefully into your Krayin application to maintain coherence and readability of your codebase")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Customization")]),t._v(": Customize event names ("),e("code",[t._v("'admin.contacts.persons.create.header.before'")]),t._v(", "),e("code",[t._v("'admin.contacts.persons.create.header.after'")]),t._v(") and template paths according to your specific application needs and structure.")])])]),t._v(" "),e("p",[t._v("By following these steps, you can effectively leverage the "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{324:function(t,e,n){"use strict";n.r(e);var a=n(10),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"view-render-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#view-render-event"}},[t._v("#")]),t._v(" View Render Event")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#render-view"}},[t._v("Render View")]),e("ul",[e("li",[e("a",{attrs:{href:"#listening-to-events"}},[t._v("Listening to Events")])]),e("li",[e("a",{attrs:{href:"#implementation-details"}},[t._v("Implementation Details")])]),e("li",[e("a",{attrs:{href:"#considerations"}},[t._v("Considerations")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin allows developers to inject content dynamically before or after the main content of a template. This functionality is useful for modifying template output without directly altering the template file itself, enhancing flexibility and maintainability in your application.")]),t._v(" "),e("h2",{attrs:{id:"render-view"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#render-view"}},[t._v("#")]),t._v(" Render View")]),t._v(" "),e("p",[t._v("To utilize the "),e("code",[t._v("view_render_event()")]),t._v(" function effectively, follow these steps:")]),t._v(" "),e("p",[t._v("In this example "),e("code",[t._v("admin.contacts.persons.create.header.before")]),t._v(" and "),e("code",[t._v("admin.contacts.persons.create.header.after")]),t._v(" are custom event names that denote where content should be injected before and after the page-header section, respectively inside the "),e("code",[t._v("packages/Webkul/Admin/src/Resources/views/contacts/persons/create.blade.php")]),t._v(" fie")]),t._v(" "),e("h3",{attrs:{id:"listening-to-events"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-events"}},[t._v("#")]),t._v(" Listening to Events")]),t._v(" "),e("p",[t._v("To handle these events and inject content dynamically, you need to listen to them in your application’s event system (typically in the "),e("code",[t._v("EventServiceProvider")]),t._v(").")]),t._v(" "),e("p",[t._v("Open your "),e("code",[t._v("EventServiceProvider.php")]),t._v(" file located in "),e("code",[t._v("app/Providers")]),t._v(" or similar directory.")]),t._v(" "),e("p",[t._v("In the "),e("code",[t._v("boot()")]),t._v(" method of your "),e("code",[t._v("EventServiceProvider")]),t._v(", add event listeners as follows:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/before_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Event")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("listen")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.contacts.persons.create.header.after'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/after_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("p",[t._v("Replace "),e("code",[t._v("'path/to/before_content_template.blade.php'")]),t._v(" and "),e("code",[t._v("'path/to/after_content_template.blade.php'")]),t._v(" with the actual paths to the Blade template files you want to inject.")]),t._v(" "),e("div",{staticClass:"custom-block warning"},[e("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),e("p",[t._v("Make sure that you have registered the "),e("strong",[e("code",[t._v("EventServiceProvider")])]),t._v(" in your own service provider.")])]),t._v(" "),e("h3",{attrs:{id:"implementation-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[t._v("#")]),t._v(" Implementation Details")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("$viewRenderEventManager->addTemplate()")]),t._v(": This method adds the specified template file to the rendering queue for the corresponding event. When the event is triggered during template rendering, Krayin will include the specified template's content at the designated injection point.")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Event Handling")]),t._v(": Ensure that you properly handle the events within your application’s event flow. This involves registering listeners correctly in EventServiceProvider and ensuring that the templates being injected are structured and formatted according to your application's requirements.")])])]),t._v(" "),e("h3",{attrs:{id:"considerations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#considerations"}},[t._v("#")]),t._v(" Considerations")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("Integration")]),t._v(": Integrate this functionality carefully into your Krayin application to maintain coherence and readability of your codebase")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Customization")]),t._v(": Customize event names ("),e("code",[t._v("'admin.contacts.persons.create.header.before'")]),t._v(", "),e("code",[t._v("'admin.contacts.persons.create.header.after'")]),t._v(") and template paths according to your specific application needs and structure.")])])]),t._v(" "),e("p",[t._v("By following these steps, you can effectively leverage the "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/32.1d6f5457.js b/assets/js/32.75d1191b.js similarity index 98% rename from assets/js/32.1d6f5457.js rename to assets/js/32.75d1191b.js index bf12790..61368ce 100644 --- a/assets/js/32.1d6f5457.js +++ b/assets/js/32.75d1191b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{326:function(a,t,e){"use strict";e.r(t);var s=e(10),n=Object(s.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"krayin-apis"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#krayin-apis"}},[a._v("#")]),a._v(" Krayin APIs")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#rest-api"}},[a._v("REST API")])]),t("li",[t("a",{attrs:{href:"#explore-rest-api-demo"}},[a._v("Explore REST API Demo")])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"rest-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rest-api"}},[a._v("#")]),a._v(" REST API")]),a._v(" "),t("p",[a._v("Krayin REST API is a medium to use the features of the core Krayin System. By using Krayin REST API, you can integrate your application to serve the default content of Krayin.")]),a._v(" "),t("h2",{attrs:{id:"explore-rest-api-demo"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explore-rest-api-demo"}},[a._v("#")]),a._v(" Explore REST API Demo")]),a._v(" "),t("p",[a._v("Welcome to our API demo! Dive into the interactive showcase of our API functionalities to get a hands-on experience of how our platform works. Click the Link below to access the demo:")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://demo.krayincrm.com/krayin-rest-api/",target:"_blank",rel:"noopener noreferrer"}},[a._v("Access API Demo"),t("OutboundLink")],1)]),a._v(" "),t("h4",{attrs:{id:"click-the-link-below-to-access-admin-api-documentation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#click-the-link-below-to-access-admin-api-documentation"}},[a._v("#")]),a._v(" Click the Link below to access Admin API documentation")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://demo.krayincrm.com/krayin-rest-api-24046b004402/api/documentation",target:"_blank",rel:"noopener noreferrer"}},[a._v("Admin"),t("OutboundLink")],1)]),a._v(" "),t("h4",{attrs:{id:"installation-of-rest-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installation-of-rest-api"}},[a._v("#")]),a._v(" Installation of REST API")]),a._v(" "),t("p",[a._v("To install Krayin REST API, you need to follow some steps.")]),a._v(" "),t("ul",[t("li",[a._v("To install Krayin REST API from your console:")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("composer require krayin/rest-api\n")])])]),t("ul",[t("li",[a._v("Add below options in the .env file (i.e. http://localhost/public your domain):")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("SANCTUM_STATEFUL_DOMAINS=http://localhost/public\n")])])]),t("ul",[t("li",[a._v("To configure the REST API L5-Swagger Documentation run below command:")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("php artisan krayin-rest-api:install\n")])])]),t("ul",[t("li",[a._v("To check the Admin end API documentation:")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("http://localhost/public/api/admin/documentation\n")])])]),t("ul",[t("li",[a._v("You can check the "),t("a",{attrs:{href:"https://github.com/DarkaOnLine/L5-Swagger"}},[a._v(" L5-Swagger ")]),a._v(" guidelines too regarding the configuration the API documentation.")])]),a._v(" "),t("ul",[t("li",[a._v("For admin login, add Laravel Sanctum's API token to the Admin model follow the given path.")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("packages/Webkul/User/src/Models/Admin.php\n")])])]),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("integer")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'parent_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token keyword type-declaration"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("longText")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'description'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("tinyInteger")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("default")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("timestamps")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/**\n * Reverse the migrations.\n *\n * @return void\n */")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("function")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[a._v("down")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[a._v("Schema")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("dropIfExists")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),t("h3",{attrs:{id:"loading-migration-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#loading-migration-from-package"}},[a._v("#")]),a._v(" Loading Migration from Package")]),a._v(" "),t("p",[a._v("We need to add the migrations to our service provider to load them.")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadMigrationsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Database/Migrations'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),t("h3",{attrs:{id:"creating-tables-from-migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-tables-from-migrations"}},[a._v("#")]),a._v(" Creating Tables from Migrations")]),a._v(" "),t("p",[a._v("Run the following command to create the "),t("strong",[t("code",[a._v("Category")])]),a._v(" table in your database.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("php artisan migrate\n")])])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{345:function(a,t,s){"use strict";s.r(t);var n=s(10),e=Object(n.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#migrations"}},[a._v("#")]),a._v(" Migrations")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[a._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[a._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#loading-migration-from-package"}},[a._v("Loading Migration from Package")])]),t("li",[t("a",{attrs:{href:"#creating-tables-from-migrations"}},[a._v("Creating Tables from Migrations")])])])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),t("p",[a._v("Migrations are like version control for your database, allowing your team to define and share the application's database schema definition.")]),a._v(" "),t("p",[a._v("Krayin leverages the Laravel Schema facade to offer database-agnostic support for creating and manipulating tables across various database systems supported by Laravel. Migrations in Krayin utilize this powerful feature to manage database schema changes efficiently.")]),a._v(" "),t("p",[a._v("To understand Migrations in detail, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/10.x/migrations",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),t("OutboundLink")],1),a._v(".")]),a._v(" "),t("p",[a._v("Let's create a new migration file for your application. We will assume that the package name is \""),t("strong",[a._v("Category")]),a._v('". Follow these steps:')]),a._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[a._v("#")]),a._v(" Using Krayin Package Generator")]),a._v(" "),t("p",[a._v("This command creates a new migration class in the "),t("strong",[t("code",[a._v("packages/Webkul/Category/src/Database/Migrations")])]),a._v(" directory.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan package:make-migration CreateCategoryTable Webkul/Category\n")])])]),t("ul",[t("li",[t("code",[a._v("CreateCategoryTable")]),a._v(" Specifies the name of the migration file.")]),a._v(" "),t("li",[t("code",[a._v("Webkul/Category")]),a._v(" Specifies the package name")])]),a._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[a._v("#")]),a._v(" Using Laravel Artisan Command")]),a._v(" "),t("p",[a._v("Create a "),t("code",[a._v("Database")]),a._v(" directory in the "),t("code",[a._v("packages/Webkul/Category/src")]),a._v(" path. Inside the "),t("code",[a._v("Database")]),a._v(" directory, create "),t("code",[a._v("Migrations")]),a._v(" and "),t("code",[a._v("Seeders")]),a._v(" directories.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Database\n ├── Migrations\n └── Seeders\n")])])]),t("p",[a._v("Run the following command with the "),t("code",[a._v("--path")]),a._v(" option to specify where your migration file will be placed.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan make:migration create_categories_table "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("packages/Webkul/Category/src/Database/Migrations\n")])])]),t("p",[a._v("To create a new database table Copy the code provided here and paste it into your migration file. The create method used on the Schema facade. The create method accepts two arguments: the first is the name of the table, while the second is a closure which receives a Blueprint object that may be used to define the new table:")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("integer")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'parent_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token keyword type-declaration"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("longText")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'description'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("tinyInteger")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("default")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("timestamps")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/**\n * Reverse the migrations.\n *\n * @return void\n */")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("function")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[a._v("down")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[a._v("Schema")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("dropIfExists")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),t("h3",{attrs:{id:"loading-migration-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#loading-migration-from-package"}},[a._v("#")]),a._v(" Loading Migration from Package")]),a._v(" "),t("p",[a._v("We need to add the migrations to our service provider to load them.")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadMigrationsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Database/Migrations'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),t("h3",{attrs:{id:"creating-tables-from-migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-tables-from-migrations"}},[a._v("#")]),a._v(" Creating Tables from Migrations")]),a._v(" "),t("p",[a._v("Run the following command to create the "),t("strong",[t("code",[a._v("Category")])]),a._v(" table in your database.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("php artisan migrate\n")])])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/49.f1928147.js b/assets/js/49.f5d98cf0.js similarity index 99% rename from assets/js/49.f1928147.js rename to assets/js/49.f5d98cf0.js index cffdbcf..1c3936a 100644 --- a/assets/js/49.f1928147.js +++ b/assets/js/49.f5d98cf0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{345:function(e,t,a){"use strict";a.r(t);var s=a(10),n=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#models"}},[e._v("#")]),e._v(" Models")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[e._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[e._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#create-the-contract"}},[e._v("Create the Contract")])]),t("li",[t("a",{attrs:{href:"#create-the-proxy"}},[e._v("Create the Proxy")])]),t("li",[t("a",{attrs:{href:"#create-the-model"}},[e._v("Create the Model")])]),t("li",[t("a",{attrs:{href:"#create-module-service-provider"}},[e._v("Create Module Service Provider")])]),t("li",[t("a",{attrs:{href:"#registering-moduleserviceprovider"}},[e._v("Registering ModuleServiceProvider")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v('Laravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using Eloquent, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.\nTo understand Models in detail, you can visit the Laravel documentation '),t("a",{attrs:{href:"https://laravel.com/docs/10.x/eloquent",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We are using the "),t("a",{attrs:{href:"https://packagist.org/packages/konekt/concord",target:"_blank",rel:"noopener noreferrer"}},[e._v("konekt/concord"),t("OutboundLink")],1),e._v(" package, which is an extension of Laravel. It helps in building modular Laravel applications.")]),e._v(" "),t("p",[e._v("Let's create a new model for your application. We will assume that the package name is \""),t("strong",[e._v("Category")]),e._v('". Follow these steps:')]),e._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[e._v("#")]),e._v(" Using Krayin Package Generator")]),e._v(" "),t("p",[e._v("To create a new "),t("code",[e._v("Category")]),e._v(" Model inside your package using the Krayin Package Generator, follow these steps")]),e._v(" "),t("p",[e._v("Execute the following command in your terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-model Category Webkul/Category\n")])])]),t("p",[e._v("This command creates the following files:")]),e._v(" "),t("ul",[t("li",[e._v("New model "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model proxy "),t("strong",[t("code",[e._v("CategoryProxy.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model contract "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Contracts")])]),e._v(" directory.")])]),e._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[e._v("#")]),e._v(" Using Laravel Artisan Command")]),e._v(" "),t("p",[e._v("Before creating the model class, it's essential to create two additional components: the "),t("code",[e._v("Contract")]),e._v(" and the "),t("code",[e._v("Proxy")]),e._v(".")]),e._v(" "),t("h3",{attrs:{id:"create-the-contract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-contract"}},[e._v("#")]),e._v(" Create the Contract")]),e._v(" "),t("p",[e._v("Laravel's Contracts are a set of interfaces that define the core services provided by the framework. For example, the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Queue\\Queue")])]),e._v(" contract defines the methods needed for queueing jobs, while the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Mail\\Mailer")])]),e._v(" contract defines the methods needed for sending an email.")]),e._v(" "),t("p",[e._v("Each contract has a corresponding implementation provided by the framework. For example, Laravel provides a queue implementation with various drivers and a mailer implementation powered by SwiftMailer.")]),e._v(" "),t("p",[e._v("All Laravel contracts are stored in their own GitHub repository. This provides a quick reference for all available contracts and a single, decoupled package that can be used by package developers.")]),e._v(" "),t("p",[e._v("Now, create a directory named "),t("strong",[t("code",[e._v("Contracts")])]),e._v(" inside "),t("strong",[t("code",[e._v("Webkul/Category/src/")])]),e._v(" and create an interface file named "),t("strong",[t("code",[e._v("Category.php")])]),e._v(".")]),e._v(" "),t("div",{staticClass:"language-structure extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("packages\n└── Webkul\n └── Category\n └── src\n └── Contracts\n └── Category.php\n")])])]),t("p",[e._v("Copy the following code into the "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" file.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// Other service providers")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Category"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Providers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("ModuleServiceProvider")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{346:function(e,t,a){"use strict";a.r(t);var s=a(10),n=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#models"}},[e._v("#")]),e._v(" Models")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[e._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[e._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#create-the-contract"}},[e._v("Create the Contract")])]),t("li",[t("a",{attrs:{href:"#create-the-proxy"}},[e._v("Create the Proxy")])]),t("li",[t("a",{attrs:{href:"#create-the-model"}},[e._v("Create the Model")])]),t("li",[t("a",{attrs:{href:"#create-module-service-provider"}},[e._v("Create Module Service Provider")])]),t("li",[t("a",{attrs:{href:"#registering-moduleserviceprovider"}},[e._v("Registering ModuleServiceProvider")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v('Laravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using Eloquent, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.\nTo understand Models in detail, you can visit the Laravel documentation '),t("a",{attrs:{href:"https://laravel.com/docs/10.x/eloquent",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We are using the "),t("a",{attrs:{href:"https://packagist.org/packages/konekt/concord",target:"_blank",rel:"noopener noreferrer"}},[e._v("konekt/concord"),t("OutboundLink")],1),e._v(" package, which is an extension of Laravel. It helps in building modular Laravel applications.")]),e._v(" "),t("p",[e._v("Let's create a new model for your application. We will assume that the package name is \""),t("strong",[e._v("Category")]),e._v('". Follow these steps:')]),e._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[e._v("#")]),e._v(" Using Krayin Package Generator")]),e._v(" "),t("p",[e._v("To create a new "),t("code",[e._v("Category")]),e._v(" Model inside your package using the Krayin Package Generator, follow these steps")]),e._v(" "),t("p",[e._v("Execute the following command in your terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-model Category Webkul/Category\n")])])]),t("p",[e._v("This command creates the following files:")]),e._v(" "),t("ul",[t("li",[e._v("New model "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model proxy "),t("strong",[t("code",[e._v("CategoryProxy.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model contract "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Contracts")])]),e._v(" directory.")])]),e._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[e._v("#")]),e._v(" Using Laravel Artisan Command")]),e._v(" "),t("p",[e._v("Before creating the model class, it's essential to create two additional components: the "),t("code",[e._v("Contract")]),e._v(" and the "),t("code",[e._v("Proxy")]),e._v(".")]),e._v(" "),t("h3",{attrs:{id:"create-the-contract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-contract"}},[e._v("#")]),e._v(" Create the Contract")]),e._v(" "),t("p",[e._v("Laravel's Contracts are a set of interfaces that define the core services provided by the framework. For example, the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Queue\\Queue")])]),e._v(" contract defines the methods needed for queueing jobs, while the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Mail\\Mailer")])]),e._v(" contract defines the methods needed for sending an email.")]),e._v(" "),t("p",[e._v("Each contract has a corresponding implementation provided by the framework. For example, Laravel provides a queue implementation with various drivers and a mailer implementation powered by SwiftMailer.")]),e._v(" "),t("p",[e._v("All Laravel contracts are stored in their own GitHub repository. This provides a quick reference for all available contracts and a single, decoupled package that can be used by package developers.")]),e._v(" "),t("p",[e._v("Now, create a directory named "),t("strong",[t("code",[e._v("Contracts")])]),e._v(" inside "),t("strong",[t("code",[e._v("Webkul/Category/src/")])]),e._v(" and create an interface file named "),t("strong",[t("code",[e._v("Category.php")])]),e._v(".")]),e._v(" "),t("div",{staticClass:"language-structure extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("packages\n└── Webkul\n └── Category\n └── src\n └── Contracts\n └── Category.php\n")])])]),t("p",[e._v("Copy the following code into the "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" file.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// Other service providers")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Category"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Providers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("ModuleServiceProvider")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/50.6c157082.js b/assets/js/50.6c157082.js deleted file mode 100644 index 0b3e9e4..0000000 --- a/assets/js/50.6c157082.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{346:function(t,a,e){"use strict";e.r(a);var s=e(10),r=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"getting-started"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#prerequisites"}},[t._v("Prerequisites")])]),a("li",[a("a",{attrs:{href:"#using-krayin-package-generator"}},[t._v("Using Krayin Package Generator")]),a("ul",[a("li",[a("a",{attrs:{href:"#registering-your-package"}},[t._v("Registering Your Package")])]),a("li",[a("a",{attrs:{href:"#run-the-commands"}},[t._v("Run the Commands")])])])]),a("li",[a("a",{attrs:{href:"#manual-setup-of-files"}},[t._v("Manual Setup of Files")]),a("ul",[a("li",[a("a",{attrs:{href:"#create-package-directory"}},[t._v("Create Package Directory")])]),a("li",[a("a",{attrs:{href:"#create-service-provider"}},[t._v("Create Service Provider")])]),a("li",[a("a",{attrs:{href:"#register-your-package"}},[t._v("Register Your Package")])]),a("li",[a("a",{attrs:{href:"#run-the-commands"}},[t._v("Run the Commands")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("A package is a self-contained module that encapsulates specific features or functionality, allowing developers to add custom features without altering the core codebase. This approach not only preserves the integrity of the core system but also ensures that updates and maintenance can be carried out smoothly.")]),t._v(" "),a("p",[t._v("By developing packages, you can introduce new functionalities, integrate third-party services, or customize existing features to better meet your business requirements. Each package is isolated, promoting clean code practices and enabling easier debugging and testing.")]),t._v(" "),a("p",[t._v("This guide will take you through the process of creating a package for Krayin, from setting up the directory structure to defining configurations, routes, controllers, models, and views. By the end of this guide, you will have a solid understanding of how to develop and integrate packages into the Krayin platform, enhancing its capabilities while maintaining a robust and maintainable codebase.")]),t._v(" "),a("h2",{attrs:{id:"prerequisites"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[t._v("#")]),t._v(" Prerequisites")]),t._v(" "),a("ul",[a("li",[t._v("A working Krayin application")]),t._v(" "),a("li",[t._v("Composer installed")])]),t._v(" "),a("h2",{attrs:{id:"using-krayin-package-generator"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[t._v("#")]),t._v(" Using Krayin Package Generator")]),t._v(" "),a("p",[t._v("To facilitate package development, you can use the "),a("a",{attrs:{href:"https://github.com/krayin/laravel-crm-package-generator",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin Package Generator"),a("OutboundLink")],1),t._v(". Follow the steps below to install it:")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Install the Krayin Package Generator by running the following command in the root directory of your Krayin application:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" require krayin/krayin-package-generator\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Once installed, you can generate your package using the following command:")]),t._v(" "),a("p",[t._v('We will assume that the package name is "'),a("strong",[t._v("Category")]),t._v('".')]),t._v(" "),a("ul",[a("li",[t._v("If the package directory does not exist:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("php artisan package:make Webkul/Category\n")])])]),a("ul",[a("li",[t._v("If the package directory already exists, you can use the "),a("strong",[a("code",[t._v("--force")])]),t._v(" option to overwrite it:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("php artisan package:make Webkul/Category "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--force")]),t._v("\n")])])]),a("p",[t._v("This command will set up the necessary files and directories in the "),a("strong",[a("code",[t._v("packages")])]),t._v(" directory.")])])]),t._v(" "),a("h3",{attrs:{id:"registering-your-package"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#registering-your-package"}},[t._v("#")]),t._v(" Registering Your Package")]),t._v(" "),a("p",[t._v("To register your package, follow these steps:")]),t._v(" "),a("p",[t._v("Add your package's namespace to the "),a("strong",[a("code",[t._v("psr-4")])]),t._v(" section in the "),a("strong",[a("code",[t._v("composer.json")])]),t._v(" file located in the root directory of your Krayin application. Update it as follows:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"autoload"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ...\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"psr-4"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Webkul\\\\Category\\\\"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"packages/Webkul/Category/src"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n ...\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Register your package's service provider in the "),a("strong",[a("code",[t._v("config/app.php")])]),t._v(" file located in the root directory of your Krayin application. Add the following line to the "),a("strong",[a("code",[t._v("providers")])]),t._v(" array:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("defaultProviders")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("merge")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Other service providers")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Other configuration options")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),a("h3",{attrs:{id:"run-the-commands"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#run-the-commands"}},[t._v("#")]),t._v(" Run the Commands")]),t._v(" "),a("p",[t._v("Run the following commands to autoload your package and publish its assets and configurations:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" dump-autoload\nphp artisan optimize\nphp artisan vendor:publish "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--provider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider\n")])])]),a("p",[t._v("When prompted to select which items to publish, choose the number corresponding to "),a("strong",[a("code",[t._v('"Webkul\\Category\\Providers\\CategoryServiceProvider"')])]),t._v(" and press enter to publish all assets and configurations.")]),t._v(" "),a("p",[t._v("Congratulations! Your package is now registered and ready to use. Start creating something cool!")]),t._v(" "),a("h2",{attrs:{id:"manual-setup-of-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#manual-setup-of-files"}},[t._v("#")]),t._v(" Manual Setup of Files")]),t._v(" "),a("p",[t._v("If you prefer to set up your package manually, follow these steps assuming you are familiar with package directory structures and workflows. We'll use the default "),a("strong",[a("code",[t._v("package")])]),t._v(" directory in Krayin as an example.")]),t._v(" "),a("h3",{attrs:{id:"create-package-directory"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-package-directory"}},[t._v("#")]),t._v(" Create Package Directory")]),t._v(" "),a("p",[t._v("Inside the "),a("strong",[a("code",[t._v("packages/Webkul")])]),t._v(" directory, create a directory with your package name. Your structure should look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("└── packages\n └── Webkul\n └── Category\n")])])]),a("p",[t._v("In your package directory, create a directory named as "),a("strong",[a("code",[t._v("src")])]),t._v(". This is where you'll put all your package-related files. Your updated structure will look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n")])])]),a("h3",{attrs:{id:"create-service-provider"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-service-provider"}},[t._v("#")]),t._v(" Create Service Provider")]),t._v(" "),a("p",[t._v("In the "),a("strong",[a("code",[t._v("src")])]),t._v(" directory, create a directory named as "),a("strong",[a("code",[t._v("Providers")])]),t._v(". Inside that directory, create a file named as "),a("strong",[a("code",[t._v("CategoryServiceProvider.php")])]),t._v(". Your structure should look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n └── Providers\n └── CategoryServiceProvider.php\n")])])]),a("p",[t._v("Copy the following code and paste it into "),a("strong",[a("code",[t._v("CategoryServiceProvider.php")])]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("defaultProviders")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("merge")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),a("h3",{attrs:{id:"run-the-commands-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#run-the-commands-2"}},[t._v("#")]),t._v(" Run the Commands")]),t._v(" "),a("p",[t._v("Run the following command to autoload your package:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" dump-autoload\n")])])]),a("p",[t._v("Your package is now ready to use !")])])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/86.bb5486b6.js b/assets/js/50.a2610b5b.js similarity index 99% rename from assets/js/86.bb5486b6.js rename to assets/js/50.a2610b5b.js index a1d71d1..e82f59b 100644 --- a/assets/js/86.bb5486b6.js +++ b/assets/js/50.a2610b5b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[86],{384:function(t,a,e){"use strict";e.r(a);var s=e(10),r=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"getting-started"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#prerequisites"}},[t._v("Prerequisites")])]),a("li",[a("a",{attrs:{href:"#using-krayin-package-generator"}},[t._v("Using Krayin Package Generator")]),a("ul",[a("li",[a("a",{attrs:{href:"#registering-your-package"}},[t._v("Registering Your Package")])]),a("li",[a("a",{attrs:{href:"#run-the-commands"}},[t._v("Run the Commands")])])])]),a("li",[a("a",{attrs:{href:"#manual-setup-of-files"}},[t._v("Manual Setup of Files")]),a("ul",[a("li",[a("a",{attrs:{href:"#create-package-directory"}},[t._v("Create Package Directory")])]),a("li",[a("a",{attrs:{href:"#create-service-provider"}},[t._v("Create Service Provider")])]),a("li",[a("a",{attrs:{href:"#register-your-package"}},[t._v("Register Your Package")])]),a("li",[a("a",{attrs:{href:"#run-the-commands"}},[t._v("Run the Commands")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("A package is a self-contained module that encapsulates specific features or functionality, allowing developers to add custom features without altering the core codebase. This approach not only preserves the integrity of the core system but also ensures that updates and maintenance can be carried out smoothly.")]),t._v(" "),a("p",[t._v("By developing packages, you can introduce new functionalities, integrate third-party services, or customize existing features to better meet your business requirements. Each package is isolated, promoting clean code practices and enabling easier debugging and testing.")]),t._v(" "),a("p",[t._v("This guide will take you through the process of creating a package for Krayin, from setting up the directory structure to defining configurations, routes, controllers, models, and views. By the end of this guide, you will have a solid understanding of how to develop and integrate packages into the Krayin platform, enhancing its capabilities while maintaining a robust and maintainable codebase.")]),t._v(" "),a("h2",{attrs:{id:"prerequisites"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[t._v("#")]),t._v(" Prerequisites")]),t._v(" "),a("ul",[a("li",[t._v("A working Krayin application")]),t._v(" "),a("li",[t._v("Composer installed")])]),t._v(" "),a("h2",{attrs:{id:"using-krayin-package-generator"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[t._v("#")]),t._v(" Using Krayin Package Generator")]),t._v(" "),a("p",[t._v("To facilitate package development, you can use the "),a("a",{attrs:{href:"https://github.com/krayin/laravel-crm-package-generator",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin Package Generator"),a("OutboundLink")],1),t._v(". Follow the steps below to install it:")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Install the Krayin Package Generator by running the following command in the root directory of your Krayin application:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" require krayin/krayin-package-generator\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Once installed, you can generate your package using the following command:")]),t._v(" "),a("p",[t._v('We will assume that the package name is "'),a("strong",[t._v("Category")]),t._v('".')]),t._v(" "),a("ul",[a("li",[t._v("If the package directory does not exist:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("php artisan package:make Webkul/Category\n")])])]),a("ul",[a("li",[t._v("If the package directory already exists, you can use the "),a("strong",[a("code",[t._v("--force")])]),t._v(" option to overwrite it:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("php artisan package:make Webkul/Category "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--force")]),t._v("\n")])])]),a("p",[t._v("This command will set up the necessary files and directories in the "),a("strong",[a("code",[t._v("packages")])]),t._v(" directory.")])])]),t._v(" "),a("h3",{attrs:{id:"registering-your-package"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#registering-your-package"}},[t._v("#")]),t._v(" Registering Your Package")]),t._v(" "),a("p",[t._v("To register your package, follow these steps:")]),t._v(" "),a("p",[t._v("Add your package's namespace to the "),a("strong",[a("code",[t._v("psr-4")])]),t._v(" section in the "),a("strong",[a("code",[t._v("composer.json")])]),t._v(" file located in the root directory of your Krayin application. Update it as follows:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"autoload"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ...\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"psr-4"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Webkul\\\\Category\\\\"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"packages/Webkul/Category/src"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n ...\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Register your package's service provider in the "),a("strong",[a("code",[t._v("config/app.php")])]),t._v(" file located in the root directory of your Krayin application. Add the following line to the "),a("strong",[a("code",[t._v("providers")])]),t._v(" array:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("defaultProviders")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("merge")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Other service providers")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Other configuration options")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),a("h3",{attrs:{id:"run-the-commands"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#run-the-commands"}},[t._v("#")]),t._v(" Run the Commands")]),t._v(" "),a("p",[t._v("Run the following commands to autoload your package and publish its assets and configurations:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" dump-autoload\nphp artisan optimize\nphp artisan vendor:publish "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--provider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider\n")])])]),a("p",[t._v("When prompted to select which items to publish, choose the number corresponding to "),a("strong",[a("code",[t._v('"Webkul\\Category\\Providers\\CategoryServiceProvider"')])]),t._v(" and press enter to publish all assets and configurations.")]),t._v(" "),a("p",[t._v("Congratulations! Your package is now registered and ready to use. Start creating something cool!")]),t._v(" "),a("h2",{attrs:{id:"manual-setup-of-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#manual-setup-of-files"}},[t._v("#")]),t._v(" Manual Setup of Files")]),t._v(" "),a("p",[t._v("If you prefer to set up your package manually, follow these steps assuming you are familiar with package directory structures and workflows. We'll use the default "),a("strong",[a("code",[t._v("package")])]),t._v(" directory in Krayin as an example.")]),t._v(" "),a("h3",{attrs:{id:"create-package-directory"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-package-directory"}},[t._v("#")]),t._v(" Create Package Directory")]),t._v(" "),a("p",[t._v("Inside the "),a("strong",[a("code",[t._v("packages/Webkul")])]),t._v(" directory, create a directory with your package name. Your structure should look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("└── packages\n └── Webkul\n └── Category\n")])])]),a("p",[t._v("In your package directory, create a directory named as "),a("strong",[a("code",[t._v("src")])]),t._v(". This is where you'll put all your package-related files. Your updated structure will look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n")])])]),a("h3",{attrs:{id:"create-service-provider"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-service-provider"}},[t._v("#")]),t._v(" Create Service Provider")]),t._v(" "),a("p",[t._v("In the "),a("strong",[a("code",[t._v("src")])]),t._v(" directory, create a directory named as "),a("strong",[a("code",[t._v("Providers")])]),t._v(". Inside that directory, create a file named as "),a("strong",[a("code",[t._v("CategoryServiceProvider.php")])]),t._v(". Your structure should look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n └── Providers\n └── CategoryServiceProvider.php\n")])])]),a("p",[t._v("Copy the following code and paste it into "),a("strong",[a("code",[t._v("CategoryServiceProvider.php")])]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("defaultProviders")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("merge")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),a("h3",{attrs:{id:"run-the-commands-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#run-the-commands-2"}},[t._v("#")]),t._v(" Run the Commands")]),t._v(" "),a("p",[t._v("Run the following command to autoload your package:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" dump-autoload\n")])])]),a("p",[t._v("Your package is now ready to use !")])])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{347:function(t,a,e){"use strict";e.r(a);var s=e(10),r=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"getting-started"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#prerequisites"}},[t._v("Prerequisites")])]),a("li",[a("a",{attrs:{href:"#using-krayin-package-generator"}},[t._v("Using Krayin Package Generator")]),a("ul",[a("li",[a("a",{attrs:{href:"#registering-your-package"}},[t._v("Registering Your Package")])]),a("li",[a("a",{attrs:{href:"#run-the-commands"}},[t._v("Run the Commands")])])])]),a("li",[a("a",{attrs:{href:"#manual-setup-of-files"}},[t._v("Manual Setup of Files")]),a("ul",[a("li",[a("a",{attrs:{href:"#create-package-directory"}},[t._v("Create Package Directory")])]),a("li",[a("a",{attrs:{href:"#create-service-provider"}},[t._v("Create Service Provider")])]),a("li",[a("a",{attrs:{href:"#register-your-package"}},[t._v("Register Your Package")])]),a("li",[a("a",{attrs:{href:"#run-the-commands"}},[t._v("Run the Commands")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("A package is a self-contained module that encapsulates specific features or functionality, allowing developers to add custom features without altering the core codebase. This approach not only preserves the integrity of the core system but also ensures that updates and maintenance can be carried out smoothly.")]),t._v(" "),a("p",[t._v("By developing packages, you can introduce new functionalities, integrate third-party services, or customize existing features to better meet your business requirements. Each package is isolated, promoting clean code practices and enabling easier debugging and testing.")]),t._v(" "),a("p",[t._v("This guide will take you through the process of creating a package for Krayin, from setting up the directory structure to defining configurations, routes, controllers, models, and views. By the end of this guide, you will have a solid understanding of how to develop and integrate packages into the Krayin platform, enhancing its capabilities while maintaining a robust and maintainable codebase.")]),t._v(" "),a("h2",{attrs:{id:"prerequisites"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[t._v("#")]),t._v(" Prerequisites")]),t._v(" "),a("ul",[a("li",[t._v("A working Krayin application")]),t._v(" "),a("li",[t._v("Composer installed")])]),t._v(" "),a("h2",{attrs:{id:"using-krayin-package-generator"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[t._v("#")]),t._v(" Using Krayin Package Generator")]),t._v(" "),a("p",[t._v("To facilitate package development, you can use the "),a("a",{attrs:{href:"https://github.com/krayin/laravel-crm-package-generator",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin Package Generator"),a("OutboundLink")],1),t._v(". Follow the steps below to install it:")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Install the Krayin Package Generator by running the following command in the root directory of your Krayin application:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" require krayin/krayin-package-generator\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Once installed, you can generate your package using the following command:")]),t._v(" "),a("p",[t._v('We will assume that the package name is "'),a("strong",[t._v("Category")]),t._v('".')]),t._v(" "),a("ul",[a("li",[t._v("If the package directory does not exist:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("php artisan package:make Webkul/Category\n")])])]),a("ul",[a("li",[t._v("If the package directory already exists, you can use the "),a("strong",[a("code",[t._v("--force")])]),t._v(" option to overwrite it:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("php artisan package:make Webkul/Category "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--force")]),t._v("\n")])])]),a("p",[t._v("This command will set up the necessary files and directories in the "),a("strong",[a("code",[t._v("packages")])]),t._v(" directory.")])])]),t._v(" "),a("h3",{attrs:{id:"registering-your-package"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#registering-your-package"}},[t._v("#")]),t._v(" Registering Your Package")]),t._v(" "),a("p",[t._v("To register your package, follow these steps:")]),t._v(" "),a("p",[t._v("Add your package's namespace to the "),a("strong",[a("code",[t._v("psr-4")])]),t._v(" section in the "),a("strong",[a("code",[t._v("composer.json")])]),t._v(" file located in the root directory of your Krayin application. Update it as follows:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"autoload"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ...\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"psr-4"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Webkul\\\\Category\\\\"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"packages/Webkul/Category/src"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n ...\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Register your package's service provider in the "),a("strong",[a("code",[t._v("config/app.php")])]),t._v(" file located in the root directory of your Krayin application. Add the following line to the "),a("strong",[a("code",[t._v("providers")])]),t._v(" array:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("defaultProviders")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("merge")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Other service providers")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Other configuration options")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),a("h3",{attrs:{id:"run-the-commands"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#run-the-commands"}},[t._v("#")]),t._v(" Run the Commands")]),t._v(" "),a("p",[t._v("Run the following commands to autoload your package and publish its assets and configurations:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" dump-autoload\nphp artisan optimize\nphp artisan vendor:publish "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--provider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider\n")])])]),a("p",[t._v("When prompted to select which items to publish, choose the number corresponding to "),a("strong",[a("code",[t._v('"Webkul\\Category\\Providers\\CategoryServiceProvider"')])]),t._v(" and press enter to publish all assets and configurations.")]),t._v(" "),a("p",[t._v("Congratulations! Your package is now registered and ready to use. Start creating something cool!")]),t._v(" "),a("h2",{attrs:{id:"manual-setup-of-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#manual-setup-of-files"}},[t._v("#")]),t._v(" Manual Setup of Files")]),t._v(" "),a("p",[t._v("If you prefer to set up your package manually, follow these steps assuming you are familiar with package directory structures and workflows. We'll use the default "),a("strong",[a("code",[t._v("package")])]),t._v(" directory in Krayin as an example.")]),t._v(" "),a("h3",{attrs:{id:"create-package-directory"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-package-directory"}},[t._v("#")]),t._v(" Create Package Directory")]),t._v(" "),a("p",[t._v("Inside the "),a("strong",[a("code",[t._v("packages/Webkul")])]),t._v(" directory, create a directory with your package name. Your structure should look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("└── packages\n └── Webkul\n └── Category\n")])])]),a("p",[t._v("In your package directory, create a directory named as "),a("strong",[a("code",[t._v("src")])]),t._v(". This is where you'll put all your package-related files. Your updated structure will look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n")])])]),a("h3",{attrs:{id:"create-service-provider"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-service-provider"}},[t._v("#")]),t._v(" Create Service Provider")]),t._v(" "),a("p",[t._v("In the "),a("strong",[a("code",[t._v("src")])]),t._v(" directory, create a directory named as "),a("strong",[a("code",[t._v("Providers")])]),t._v(". Inside that directory, create a file named as "),a("strong",[a("code",[t._v("CategoryServiceProvider.php")])]),t._v(". Your structure should look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n └── Providers\n └── CategoryServiceProvider.php\n")])])]),a("p",[t._v("Copy the following code and paste it into "),a("strong",[a("code",[t._v("CategoryServiceProvider.php")])]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("defaultProviders")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("merge")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),a("h3",{attrs:{id:"run-the-commands-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#run-the-commands-2"}},[t._v("#")]),t._v(" Run the Commands")]),t._v(" "),a("p",[t._v("Run the following command to autoload your package:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" dump-autoload\n")])])]),a("p",[t._v("Your package is now ready to use !")])])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/88.4bab3fd2.js b/assets/js/52.6d72598d.js similarity index 98% rename from assets/js/88.4bab3fd2.js rename to assets/js/52.6d72598d.js index eba0524..519fbff 100644 --- a/assets/js/88.4bab3fd2.js +++ b/assets/js/52.6d72598d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{386:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"layouts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#layouts"}},[t._v("#")]),t._v(" Layouts")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#category-layout"}},[t._v("Category Layout")])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Layouts in Krayin are fundamental to structuring your application's views in a consistent and reusable way. They provide a template for rendering HTML across multiple pages, ensuring a unified design and user experience. By defining layouts, you can streamline development, improve maintainability, and enhance the overall aesthetics of your web application.")]),t._v(" "),a("p",[t._v("To learn in detail about Layouts, you can visit the Laravel documentation "),a("a",{attrs:{href:"https://laravel.com/docs/11.x/blade",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"category-layout"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#category-layout"}},[t._v("#")]),t._v(" Category Layout")]),t._v(" "),a("p",[a("code",[t._v("@extends('category::layouts.master')")]),t._v(" This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit".')]),t._v(" "),a("p",[t._v("To extend the default layout of the Krayin admin panel, you'll create or modify the "),a("code",[t._v("index.blade.php")]),t._v(" file located at "),a("code",[t._v("packages/Webkul/Category/src/Resources/views/admin/index.blade.php")]),t._v(". Below is a detailed breakdown of how to integrate and customize the layout:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[t._v("@extends('category::layouts.master')\n\n@push('css')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token style"}},[a("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* */")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n\n@section('page_title')\n {{ __('category::categories.index.title') }}\n@endsection\n\n@section('content-wrapper')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("content full-page"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- --\x3e")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endsection\n\n@push('scripts')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token script"}},[a("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Prop Name")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("strong",[a("code",[t._v("@extends('category::layouts.master')")])])]),t._v(" "),a("td",[t._v("This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit"')])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('page_title')")])])]),t._v(" "),a("td",[t._v("This is used to define the title of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('content-wrapper')")])])]),t._v(" "),a("td",[t._v("This is used to define the body of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('css')")])])]),t._v(" "),a("td",[t._v("This is used to add additional css.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('scripts')")])])]),t._v(" "),a("td",[t._v("This is used to add additional javascript.")])])])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in "),a("strong",[a("code",[t._v("lang/app.php")])]),t._v(".")])]),t._v(" "),a("p",[t._v("If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside "),a("code",[t._v("Resources\\Views\\Layouts\\master.blade.php")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{350:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"layouts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#layouts"}},[t._v("#")]),t._v(" Layouts")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#category-layout"}},[t._v("Category Layout")])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Layouts in Krayin are fundamental to structuring your application's views in a consistent and reusable way. They provide a template for rendering HTML across multiple pages, ensuring a unified design and user experience. By defining layouts, you can streamline development, improve maintainability, and enhance the overall aesthetics of your web application.")]),t._v(" "),a("p",[t._v("To learn in detail about Layouts, you can visit the Laravel documentation "),a("a",{attrs:{href:"https://laravel.com/docs/11.x/blade",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"category-layout"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#category-layout"}},[t._v("#")]),t._v(" Category Layout")]),t._v(" "),a("p",[a("code",[t._v("@extends('category::layouts.master')")]),t._v(" This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit".')]),t._v(" "),a("p",[t._v("To extend the default layout of the Krayin admin panel, you'll create or modify the "),a("code",[t._v("index.blade.php")]),t._v(" file located at "),a("code",[t._v("packages/Webkul/Category/src/Resources/views/admin/index.blade.php")]),t._v(". Below is a detailed breakdown of how to integrate and customize the layout:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[t._v("@extends('category::layouts.master')\n\n@push('css')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token style"}},[a("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* */")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n\n@section('page_title')\n {{ __('category::categories.index.title') }}\n@endsection\n\n@section('content-wrapper')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("content full-page"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- --\x3e")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endsection\n\n@push('scripts')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token script"}},[a("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Prop Name")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("strong",[a("code",[t._v("@extends('category::layouts.master')")])])]),t._v(" "),a("td",[t._v("This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit"')])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('page_title')")])])]),t._v(" "),a("td",[t._v("This is used to define the title of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('content-wrapper')")])])]),t._v(" "),a("td",[t._v("This is used to define the body of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('css')")])])]),t._v(" "),a("td",[t._v("This is used to add additional css.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('scripts')")])])]),t._v(" "),a("td",[t._v("This is used to add additional javascript.")])])])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in "),a("strong",[a("code",[t._v("lang/app.php")])]),t._v(".")])]),t._v(" "),a("p",[t._v("If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside "),a("code",[t._v("Resources\\Views\\Layouts\\master.blade.php")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/53.ee0b5001.js b/assets/js/53.7d71b23e.js similarity index 99% rename from assets/js/53.ee0b5001.js rename to assets/js/53.7d71b23e.js index 2240ee5..a218fc9 100644 --- a/assets/js/53.ee0b5001.js +++ b/assets/js/53.7d71b23e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{350:function(a,e,t){"use strict";t.r(e);var s=t(10),n=Object(s.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"localization"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#localization"}},[a._v("#")]),a._v(" Localization")]),a._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#publishing-the-language-files"}},[a._v("Publishing the Language Files")])]),e("li",[e("a",{attrs:{href:"#configuring-the-locale"}},[a._v("Configuring the Locale")])]),e("li",[e("a",{attrs:{href:"#create-a-new-locale"}},[a._v("Create a new Locale")]),e("ul",[e("li",[e("a",{attrs:{href:"#directory-structure"}},[a._v("Directory Structure")])]),e("li",[e("a",{attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("Writing a Translation in app.php")])])])]),e("li",[e("a",{attrs:{href:"#load-translation-from-package"}},[a._v("Load Translation from Package")]),e("ul",[e("li",[e("a",{attrs:{href:"#update-the-service-provider"}},[a._v("Update the Service Provider")])]),e("li",[e("a",{attrs:{href:"#use-translations-in-blade-files"}},[a._v("Use Translations in Blade Files")])])])])])]),e("p"),a._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),e("p",[a._v("Laravel's localization features provide a convenient way to retrieve strings in various languages, allowing you to easily support multiple languages within your application.")]),a._v(" "),e("p",[a._v("Language strings may be stored in files within the application's lang directory. Within this directory, there may be subdirectories for each language supported by the application. This is the approach Laravel uses to manage translation strings for built-in Laravel features such as validation error messages:")]),a._v(" "),e("p",[a._v("To learn in detail about Localization, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/localization",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),e("OutboundLink")],1),a._v(".")]),a._v(" "),e("h2",{attrs:{id:"publishing-the-language-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#publishing-the-language-files"}},[a._v("#")]),a._v(" Publishing the Language Files")]),a._v(" "),e("p",[a._v("By default, the Laravel application skeleton does not include the lang directory. If you would like to customize Laravel's language files or create your own, you should scaffold the lang directory via the lang:publish Artisan command. The lang:publish command will create the lang directory in your application and publish the default set of language files used by Laravel:")]),a._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[a._v("php artisan lang:publish\n")])])]),e("h2",{attrs:{id:"configuring-the-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configuring-the-locale"}},[a._v("#")]),a._v(" Configuring the Locale")]),a._v(" "),e("p",[a._v("The default language for your application is stored in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file's "),e("code",[a._v("locale")]),a._v(" configuration option, which is typically set using the "),e("code",[a._v("APP_LOCALE")]),a._v(" environment variable. You are free to modify this value to suit the needs of your application.")]),a._v(" "),e("p",[a._v("You may also configure a "),e("code",[a._v('"fallback language"')]),a._v(", which will be used when the default language does not contain a given translation string. Like the default language, the fallback language is also configured in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file, and its value is typically set using the APP_FALLBACK_LOCALE environment variable.")]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[a._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Locale Configuration\n |--------------------------------------------------------------------------\n |\n | The application locale determines the default locale that will be used\n | by the translation service provider. You are free to set this value\n | to any of the locales which will be supported by the application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("env")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'APP_LOCALE'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Fallback Locale\n |--------------------------------------------------------------------------\n |\n | The fallback locale determines the locale to use when the current one\n | is not available. You may change the value to correspond to any of\n | the language directories that are provided through your application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'fallback_locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n")])])]),e("h2",{attrs:{id:"create-a-new-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-locale"}},[a._v("#")]),a._v(" Create a new Locale")]),a._v(" "),e("p",[a._v("To support localization in your package, you need to create language files. Follow the steps below to set up a language file for English translations.")]),a._v(" "),e("h4",{attrs:{id:"create-the-lang-folder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-lang-folder"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("lang")]),a._v(" Folder")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to the "),e("code",[a._v("packages/Webkul/Category/src/Resources")]),a._v(" directory.")]),a._v(" "),e("li",[a._v("Create a directory named "),e("code",[a._v("lang")]),a._v(".")])]),a._v(" "),e("h4",{attrs:{id:"create-language-code-folders"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-language-code-folders"}},[a._v("#")]),a._v(" Create Language Code Folders")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("lang")]),a._v(" directory, create different directories for each language you want to support. For example, you can create directories for English ("),e("code",[a._v("en")]),a._v("), Hindi ("),e("code",[a._v("hi")]),a._v("), etc.")]),a._v(" "),e("li",[a._v("For now, let's create a directory named "),e("code",[a._v("en")]),a._v(" to represent English.")])]),a._v(" "),e("h4",{attrs:{id:"create-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-app-php-file"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("en")]),a._v(" directory, create a file named "),e("code",[a._v("app.php")]),a._v(" for language translations.")])]),a._v(" "),e("h3",{attrs:{id:"directory-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[a._v("#")]),a._v(" Directory Structure")]),a._v(" "),e("p",[a._v("The updated directory structure will look like this:")]),a._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[a._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── lang\n └── en\n └── app.php\n")])])]),e("h3",{attrs:{id:"writing-a-translation-in-app-php"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("#")]),a._v(" Writing a Translation in "),e("code",[a._v("app.php")])]),a._v(" "),e("p",[a._v("To add translations for your package, you can edit the "),e("code",[a._v("app.php")]),a._v(" file located in the language directory ("),e("code",[a._v("en")]),a._v(" in this case). Below is an example of how you can define translations:")]),a._v(" "),e("h4",{attrs:{id:"open-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#open-the-app-php-file"}},[a._v("#")]),a._v(" Open the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to "),e("code",[a._v("packages/Webkul/Category/src/Resources/lang/en")]),a._v(".")]),a._v(" "),e("li",[a._v("Open the "),e("code",[a._v("app.php")]),a._v(" file.")])]),a._v(" "),e("h4",{attrs:{id:"add-the-translation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-the-translation"}},[a._v("#")]),a._v(" Add the Translation")]),a._v(" "),e("ul",[e("li",[a._v("Inside "),e("code",[a._v("app.php")]),a._v(", define your translations as an associative array. For example:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'index'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'Categories'")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),e("h2",{attrs:{id:"load-translation-from-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#load-translation-from-package"}},[a._v("#")]),a._v(" Load Translation from Package")]),a._v(" "),e("p",[a._v("To make translations from your package accessible, you need to register the language file in the service provider and then use them in your Blade templates.")]),a._v(" "),e("h3",{attrs:{id:"update-the-service-provider"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update-the-service-provider"}},[a._v("#")]),a._v(" Update the Service Provider")]),a._v(" "),e("ul",[e("li",[a._v("Open the "),e("code",[a._v("CategoryServiceProvider.php")]),a._v(" file located in "),e("code",[a._v("packages/Webkul/Category/src/Providers")]),a._v(".")]),a._v(" "),e("li",[a._v("Add the following code to the "),e("code",[a._v("boot")]),a._v(" method:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadTranslationsFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Resources/lang'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),e("h4",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("This code uses "),e("code",[a._v("$this->loadTranslationsFrom")]),a._v(" to register translations from the lang directory of your package ("),e("code",[a._v("packages/ Webkul/Category/src/Resources/lang")]),a._v(") under the namespace "),e("code",[a._v("'category'")]),a._v(".")])]),a._v(" "),e("li",[e("p",[a._v("The "),e("code",[a._v("loadTranslationsFrom")]),a._v(" method registers translations for the "),e("code",[a._v("'category'")]),a._v(" namespace from the specified path ("),e("code",[a._v("__DIR__ . '/../Resources/lang'")]),a._v(").")])]),a._v(" "),e("li",[e("p",[a._v("This makes translations accessible throughout your Laravel application using the "),e("code",[a._v("'category'")]),a._v(" namespace prefix.")])])]),a._v(" "),e("h3",{attrs:{id:"use-translations-in-blade-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-translations-in-blade-files"}},[a._v("#")]),a._v(" Use Translations in Blade Files")]),a._v(" "),e("p",[a._v("In your Blade templates ("),e("code",[a._v(".blade.php")]),a._v(" files), you can use the "),e("code",[a._v("@lang")]),a._v(" helper function to retrieve translations. Use the namespace 'category' followed by the translation key. For example:")]),a._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[a._v("@lang('category::categories.index.title')\n")])])]),e("h4",{attrs:{id:"explanation-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("The "),e("code",[a._v("@lang('category::categories.index.title')")]),a._v(" syntax fetches the translation for for "),e("code",[a._v("categories")]),a._v(" > "),e("code",[a._v("index")]),a._v(" > "),e("code",[a._v("title")])])]),a._v(" "),e("li",[e("p",[a._v("Replace "),e("code",[a._v("'categories.index.title'")]),a._v(" with your actual translation keys to use different translations as needed in your application.")])])]),a._v(" "),e("p",[a._v("By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{349:function(a,e,t){"use strict";t.r(e);var s=t(10),n=Object(s.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"localization"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#localization"}},[a._v("#")]),a._v(" Localization")]),a._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#publishing-the-language-files"}},[a._v("Publishing the Language Files")])]),e("li",[e("a",{attrs:{href:"#configuring-the-locale"}},[a._v("Configuring the Locale")])]),e("li",[e("a",{attrs:{href:"#create-a-new-locale"}},[a._v("Create a new Locale")]),e("ul",[e("li",[e("a",{attrs:{href:"#directory-structure"}},[a._v("Directory Structure")])]),e("li",[e("a",{attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("Writing a Translation in app.php")])])])]),e("li",[e("a",{attrs:{href:"#load-translation-from-package"}},[a._v("Load Translation from Package")]),e("ul",[e("li",[e("a",{attrs:{href:"#update-the-service-provider"}},[a._v("Update the Service Provider")])]),e("li",[e("a",{attrs:{href:"#use-translations-in-blade-files"}},[a._v("Use Translations in Blade Files")])])])])])]),e("p"),a._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),e("p",[a._v("Laravel's localization features provide a convenient way to retrieve strings in various languages, allowing you to easily support multiple languages within your application.")]),a._v(" "),e("p",[a._v("Language strings may be stored in files within the application's lang directory. Within this directory, there may be subdirectories for each language supported by the application. This is the approach Laravel uses to manage translation strings for built-in Laravel features such as validation error messages:")]),a._v(" "),e("p",[a._v("To learn in detail about Localization, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/localization",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),e("OutboundLink")],1),a._v(".")]),a._v(" "),e("h2",{attrs:{id:"publishing-the-language-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#publishing-the-language-files"}},[a._v("#")]),a._v(" Publishing the Language Files")]),a._v(" "),e("p",[a._v("By default, the Laravel application skeleton does not include the lang directory. If you would like to customize Laravel's language files or create your own, you should scaffold the lang directory via the lang:publish Artisan command. The lang:publish command will create the lang directory in your application and publish the default set of language files used by Laravel:")]),a._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[a._v("php artisan lang:publish\n")])])]),e("h2",{attrs:{id:"configuring-the-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configuring-the-locale"}},[a._v("#")]),a._v(" Configuring the Locale")]),a._v(" "),e("p",[a._v("The default language for your application is stored in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file's "),e("code",[a._v("locale")]),a._v(" configuration option, which is typically set using the "),e("code",[a._v("APP_LOCALE")]),a._v(" environment variable. You are free to modify this value to suit the needs of your application.")]),a._v(" "),e("p",[a._v("You may also configure a "),e("code",[a._v('"fallback language"')]),a._v(", which will be used when the default language does not contain a given translation string. Like the default language, the fallback language is also configured in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file, and its value is typically set using the APP_FALLBACK_LOCALE environment variable.")]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[a._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Locale Configuration\n |--------------------------------------------------------------------------\n |\n | The application locale determines the default locale that will be used\n | by the translation service provider. You are free to set this value\n | to any of the locales which will be supported by the application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("env")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'APP_LOCALE'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Fallback Locale\n |--------------------------------------------------------------------------\n |\n | The fallback locale determines the locale to use when the current one\n | is not available. You may change the value to correspond to any of\n | the language directories that are provided through your application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'fallback_locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n")])])]),e("h2",{attrs:{id:"create-a-new-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-locale"}},[a._v("#")]),a._v(" Create a new Locale")]),a._v(" "),e("p",[a._v("To support localization in your package, you need to create language files. Follow the steps below to set up a language file for English translations.")]),a._v(" "),e("h4",{attrs:{id:"create-the-lang-folder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-lang-folder"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("lang")]),a._v(" Folder")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to the "),e("code",[a._v("packages/Webkul/Category/src/Resources")]),a._v(" directory.")]),a._v(" "),e("li",[a._v("Create a directory named "),e("code",[a._v("lang")]),a._v(".")])]),a._v(" "),e("h4",{attrs:{id:"create-language-code-folders"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-language-code-folders"}},[a._v("#")]),a._v(" Create Language Code Folders")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("lang")]),a._v(" directory, create different directories for each language you want to support. For example, you can create directories for English ("),e("code",[a._v("en")]),a._v("), Hindi ("),e("code",[a._v("hi")]),a._v("), etc.")]),a._v(" "),e("li",[a._v("For now, let's create a directory named "),e("code",[a._v("en")]),a._v(" to represent English.")])]),a._v(" "),e("h4",{attrs:{id:"create-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-app-php-file"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("en")]),a._v(" directory, create a file named "),e("code",[a._v("app.php")]),a._v(" for language translations.")])]),a._v(" "),e("h3",{attrs:{id:"directory-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[a._v("#")]),a._v(" Directory Structure")]),a._v(" "),e("p",[a._v("The updated directory structure will look like this:")]),a._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[a._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── lang\n └── en\n └── app.php\n")])])]),e("h3",{attrs:{id:"writing-a-translation-in-app-php"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("#")]),a._v(" Writing a Translation in "),e("code",[a._v("app.php")])]),a._v(" "),e("p",[a._v("To add translations for your package, you can edit the "),e("code",[a._v("app.php")]),a._v(" file located in the language directory ("),e("code",[a._v("en")]),a._v(" in this case). Below is an example of how you can define translations:")]),a._v(" "),e("h4",{attrs:{id:"open-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#open-the-app-php-file"}},[a._v("#")]),a._v(" Open the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to "),e("code",[a._v("packages/Webkul/Category/src/Resources/lang/en")]),a._v(".")]),a._v(" "),e("li",[a._v("Open the "),e("code",[a._v("app.php")]),a._v(" file.")])]),a._v(" "),e("h4",{attrs:{id:"add-the-translation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-the-translation"}},[a._v("#")]),a._v(" Add the Translation")]),a._v(" "),e("ul",[e("li",[a._v("Inside "),e("code",[a._v("app.php")]),a._v(", define your translations as an associative array. For example:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'index'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'Categories'")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),e("h2",{attrs:{id:"load-translation-from-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#load-translation-from-package"}},[a._v("#")]),a._v(" Load Translation from Package")]),a._v(" "),e("p",[a._v("To make translations from your package accessible, you need to register the language file in the service provider and then use them in your Blade templates.")]),a._v(" "),e("h3",{attrs:{id:"update-the-service-provider"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update-the-service-provider"}},[a._v("#")]),a._v(" Update the Service Provider")]),a._v(" "),e("ul",[e("li",[a._v("Open the "),e("code",[a._v("CategoryServiceProvider.php")]),a._v(" file located in "),e("code",[a._v("packages/Webkul/Category/src/Providers")]),a._v(".")]),a._v(" "),e("li",[a._v("Add the following code to the "),e("code",[a._v("boot")]),a._v(" method:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadTranslationsFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Resources/lang'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),e("h4",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("This code uses "),e("code",[a._v("$this->loadTranslationsFrom")]),a._v(" to register translations from the lang directory of your package ("),e("code",[a._v("packages/ Webkul/Category/src/Resources/lang")]),a._v(") under the namespace "),e("code",[a._v("'category'")]),a._v(".")])]),a._v(" "),e("li",[e("p",[a._v("The "),e("code",[a._v("loadTranslationsFrom")]),a._v(" method registers translations for the "),e("code",[a._v("'category'")]),a._v(" namespace from the specified path ("),e("code",[a._v("__DIR__ . '/../Resources/lang'")]),a._v(").")])]),a._v(" "),e("li",[e("p",[a._v("This makes translations accessible throughout your Laravel application using the "),e("code",[a._v("'category'")]),a._v(" namespace prefix.")])])]),a._v(" "),e("h3",{attrs:{id:"use-translations-in-blade-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-translations-in-blade-files"}},[a._v("#")]),a._v(" Use Translations in Blade Files")]),a._v(" "),e("p",[a._v("In your Blade templates ("),e("code",[a._v(".blade.php")]),a._v(" files), you can use the "),e("code",[a._v("@lang")]),a._v(" helper function to retrieve translations. Use the namespace 'category' followed by the translation key. For example:")]),a._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[a._v("@lang('category::categories.index.title')\n")])])]),e("h4",{attrs:{id:"explanation-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("The "),e("code",[a._v("@lang('category::categories.index.title')")]),a._v(" syntax fetches the translation for for "),e("code",[a._v("categories")]),a._v(" > "),e("code",[a._v("index")]),a._v(" > "),e("code",[a._v("title")])])]),a._v(" "),e("li",[e("p",[a._v("Replace "),e("code",[a._v("'categories.index.title'")]),a._v(" with your actual translation keys to use different translations as needed in your application.")])])]),a._v(" "),e("p",[a._v("By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/55.aece2883.js b/assets/js/55.8f737083.js similarity index 99% rename from assets/js/55.aece2883.js rename to assets/js/55.8f737083.js index 12745cc..fecfa1e 100644 --- a/assets/js/55.aece2883.js +++ b/assets/js/55.8f737083.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{352:function(t,e,a){"use strict";a.r(e);var s=a(10),r=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"repositories"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#repositories"}},[t._v("#")]),t._v(" Repositories")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#dependency-injection"}},[t._v("Dependency Injection")])]),e("li",[e("a",{attrs:{href:"#using-krayin-package-generator"}},[t._v("Using Krayin Package Generator")]),e("ul",[e("li",[e("a",{attrs:{href:"#create-a-new-repository-class"}},[t._v("Create a New Repository Class")])]),e("li",[e("a",{attrs:{href:"#explanation"}},[t._v("Explanation")])])])]),e("li",[e("a",{attrs:{href:"#manually-setting-up-repository-files"}},[t._v("Manually Setting Up Repository Files")]),e("ul",[e("li",[e("a",{attrs:{href:"#setting-up-categoryrepository-in-webkul-category-package"}},[t._v("Setting Up CategoryRepository in Webkul/Category Package")])])])]),e("li",[e("a",{attrs:{href:"#available-methods"}},[t._v("Available Methods")]),e("ul",[e("li",[e("a",{attrs:{href:"#all"}},[t._v("all")])]),e("li",[e("a",{attrs:{href:"#find"}},[t._v("Find")])]),e("li",[e("a",{attrs:{href:"#findorfail"}},[t._v("FindOrFail")])]),e("li",[e("a",{attrs:{href:"#create"}},[t._v("Create")])]),e("li",[e("a",{attrs:{href:"#update"}},[t._v("Update")])]),e("li",[e("a",{attrs:{href:"#delete"}},[t._v("Delete")])]),e("li",[e("a",{attrs:{href:"#paginate"}},[t._v("Paginate")])]),e("li",[e("a",{attrs:{href:"#findwhere"}},[t._v("FindWhere")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("In traditional development, application logic is often embedded in controllers. An alternative approach uses Repositories to abstract database operations and queries, promoting cleaner, more maintainable code.")]),t._v(" "),e("p",[t._v("Repositories decouple models from controllers and provide readable names for complex queries. Each Repository class binds to an Eloquent model in its constructor, enabling the use of methods like "),e("code",[t._v("findOrFail")]),t._v(", "),e("code",[t._v("update")]),t._v(", and "),e("code",[t._v("all")]),t._v(". This separation enhances code readability, reusability, and adherence to the separation of concerns principle, making the application easier to manage and scale.")]),t._v(" "),e("h2",{attrs:{id:"dependency-injection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dependency-injection"}},[t._v("#")]),t._v(" Dependency Injection")]),t._v(" "),e("p",[t._v("Dependency Injection (DI) is a design pattern widely used in Laravel for managing class dependencies. It allows classes to receive their dependencies from an external source rather than creating them internally. This promotes loose coupling between classes, enhances reusability, and simplifies unit testing.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("__construct")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[t._v("CategoryRepository")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categoryRepository")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("__construct()")]),t._v(" method is defined with a parameter "),e("code",[t._v("$categoryRepository")]),t._v(" typed as "),e("code",[t._v("CategoryRepository")]),t._v(".\nLaravel's service container automatically resolves and injects an instance of "),e("code",[t._v("CategoryRepository")]),t._v(" when an instance of the class containing this constructor is instantiated.")]),t._v(" "),e("p",[t._v("This is a form of dependency injection where the "),e("code",[t._v("CategoryRepository")]),t._v(" dependency is injected into the class through its constructor.")]),t._v(" "),e("h2",{attrs:{id:"using-krayin-package-generator"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[t._v("#")]),t._v(" Using Krayin Package Generator")]),t._v(" "),e("p",[t._v("The Krayin package generator provides a convenient way to create new components for your Krayin application. One of these components is the Repository class, which is essential for abstracting database interactions and promoting clean code architecture.")]),t._v(" "),e("h3",{attrs:{id:"create-a-new-repository-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-repository-class"}},[t._v("#")]),t._v(" Create a New Repository Class")]),t._v(" "),e("p",[t._v("To create a new Repository class, use the following command. This command creates a new Repository class in the "),e("code",[t._v("packages/Webkul/Category/src/Repository")]),t._v(" directory.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("php artisan package:make "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-repository")]),t._v(" CategoryRepository Webkul/Category\n")])])]),e("h3",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),e("ul",[e("li",[e("strong",[t._v("Command:")]),t._v(" The command "),e("code",[t._v("php artisan package:make -repository")]),t._v(" is used to generate a new Repository class.")]),t._v(" "),e("li",[e("strong",[t._v("Repository Name:")]),t._v(" "),e("code",[t._v("CategoryRepository")]),t._v(" is the name of the new Repository class that will be created.")]),t._v(" "),e("li",[e("strong",[t._v("Package Path:")]),t._v(" "),e("code",[t._v("Webkul/Category")]),t._v(" specifies the package within the packages directory where the new Repository class will be created.")])]),t._v(" "),e("h2",{attrs:{id:"manually-setting-up-repository-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#manually-setting-up-repository-files"}},[t._v("#")]),t._v(" Manually Setting Up Repository Files")]),t._v(" "),e("p",[t._v("Manually setting up repository files involves creating and organizing repository classes in your application without relying on automated generators. This approach allows for custom structuring and naming conventions tailored to your project's needs. By manually managing repository files, developers can ensure precise control over code organization and maintain consistency across the application architecture.")]),t._v(" "),e("h3",{attrs:{id:"setting-up-categoryrepository-in-webkul-category-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-categoryrepository-in-webkul-category-package"}},[t._v("#")]),t._v(" Setting Up CategoryRepository in Webkul/Category Package")]),t._v(" "),e("p",[t._v("Start by creating a "),e("code",[t._v("Repository")]),t._v(" directory within the "),e("code",[t._v("Webkul/Category/src/")]),t._v(" directory. This directory will house the repository class responsible for handling category-related database operations.Create a file named "),e("code",[t._v("CategoryRepository.php")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Repository\n └── CategoryRepository.php\n")])])]),e("p",[t._v("This file will contain the "),e("code",[t._v("CategoryRepository")]),t._v(" class, which will encapsulate methods for interacting with category data.\nCopy the following code into your newly created repository file.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"find"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#find"}},[t._v("#")]),t._v(" Find")]),t._v(" "),e("p",[t._v("The find method is called on the categoryRepository instance. This method attempts to retrieve a Category model by its primary key.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"findorfail"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#findorfail"}},[t._v("#")]),t._v(" FindOrFail")]),t._v(" "),e("p",[t._v("The findOrFail method is called on the categoryRepository instance. This method attempts to retrieve a Category model by its primary key and throws ModelNotFound Exception.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findOrFail")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"create"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create"}},[t._v("#")]),t._v(" Create")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("create")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for creating and saving a new instance of the "),e("code",[t._v("Category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"update"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update"}},[t._v("#")]),t._v(" Update")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("update")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for updating a existing instance of the "),e("code",[t._v("Category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"delete"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#delete"}},[t._v("#")]),t._v(" Delete")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("delete")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for delete a existing instance of the "),e("code",[t._v("category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("delete")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"paginate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#paginate"}},[t._v("#")]),t._v(" Paginate")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("paginate")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for retrieving a paginated set of records for the "),e("code",[t._v("Category")]),t._v(" model from the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Number of categories to be displayed per page.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$perPage")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Paginate the categories.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categories")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("paginate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$perPage")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"findwhere"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#findwhere"}},[t._v("#")]),t._v(" FindWhere")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("findWhere")]),t._v(" method is called on the categoryRepository instance. This method adds a query constraint to filter the results based on a specified condition.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categories")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findWhere")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'status'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'active'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("model()")]),t._v(" method within CategoryRepository.php returns the path of your contract class ("),e("code",[t._v("CategoryContract")]),t._v(" in this example). This method initializes the model instance used throughout the repository for database interactions.")]),t._v(" "),e("p",[t._v("Your "),e("code",[t._v("CategoryRepository")]),t._v(" is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.")]),t._v(" "),e("p",[t._v("By utilizing the "),e("code",[t._v("CategoryRepository")]),t._v(", you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{354:function(t,e,a){"use strict";a.r(e);var s=a(10),r=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"repositories"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#repositories"}},[t._v("#")]),t._v(" Repositories")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#dependency-injection"}},[t._v("Dependency Injection")])]),e("li",[e("a",{attrs:{href:"#using-krayin-package-generator"}},[t._v("Using Krayin Package Generator")]),e("ul",[e("li",[e("a",{attrs:{href:"#create-a-new-repository-class"}},[t._v("Create a New Repository Class")])]),e("li",[e("a",{attrs:{href:"#explanation"}},[t._v("Explanation")])])])]),e("li",[e("a",{attrs:{href:"#manually-setting-up-repository-files"}},[t._v("Manually Setting Up Repository Files")]),e("ul",[e("li",[e("a",{attrs:{href:"#setting-up-categoryrepository-in-webkul-category-package"}},[t._v("Setting Up CategoryRepository in Webkul/Category Package")])])])]),e("li",[e("a",{attrs:{href:"#available-methods"}},[t._v("Available Methods")]),e("ul",[e("li",[e("a",{attrs:{href:"#all"}},[t._v("all")])]),e("li",[e("a",{attrs:{href:"#find"}},[t._v("Find")])]),e("li",[e("a",{attrs:{href:"#findorfail"}},[t._v("FindOrFail")])]),e("li",[e("a",{attrs:{href:"#create"}},[t._v("Create")])]),e("li",[e("a",{attrs:{href:"#update"}},[t._v("Update")])]),e("li",[e("a",{attrs:{href:"#delete"}},[t._v("Delete")])]),e("li",[e("a",{attrs:{href:"#paginate"}},[t._v("Paginate")])]),e("li",[e("a",{attrs:{href:"#findwhere"}},[t._v("FindWhere")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("In traditional development, application logic is often embedded in controllers. An alternative approach uses Repositories to abstract database operations and queries, promoting cleaner, more maintainable code.")]),t._v(" "),e("p",[t._v("Repositories decouple models from controllers and provide readable names for complex queries. Each Repository class binds to an Eloquent model in its constructor, enabling the use of methods like "),e("code",[t._v("findOrFail")]),t._v(", "),e("code",[t._v("update")]),t._v(", and "),e("code",[t._v("all")]),t._v(". This separation enhances code readability, reusability, and adherence to the separation of concerns principle, making the application easier to manage and scale.")]),t._v(" "),e("h2",{attrs:{id:"dependency-injection"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dependency-injection"}},[t._v("#")]),t._v(" Dependency Injection")]),t._v(" "),e("p",[t._v("Dependency Injection (DI) is a design pattern widely used in Laravel for managing class dependencies. It allows classes to receive their dependencies from an external source rather than creating them internally. This promotes loose coupling between classes, enhances reusability, and simplifies unit testing.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("__construct")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[t._v("CategoryRepository")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categoryRepository")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("__construct()")]),t._v(" method is defined with a parameter "),e("code",[t._v("$categoryRepository")]),t._v(" typed as "),e("code",[t._v("CategoryRepository")]),t._v(".\nLaravel's service container automatically resolves and injects an instance of "),e("code",[t._v("CategoryRepository")]),t._v(" when an instance of the class containing this constructor is instantiated.")]),t._v(" "),e("p",[t._v("This is a form of dependency injection where the "),e("code",[t._v("CategoryRepository")]),t._v(" dependency is injected into the class through its constructor.")]),t._v(" "),e("h2",{attrs:{id:"using-krayin-package-generator"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[t._v("#")]),t._v(" Using Krayin Package Generator")]),t._v(" "),e("p",[t._v("The Krayin package generator provides a convenient way to create new components for your Krayin application. One of these components is the Repository class, which is essential for abstracting database interactions and promoting clean code architecture.")]),t._v(" "),e("h3",{attrs:{id:"create-a-new-repository-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-repository-class"}},[t._v("#")]),t._v(" Create a New Repository Class")]),t._v(" "),e("p",[t._v("To create a new Repository class, use the following command. This command creates a new Repository class in the "),e("code",[t._v("packages/Webkul/Category/src/Repository")]),t._v(" directory.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("php artisan package:make "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-repository")]),t._v(" CategoryRepository Webkul/Category\n")])])]),e("h3",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),e("ul",[e("li",[e("strong",[t._v("Command:")]),t._v(" The command "),e("code",[t._v("php artisan package:make -repository")]),t._v(" is used to generate a new Repository class.")]),t._v(" "),e("li",[e("strong",[t._v("Repository Name:")]),t._v(" "),e("code",[t._v("CategoryRepository")]),t._v(" is the name of the new Repository class that will be created.")]),t._v(" "),e("li",[e("strong",[t._v("Package Path:")]),t._v(" "),e("code",[t._v("Webkul/Category")]),t._v(" specifies the package within the packages directory where the new Repository class will be created.")])]),t._v(" "),e("h2",{attrs:{id:"manually-setting-up-repository-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#manually-setting-up-repository-files"}},[t._v("#")]),t._v(" Manually Setting Up Repository Files")]),t._v(" "),e("p",[t._v("Manually setting up repository files involves creating and organizing repository classes in your application without relying on automated generators. This approach allows for custom structuring and naming conventions tailored to your project's needs. By manually managing repository files, developers can ensure precise control over code organization and maintain consistency across the application architecture.")]),t._v(" "),e("h3",{attrs:{id:"setting-up-categoryrepository-in-webkul-category-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-categoryrepository-in-webkul-category-package"}},[t._v("#")]),t._v(" Setting Up CategoryRepository in Webkul/Category Package")]),t._v(" "),e("p",[t._v("Start by creating a "),e("code",[t._v("Repository")]),t._v(" directory within the "),e("code",[t._v("Webkul/Category/src/")]),t._v(" directory. This directory will house the repository class responsible for handling category-related database operations.Create a file named "),e("code",[t._v("CategoryRepository.php")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Repository\n └── CategoryRepository.php\n")])])]),e("p",[t._v("This file will contain the "),e("code",[t._v("CategoryRepository")]),t._v(" class, which will encapsulate methods for interacting with category data.\nCopy the following code into your newly created repository file.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"find"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#find"}},[t._v("#")]),t._v(" Find")]),t._v(" "),e("p",[t._v("The find method is called on the categoryRepository instance. This method attempts to retrieve a Category model by its primary key.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"findorfail"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#findorfail"}},[t._v("#")]),t._v(" FindOrFail")]),t._v(" "),e("p",[t._v("The findOrFail method is called on the categoryRepository instance. This method attempts to retrieve a Category model by its primary key and throws ModelNotFound Exception.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findOrFail")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"create"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create"}},[t._v("#")]),t._v(" Create")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("create")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for creating and saving a new instance of the "),e("code",[t._v("Category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"update"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update"}},[t._v("#")]),t._v(" Update")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("update")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for updating a existing instance of the "),e("code",[t._v("Category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"delete"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#delete"}},[t._v("#")]),t._v(" Delete")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("delete")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for delete a existing instance of the "),e("code",[t._v("category")]),t._v(" model to the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$category")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("delete")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"paginate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#paginate"}},[t._v("#")]),t._v(" Paginate")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("paginate")]),t._v(" method is called on the "),e("code",[t._v("categoryRepository")]),t._v(" instance. This method is responsible for retrieving a paginated set of records for the "),e("code",[t._v("Category")]),t._v(" model from the database.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Number of categories to be displayed per page.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$perPage")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Paginate the categories.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categories")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("paginate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$perPage")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"findwhere"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#findwhere"}},[t._v("#")]),t._v(" FindWhere")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("findWhere")]),t._v(" method is called on the categoryRepository instance. This method adds a query constraint to filter the results based on a specified condition.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$categories")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findWhere")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'status'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'active'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("model()")]),t._v(" method within CategoryRepository.php returns the path of your contract class ("),e("code",[t._v("CategoryContract")]),t._v(" in this example). This method initializes the model instance used throughout the repository for database interactions.")]),t._v(" "),e("p",[t._v("Your "),e("code",[t._v("CategoryRepository")]),t._v(" is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.")]),t._v(" "),e("p",[t._v("By utilizing the "),e("code",[t._v("CategoryRepository")]),t._v(", you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/56.af355d1f.js b/assets/js/56.f124d80f.js similarity index 99% rename from assets/js/56.af355d1f.js rename to assets/js/56.f124d80f.js index c1a08d1..aebb660 100644 --- a/assets/js/56.af355d1f.js +++ b/assets/js/56.f124d80f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{353:function(t,a,s){"use strict";s.r(a);var n=s(10),e=Object(n.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"validation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation"}},[t._v("#")]),t._v(" Validation")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#validation-using-laravel"}},[t._v("Validation Using Laravel")]),a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#usage"}},[t._v("Usage")])])])]),a("li",[a("a",{attrs:{href:"#validation-using-vue"}},[t._v("Validation Using Vue")]),a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#installation"}},[t._v("Installation")])]),a("li",[a("a",{attrs:{href:"#configuration"}},[t._v("Configuration")])]),a("li",[a("a",{attrs:{href:"#examples"}},[t._v("Examples")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"validation-using-laravel"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation-using-laravel"}},[t._v("#")]),t._v(" Validation Using Laravel")]),t._v(" "),a("h3",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Laravel provides various approaches to validate incoming data in your application. The most common method is to use the "),a("strong",[a("code",[t._v("validate")])]),t._v(" method available on incoming HTTP requests.")]),t._v(" "),a("p",[t._v("For detailed information about validation in Laravel, refer to the "),a("a",{attrs:{href:"https://laravel.com/docs/10.x/validation",target:"_blank",rel:"noopener noreferrer"}},[t._v("Laravel documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),a("p",[t._v("To use the "),a("strong",[a("code",[t._v("validate")])]),t._v(" method, you can follow this example:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Store the newly created resource.\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("store")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[t._v("Request")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|max:255|min:3Krayin'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'body'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Alternatively, you can manually create a validator instance using the Validator facade, as shown in this example:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'email'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|email'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'message'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|max:250'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$customMessages")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'The :attribute field is required.'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$rules")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$customMessages")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),a("h2",{attrs:{id:"validation-using-vue"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation-using-vue"}},[t._v("#")]),t._v(" Validation Using Vue")]),t._v(" "),a("h3",{attrs:{id:"introduction-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction-2"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("VeeValidate is a validation library for Vue.js that provides plenty of validation rules out of the box, along with support for custom rules. It is template-based and similar to the HTML5 validation API, making it easy to validate HTML5 inputs as well as custom Vue components. VeeValidate also supports localization with 44 languages maintained by the community.")]),t._v(" "),a("p",[t._v("For detailed information about validation in Vue.js using VeeValidate, refer to the "),a("a",{attrs:{href:"https://vee-validate.logaretm.com/v2/guide/",target:"_blank",rel:"noopener noreferrer"}},[t._v("VeeValidate documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"installation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),a("p",[t._v("Krayin already comes with the VeeValidate library, so there is no need to install it separately.")]),t._v(" "),a("h3",{attrs:{id:"configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#configuration"}},[t._v("#")]),t._v(" Configuration")]),t._v(" "),a("p",[t._v("Krayin includes the configuration for "),a("strong",[a("code",[t._v("vee-validate")])]),t._v(". For example, you can find the configuration in the following path: "),a("strong",[a("code",[t._v("krayin/packages/Webkul/Admin/src/Resources/assets/js/app.js")])]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Vue "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" VeeValidate "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Language imports.\n*/")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" de "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/en'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" de "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/de'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fa "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/fa'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Vue plugins.\n*/")]),t._v("\nVue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("use")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("VeeValidate"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("dictionary")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("en")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" en"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("de")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" de"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("fa")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fa"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("events")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'input|change|blur'")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),a("p",[t._v("Here are some examples of Vue validation using VeeValidate:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("alpha'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("username"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("required|email'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("email"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("required|min:6'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{352:function(t,a,s){"use strict";s.r(a);var n=s(10),e=Object(n.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"validation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation"}},[t._v("#")]),t._v(" Validation")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#validation-using-laravel"}},[t._v("Validation Using Laravel")]),a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#usage"}},[t._v("Usage")])])])]),a("li",[a("a",{attrs:{href:"#validation-using-vue"}},[t._v("Validation Using Vue")]),a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#installation"}},[t._v("Installation")])]),a("li",[a("a",{attrs:{href:"#configuration"}},[t._v("Configuration")])]),a("li",[a("a",{attrs:{href:"#examples"}},[t._v("Examples")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"validation-using-laravel"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation-using-laravel"}},[t._v("#")]),t._v(" Validation Using Laravel")]),t._v(" "),a("h3",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Laravel provides various approaches to validate incoming data in your application. The most common method is to use the "),a("strong",[a("code",[t._v("validate")])]),t._v(" method available on incoming HTTP requests.")]),t._v(" "),a("p",[t._v("For detailed information about validation in Laravel, refer to the "),a("a",{attrs:{href:"https://laravel.com/docs/10.x/validation",target:"_blank",rel:"noopener noreferrer"}},[t._v("Laravel documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),a("p",[t._v("To use the "),a("strong",[a("code",[t._v("validate")])]),t._v(" method, you can follow this example:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Store the newly created resource.\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("store")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[t._v("Request")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|max:255|min:3Krayin'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'body'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Alternatively, you can manually create a validator instance using the Validator facade, as shown in this example:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'email'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|email'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'message'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required|max:250'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$customMessages")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'required'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'The :attribute field is required.'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("validate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$request")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$rules")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$customMessages")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),a("h2",{attrs:{id:"validation-using-vue"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#validation-using-vue"}},[t._v("#")]),t._v(" Validation Using Vue")]),t._v(" "),a("h3",{attrs:{id:"introduction-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction-2"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("VeeValidate is a validation library for Vue.js that provides plenty of validation rules out of the box, along with support for custom rules. It is template-based and similar to the HTML5 validation API, making it easy to validate HTML5 inputs as well as custom Vue components. VeeValidate also supports localization with 44 languages maintained by the community.")]),t._v(" "),a("p",[t._v("For detailed information about validation in Vue.js using VeeValidate, refer to the "),a("a",{attrs:{href:"https://vee-validate.logaretm.com/v2/guide/",target:"_blank",rel:"noopener noreferrer"}},[t._v("VeeValidate documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"installation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),a("p",[t._v("Krayin already comes with the VeeValidate library, so there is no need to install it separately.")]),t._v(" "),a("h3",{attrs:{id:"configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#configuration"}},[t._v("#")]),t._v(" Configuration")]),t._v(" "),a("p",[t._v("Krayin includes the configuration for "),a("strong",[a("code",[t._v("vee-validate")])]),t._v(". For example, you can find the configuration in the following path: "),a("strong",[a("code",[t._v("krayin/packages/Webkul/Admin/src/Resources/assets/js/app.js")])]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Vue "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" VeeValidate "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Language imports.\n*/")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" de "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/en'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" de "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/de'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fa "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vee-validate/dist/locale/fa'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Vue plugins.\n*/")]),t._v("\nVue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("use")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("VeeValidate"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("dictionary")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("en")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" en"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("de")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" de"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("fa")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fa"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("events")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'input|change|blur'")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),a("p",[t._v("Here are some examples of Vue validation using VeeValidate:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("alpha'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("username"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("required|email'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("email"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("v-validate")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("required|min:6'"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/57.d6e07b44.js b/assets/js/57.b6a66119.js similarity index 99% rename from assets/js/57.d6e07b44.js rename to assets/js/57.b6a66119.js index d9998bf..77bcfb7 100644 --- a/assets/js/57.d6e07b44.js +++ b/assets/js/57.b6a66119.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{354:function(e,t,a){"use strict";a.r(t);var s=a(10),n=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"views"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#views"}},[e._v("#")]),e._v(" Views")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#directory-structure"}},[e._v("Directory Structure")]),t("ul",[t("li",[t("a",{attrs:{href:"#adding-html-content"}},[e._v("Adding HTML Content")])])])]),t("li",[t("a",{attrs:{href:"#load-views-from-package"}},[e._v("Load Views from Package")])]),t("li",[t("a",{attrs:{href:"#rendering-views"}},[e._v("Rendering Views")])]),t("li",[t("a",{attrs:{href:"#blade-file-naming-convention"}},[e._v("Blade File Naming Convention")]),t("ul",[t("li",[t("a",{attrs:{href:"#listing-index-blade"}},[e._v("Listing (Index Blade):")])]),t("li",[t("a",{attrs:{href:"#creation-create-blade"}},[e._v("Creation (Create Blade):")])]),t("li",[t("a",{attrs:{href:"#updating-edit-blade"}},[e._v("Updating (Edit Blade):")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Views in Laravel are responsible for separating the application's logic from the presentation layer. They provide a clean way to manage and organize the HTML content of your application. Views are typically stored in the "),t("code",[e._v("resources/views")]),e._v(" directory and are rendered using the Blade templating engine, which offers a simple and powerful way to create dynamic content.")]),e._v(" "),t("p",[e._v("By using views, you can create reusable templates and components, making your code more maintainable and easier to understand. Blade templates allow you to use control structures like loops and conditionals, as well as to include other templates, which helps to keep your views organized and modular.")]),e._v(" "),t("p",[e._v("To learn in detail about Views, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/views",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Here's a basic example of a Blade template:")]),e._v(" "),t("h2",{attrs:{id:"directory-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[e._v("#")]),e._v(" Directory Structure")]),e._v(" "),t("p",[e._v("To organize the views for our "),t("code",[e._v("Category")]),e._v(" package, we need to set up a specific directory structure. Follow the steps below to create the necessary directories.")]),e._v(" "),t("h4",{attrs:{id:"create-the-resources-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-resources-directory"}},[e._v("#")]),e._v(" Create the "),t("code",[e._v("Resources")]),e._v(" Directory")]),e._v(" "),t("ul",[t("li",[e._v("Navigate to the "),t("code",[e._v("packages/Webkul/Category/src")]),e._v(" directory.")]),e._v(" "),t("li",[e._v("Create a directory named "),t("code",[e._v("Resources")]),e._v(".")])]),e._v(" "),t("h4",{attrs:{id:"create-the-views-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-views-directory"}},[e._v("#")]),e._v(" Create the "),t("code",[e._v("views")]),e._v(" Directory")]),e._v(" "),t("ul",[t("li",[e._v("Inside the "),t("code",[e._v("Resources")]),e._v(" directory, create another directory named "),t("code",[e._v("views")]),e._v(" and inside the views directory create category directory.")]),e._v(" "),t("li",[e._v("Inside the "),t("code",[e._v("views/category")]),e._v(" directory, create a file named "),t("code",[e._v("index.blade.php")]),e._v(", "),t("code",[e._v("create.blade.php")]),e._v(", "),t("code",[e._v("edit.blade.php")]),e._v(" .")])]),e._v(" "),t("p",[e._v("The updated directory structure will look like this:")]),e._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[e._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("..")]),e._v(".\n └── Resources\n └── views\n └── category\n ├── create.blade.php\n ├── edit.blade.php\n └── index.blade.php\n")])])]),t("h3",{attrs:{id:"adding-html-content"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#adding-html-content"}},[e._v("#")]),e._v(" Adding HTML Content")]),e._v(" "),t("p",[e._v("Below is an example of basic HTML content that you can add to each "),t("code",[e._v("index.blade.php")]),e._v(" file.")]),e._v(" "),t("h4",{attrs:{id:"index-blade-php-in-the-category-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#index-blade-php-in-the-category-directory"}},[e._v("#")]),e._v(" "),t("code",[e._v("index.blade.php")]),e._v(" in the "),t("code",[e._v("category")]),e._v(" Directory")]),e._v(" "),t("div",{staticClass:"language-html extra-class"},[t("pre",{pre:!0,attrs:{class:"language-html"}},[t("code",[e._v("@extends('admin::layouts.master')\n\n@section('page_title')\n {{ __('category::app.categories.index.title') }}\n@endsection\n\n@section('content-wrapper')\n\n@endsection\n")])])]),t("h2",{attrs:{id:"load-views-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#load-views-from-package"}},[e._v("#")]),e._v(" Load Views from Package")]),e._v(" "),t("p",[e._v("To make the views in our package accessible, we need to register them in the service provider's "),t("code",[e._v("boot")]),e._v(" method. This involves updating the "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(" file to include the view loading logic. Follow the steps below:")]),e._v(" "),t("h4",{attrs:{id:"open-the-service-provider-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#open-the-service-provider-file"}},[e._v("#")]),e._v(" Open the Service Provider File")]),e._v(" "),t("ul",[t("li",[e._v("Navigate to the "),t("code",[e._v("packages/Webkul/Category/src/Providers")]),e._v(" directory.")]),e._v(" "),t("li",[e._v("Open the "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(" file.")])]),e._v(" "),t("h4",{attrs:{id:"update-the-boot-method"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#update-the-boot-method"}},[e._v("#")]),e._v(" Update the "),t("code",[e._v("boot")]),e._v(" Method")]),e._v(" "),t("ul",[t("li",[e._v("Inside the "),t("code",[e._v("boot")]),e._v(" method of the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class, add the logic to load views from the package.")])]),e._v(" "),t("h4",{attrs:{id:"updated-categoryserviceprovider-php"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updated-categoryserviceprovider-php"}},[e._v("#")]),e._v(" Updated "),t("code",[e._v("CategoryServiceProvider.php")])]),e._v(" "),t("p",[e._v("Here is the updated code for "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("loadViewsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("__DIR__")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(".")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'/../Resources/views'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("h4",{attrs:{id:"explanation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("namespace")]),e._v(" keyword defines the namespace for the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class, which is "),t("code",[e._v("Webkul\\Category\\Providers")]),e._v(".")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class extends Laravel's base "),t("code",[e._v("ServiceProvider")]),e._v(" class.")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("boot")]),e._v(" method is used to bootstrap any application services.")])]),e._v(" "),t("li",[t("p",[e._v("Inside the "),t("code",[e._v("boot")]),e._v(" method, we use the "),t("code",[e._v("$this->loadViewsFrom")]),e._v(" method to register the views from the package.")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("loadViewsFrom")]),e._v(" method takes two arguments:")]),e._v(" "),t("ul",[t("li",[e._v("The path to the views directory within the package: "),t("code",[e._v("__DIR__ . '/../Resources/views'")]),e._v(".")]),e._v(" "),t("li",[e._v("A namespace for the views: "),t("code",[e._v("'category'")]),e._v(".")])])])]),e._v(" "),t("h2",{attrs:{id:"rendering-views"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rendering-views"}},[e._v("#")]),e._v(" Rendering Views")]),e._v(" "),t("p",[e._v("In Laravel applications, views are typically rendered from controller methods using the "),t("code",[e._v("view")]),e._v(" helper function. This section describes how views are invoked and passed data from a controller.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("categoryRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("with")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'author'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("view")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category::category.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("compact")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("h4",{attrs:{id:"explanation-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("view")]),e._v(" helper function in Laravel is used within the "),t("code",[e._v("index")]),e._v(" method of the "),t("code",[e._v("CategoryController")]),e._v(" to render the "),t("code",[e._v("category::category.index")]),e._v(" view.")])]),e._v(" "),t("li",[t("p",[e._v("It accepts two parameters the name of the view ("),t("code",[e._v("category::category.index")]),e._v(") and an array of data ("),t("code",[e._v("compact('categories')")]),e._v(") to pass to the "),t("code",[e._v("view")]),e._v(".")])])]),e._v(" "),t("h2",{attrs:{id:"blade-file-naming-convention"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#blade-file-naming-convention"}},[e._v("#")]),e._v(" Blade File Naming Convention")]),e._v(" "),t("p",[e._v("Krayin utilizes Blade templates to handle "),t("code",[e._v("listing")]),e._v(", "),t("code",[e._v("creation")]),e._v(", and "),t("code",[e._v("updating")]),e._v(" operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.")]),e._v(" "),t("h3",{attrs:{id:"listing-index-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-index-blade"}},[e._v("#")]),e._v(" Listing (Index Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("index.blade.php")]),e._v(" template is used to display a list of all records (categories).")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("index")]),e._v(" method fetches all categories and passes them to the view.")])])]),e._v(" "),t("h3",{attrs:{id:"creation-create-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creation-create-blade"}},[e._v("#")]),e._v(" Creation (Create Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("create.blade.php")]),e._v(" template contains a form for creating new records.")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("create")]),e._v(" method renders this view.")])])]),e._v(" "),t("h3",{attrs:{id:"updating-edit-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updating-edit-blade"}},[e._v("#")]),e._v(" Updating (Edit Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("edit.blade.php")]),e._v(" template contains a form for editing existing records.")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("edit")]),e._v(" method fetches the specific categories and passes it to the view.")])])]),e._v(" "),t("p",[e._v("By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{353:function(e,t,a){"use strict";a.r(t);var s=a(10),n=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"views"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#views"}},[e._v("#")]),e._v(" Views")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#directory-structure"}},[e._v("Directory Structure")]),t("ul",[t("li",[t("a",{attrs:{href:"#adding-html-content"}},[e._v("Adding HTML Content")])])])]),t("li",[t("a",{attrs:{href:"#load-views-from-package"}},[e._v("Load Views from Package")])]),t("li",[t("a",{attrs:{href:"#rendering-views"}},[e._v("Rendering Views")])]),t("li",[t("a",{attrs:{href:"#blade-file-naming-convention"}},[e._v("Blade File Naming Convention")]),t("ul",[t("li",[t("a",{attrs:{href:"#listing-index-blade"}},[e._v("Listing (Index Blade):")])]),t("li",[t("a",{attrs:{href:"#creation-create-blade"}},[e._v("Creation (Create Blade):")])]),t("li",[t("a",{attrs:{href:"#updating-edit-blade"}},[e._v("Updating (Edit Blade):")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Views in Laravel are responsible for separating the application's logic from the presentation layer. They provide a clean way to manage and organize the HTML content of your application. Views are typically stored in the "),t("code",[e._v("resources/views")]),e._v(" directory and are rendered using the Blade templating engine, which offers a simple and powerful way to create dynamic content.")]),e._v(" "),t("p",[e._v("By using views, you can create reusable templates and components, making your code more maintainable and easier to understand. Blade templates allow you to use control structures like loops and conditionals, as well as to include other templates, which helps to keep your views organized and modular.")]),e._v(" "),t("p",[e._v("To learn in detail about Views, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/views",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Here's a basic example of a Blade template:")]),e._v(" "),t("h2",{attrs:{id:"directory-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[e._v("#")]),e._v(" Directory Structure")]),e._v(" "),t("p",[e._v("To organize the views for our "),t("code",[e._v("Category")]),e._v(" package, we need to set up a specific directory structure. Follow the steps below to create the necessary directories.")]),e._v(" "),t("h4",{attrs:{id:"create-the-resources-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-resources-directory"}},[e._v("#")]),e._v(" Create the "),t("code",[e._v("Resources")]),e._v(" Directory")]),e._v(" "),t("ul",[t("li",[e._v("Navigate to the "),t("code",[e._v("packages/Webkul/Category/src")]),e._v(" directory.")]),e._v(" "),t("li",[e._v("Create a directory named "),t("code",[e._v("Resources")]),e._v(".")])]),e._v(" "),t("h4",{attrs:{id:"create-the-views-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-views-directory"}},[e._v("#")]),e._v(" Create the "),t("code",[e._v("views")]),e._v(" Directory")]),e._v(" "),t("ul",[t("li",[e._v("Inside the "),t("code",[e._v("Resources")]),e._v(" directory, create another directory named "),t("code",[e._v("views")]),e._v(" and inside the views directory create category directory.")]),e._v(" "),t("li",[e._v("Inside the "),t("code",[e._v("views/category")]),e._v(" directory, create a file named "),t("code",[e._v("index.blade.php")]),e._v(", "),t("code",[e._v("create.blade.php")]),e._v(", "),t("code",[e._v("edit.blade.php")]),e._v(" .")])]),e._v(" "),t("p",[e._v("The updated directory structure will look like this:")]),e._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[e._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("..")]),e._v(".\n └── Resources\n └── views\n └── category\n ├── create.blade.php\n ├── edit.blade.php\n └── index.blade.php\n")])])]),t("h3",{attrs:{id:"adding-html-content"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#adding-html-content"}},[e._v("#")]),e._v(" Adding HTML Content")]),e._v(" "),t("p",[e._v("Below is an example of basic HTML content that you can add to each "),t("code",[e._v("index.blade.php")]),e._v(" file.")]),e._v(" "),t("h4",{attrs:{id:"index-blade-php-in-the-category-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#index-blade-php-in-the-category-directory"}},[e._v("#")]),e._v(" "),t("code",[e._v("index.blade.php")]),e._v(" in the "),t("code",[e._v("category")]),e._v(" Directory")]),e._v(" "),t("div",{staticClass:"language-html extra-class"},[t("pre",{pre:!0,attrs:{class:"language-html"}},[t("code",[e._v("@extends('admin::layouts.master')\n\n@section('page_title')\n {{ __('category::app.categories.index.title') }}\n@endsection\n\n@section('content-wrapper')\n\n@endsection\n")])])]),t("h2",{attrs:{id:"load-views-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#load-views-from-package"}},[e._v("#")]),e._v(" Load Views from Package")]),e._v(" "),t("p",[e._v("To make the views in our package accessible, we need to register them in the service provider's "),t("code",[e._v("boot")]),e._v(" method. This involves updating the "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(" file to include the view loading logic. Follow the steps below:")]),e._v(" "),t("h4",{attrs:{id:"open-the-service-provider-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#open-the-service-provider-file"}},[e._v("#")]),e._v(" Open the Service Provider File")]),e._v(" "),t("ul",[t("li",[e._v("Navigate to the "),t("code",[e._v("packages/Webkul/Category/src/Providers")]),e._v(" directory.")]),e._v(" "),t("li",[e._v("Open the "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(" file.")])]),e._v(" "),t("h4",{attrs:{id:"update-the-boot-method"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#update-the-boot-method"}},[e._v("#")]),e._v(" Update the "),t("code",[e._v("boot")]),e._v(" Method")]),e._v(" "),t("ul",[t("li",[e._v("Inside the "),t("code",[e._v("boot")]),e._v(" method of the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class, add the logic to load views from the package.")])]),e._v(" "),t("h4",{attrs:{id:"updated-categoryserviceprovider-php"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updated-categoryserviceprovider-php"}},[e._v("#")]),e._v(" Updated "),t("code",[e._v("CategoryServiceProvider.php")])]),e._v(" "),t("p",[e._v("Here is the updated code for "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("loadViewsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("__DIR__")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(".")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'/../Resources/views'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("h4",{attrs:{id:"explanation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("namespace")]),e._v(" keyword defines the namespace for the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class, which is "),t("code",[e._v("Webkul\\Category\\Providers")]),e._v(".")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class extends Laravel's base "),t("code",[e._v("ServiceProvider")]),e._v(" class.")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("boot")]),e._v(" method is used to bootstrap any application services.")])]),e._v(" "),t("li",[t("p",[e._v("Inside the "),t("code",[e._v("boot")]),e._v(" method, we use the "),t("code",[e._v("$this->loadViewsFrom")]),e._v(" method to register the views from the package.")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("loadViewsFrom")]),e._v(" method takes two arguments:")]),e._v(" "),t("ul",[t("li",[e._v("The path to the views directory within the package: "),t("code",[e._v("__DIR__ . '/../Resources/views'")]),e._v(".")]),e._v(" "),t("li",[e._v("A namespace for the views: "),t("code",[e._v("'category'")]),e._v(".")])])])]),e._v(" "),t("h2",{attrs:{id:"rendering-views"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rendering-views"}},[e._v("#")]),e._v(" Rendering Views")]),e._v(" "),t("p",[e._v("In Laravel applications, views are typically rendered from controller methods using the "),t("code",[e._v("view")]),e._v(" helper function. This section describes how views are invoked and passed data from a controller.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("categoryRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("with")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'author'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("view")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category::category.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("compact")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("h4",{attrs:{id:"explanation-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("view")]),e._v(" helper function in Laravel is used within the "),t("code",[e._v("index")]),e._v(" method of the "),t("code",[e._v("CategoryController")]),e._v(" to render the "),t("code",[e._v("category::category.index")]),e._v(" view.")])]),e._v(" "),t("li",[t("p",[e._v("It accepts two parameters the name of the view ("),t("code",[e._v("category::category.index")]),e._v(") and an array of data ("),t("code",[e._v("compact('categories')")]),e._v(") to pass to the "),t("code",[e._v("view")]),e._v(".")])])]),e._v(" "),t("h2",{attrs:{id:"blade-file-naming-convention"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#blade-file-naming-convention"}},[e._v("#")]),e._v(" Blade File Naming Convention")]),e._v(" "),t("p",[e._v("Krayin utilizes Blade templates to handle "),t("code",[e._v("listing")]),e._v(", "),t("code",[e._v("creation")]),e._v(", and "),t("code",[e._v("updating")]),e._v(" operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.")]),e._v(" "),t("h3",{attrs:{id:"listing-index-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-index-blade"}},[e._v("#")]),e._v(" Listing (Index Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("index.blade.php")]),e._v(" template is used to display a list of all records (categories).")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("index")]),e._v(" method fetches all categories and passes them to the view.")])])]),e._v(" "),t("h3",{attrs:{id:"creation-create-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creation-create-blade"}},[e._v("#")]),e._v(" Creation (Create Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("create.blade.php")]),e._v(" template contains a form for creating new records.")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("create")]),e._v(" method renders this view.")])])]),e._v(" "),t("h3",{attrs:{id:"updating-edit-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updating-edit-blade"}},[e._v("#")]),e._v(" Updating (Edit Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("edit.blade.php")]),e._v(" template contains a form for editing existing records.")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("edit")]),e._v(" method fetches the specific categories and passes it to the view.")])])]),e._v(" "),t("p",[e._v("By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/58.8682472a.js b/assets/js/58.93cb57f4.js similarity index 97% rename from assets/js/58.8682472a.js rename to assets/js/58.93cb57f4.js index be8b0d7..46f67cc 100644 --- a/assets/js/58.8682472a.js +++ b/assets/js/58.93cb57f4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{358:function(e,t,a){"use strict";a.r(t);var o=a(10),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"digging-deeper"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#digging-deeper"}},[e._v("#")]),e._v(" Digging Deeper")]),e._v(" "),t("p",[e._v('Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.')]),e._v(" "),t("p",[e._v("We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the "),t("RouterLink",{attrs:{to:"/2.0/packages/create-package.html"}},[e._v("Package Development")]),e._v(" section for a primer on creating and managing packages in Laravel.")],1),e._v(" "),t("h3",{attrs:{id:"events-and-event-handlers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-and-event-handlers"}},[e._v("#")]),e._v(" Events and Event Handlers")]),e._v(" "),t("p",[e._v("Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.")]),e._v(" "),t("h3",{attrs:{id:"helpers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#helpers"}},[e._v("#")]),e._v(" Helpers")]),e._v(" "),t("p",[e._v("Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.")]),e._v(" "),t("h3",{attrs:{id:"overriding-core-models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overriding-core-models"}},[e._v("#")]),e._v(" Overriding Core Models")]),e._v(" "),t("p",[e._v("Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{355:function(e,t,a){"use strict";a.r(t);var o=a(10),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"digging-deeper"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#digging-deeper"}},[e._v("#")]),e._v(" Digging Deeper")]),e._v(" "),t("p",[e._v('Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.')]),e._v(" "),t("p",[e._v("We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the "),t("RouterLink",{attrs:{to:"/2.0/packages/create-package.html"}},[e._v("Package Development")]),e._v(" section for a primer on creating and managing packages in Laravel.")],1),e._v(" "),t("h3",{attrs:{id:"events-and-event-handlers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-and-event-handlers"}},[e._v("#")]),e._v(" Events and Event Handlers")]),e._v(" "),t("p",[e._v("Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.")]),e._v(" "),t("h3",{attrs:{id:"helpers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#helpers"}},[e._v("#")]),e._v(" Helpers")]),e._v(" "),t("p",[e._v("Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.")]),e._v(" "),t("h3",{attrs:{id:"overriding-core-models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overriding-core-models"}},[e._v("#")]),e._v(" Overriding Core Models")]),e._v(" "),t("p",[e._v("Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/59.75e6dc8a.js b/assets/js/59.263f9a81.js similarity index 99% rename from assets/js/59.75e6dc8a.js rename to assets/js/59.263f9a81.js index 1eb8e08..d6841c2 100644 --- a/assets/js/59.75e6dc8a.js +++ b/assets/js/59.263f9a81.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{355:function(e,t,n){"use strict";n.r(t);var i=n(10),a=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#sendgrid-inbound-parse"}},[e._v("SendGrid Inbound Parse")])])])]),t("p"),e._v(" "),t("h3",{attrs:{id:"sendgrid-inbound-parse"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sendgrid-inbound-parse"}},[e._v("#")]),e._v(" "),t("strong",[e._v("SendGrid Inbound Parse")])]),e._v(" "),t("p",[e._v("Krayin CRM can be integrated with SendGrid’s "),t("strong",[e._v("Inbound Parse Webhook")]),e._v(" to handle incoming emails. This allows emails sent to a specific domain to be automatically processed by Krayin and displayed in the "),t("strong",[e._v("Mail > Inbox")]),e._v(" section.")]),e._v(" "),t("h4",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Overview")])]),e._v(" "),t("p",[e._v("The "),t("strong",[e._v("Inbound Parse Webhook")]),e._v(" feature of SendGrid allows emails to be converted into HTTP POST requests and forwarded to a specified URL in your application. By integrating SendGrid with Krayin CRM, you can seamlessly receive and display incoming emails.")]),e._v(" "),t("h4",{attrs:{id:"set-sendgrid-as-the-email-receiver-driver"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#set-sendgrid-as-the-email-receiver-driver"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Set SendGrid as the Email Receiver Driver")])]),e._v(" "),t("p",[e._v("In the "),t("code",[e._v(".env")]),e._v(" file, ensure that the "),t("code",[e._v("MAIL_RECEIVER_DRIVER")]),e._v(" is set to "),t("code",[e._v("sendgrid")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language-env extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("MAIL_RECEIVER_DRIVER=sendgrid\n")])])]),t("p",[e._v("This tells Krayin CRM to use the SendGrid package to handle incoming emails.")]),e._v(" "),t("h4",{attrs:{id:"setting-up-sendgrid-inbound-parse-with-krayin-crm"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-sendgrid-inbound-parse-with-krayin-crm"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Setting Up SendGrid Inbound Parse with Krayin CRM")])]),e._v(" "),t("ol",[t("li",[t("p",[t("strong",[e._v("Create a Domain and Email in SendGrid")])]),e._v(" "),t("ul",[t("li",[e._v("Log into your "),t("a",{attrs:{href:"https://app.sendgrid.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("SendGrid account"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("li",[e._v("Go to "),t("strong",[e._v("Settings")]),e._v(" > "),t("strong",[e._v("Inbound Parse")]),e._v(".")]),e._v(" "),t("li",[e._v("Click "),t("strong",[e._v("Add Host & URL")]),e._v(" to configure a new Parse Webhook.")]),e._v(" "),t("li",[e._v("Add the domain from which you want to receive emails (e.g., "),t("code",[e._v("example.com")]),e._v(").")]),e._v(" "),t("li",[e._v("Under the "),t("strong",[e._v("URL")]),e._v(" field, specify your Krayin CRM webhook URL, which should be in the format:"),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse\n")])])]),e._v("Replace "),t("code",[e._v("yourdomain.com")]),e._v(" with your actual domain and ensure the endpoint matches your Krayin setup.")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Configure Krayin CRM to Receive Emails")])]),e._v(" "),t("ul",[t("li",[e._v("Once the webhook is set up in SendGrid, all emails sent to the configured domain will be forwarded to the specified Krayin webhook.")]),e._v(" "),t("li",[e._v("Krayin CRM will handle the incoming email data, including:\n"),t("ul",[t("li",[t("strong",[e._v("From Address:")]),e._v(" The sender's email.")]),e._v(" "),t("li",[t("strong",[e._v("To Address:")]),e._v(" The recipient (your configured email).")]),e._v(" "),t("li",[t("strong",[e._v("Subject:")]),e._v(" Email subject.")]),e._v(" "),t("li",[t("strong",[e._v("Text/HTML Body:")]),e._v(" Email content in plain text or HTML.")]),e._v(" "),t("li",[t("strong",[e._v("Attachments:")]),e._v(" Any files attached to the email.")])])])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Krayin Endpoint for Inbound Parse")])]),e._v(" "),t("ul",[t("li",[e._v("Ensure that Krayin CRM is set up to receive the POST data from SendGrid. The email content will be sent to the following Krayin endpoint:"),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse\n")])])])]),e._v(" "),t("li",[e._v("Krayin will parse the data sent by SendGrid, store the email information in the database, and display it in the "),t("strong",[e._v("Mail > Inbox")]),e._v(" section.")])])])]),e._v(" "),t("h4",{attrs:{id:"handling-email-attachments"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#handling-email-attachments"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Handling Email Attachments")])]),e._v(" "),t("p",[e._v("Krayin CRM is capable of handling attachments that are sent via email. These attachments will be forwarded from SendGrid to your endpoint as "),t("code",[e._v("multipart/form-data")]),e._v(". Make sure your server can process and store these files for later retrieval in the "),t("strong",[e._v("Mail > Inbox")]),e._v(" section of the CRM.")]),e._v(" "),t("h4",{attrs:{id:"security-considerations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#security-considerations"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Security Considerations")])]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Verify the Request Origin:")]),e._v(" Ensure that incoming requests to your webhook are actually coming from SendGrid. You can verify the origin by checking headers or configuring an API key in SendGrid for additional security.")]),e._v(" "),t("li",[t("strong",[e._v("HTTPS:")]),e._v(" Always use an HTTPS endpoint for secure communication between SendGrid and your server.")])]),e._v(" "),t("h4",{attrs:{id:"debugging-and-testing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#debugging-and-testing"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Debugging and Testing")])]),e._v(" "),t("ul",[t("li",[e._v("SendGrid provides tools to simulate incoming emails, which can be used to test your webhook configuration.")]),e._v(" "),t("li",[e._v("Ensure that your server’s response time is efficient. SendGrid expects a response within 20 seconds. If the email processing takes longer (e.g., saving attachments), consider using asynchronous background tasks.")])]),e._v(" "),t("h4",{attrs:{id:"example-workflow"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example-workflow"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Example Workflow")])]),e._v(" "),t("ol",[t("li",[e._v("A user sends an email to "),t("code",[e._v("contact@example.com")]),e._v(".")]),e._v(" "),t("li",[e._v("SendGrid captures the email and forwards it to your Krayin webhook ("),t("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse")]),e._v(").")]),e._v(" "),t("li",[e._v("Krayin CRM processes the incoming email, stores the details, and displays the email in the "),t("strong",[e._v("Mail > Inbox")]),e._v(" section.")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{356:function(e,t,n){"use strict";n.r(t);var i=n(10),a=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#sendgrid-inbound-parse"}},[e._v("SendGrid Inbound Parse")])])])]),t("p"),e._v(" "),t("h3",{attrs:{id:"sendgrid-inbound-parse"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sendgrid-inbound-parse"}},[e._v("#")]),e._v(" "),t("strong",[e._v("SendGrid Inbound Parse")])]),e._v(" "),t("p",[e._v("Krayin CRM can be integrated with SendGrid’s "),t("strong",[e._v("Inbound Parse Webhook")]),e._v(" to handle incoming emails. This allows emails sent to a specific domain to be automatically processed by Krayin and displayed in the "),t("strong",[e._v("Mail > Inbox")]),e._v(" section.")]),e._v(" "),t("h4",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Overview")])]),e._v(" "),t("p",[e._v("The "),t("strong",[e._v("Inbound Parse Webhook")]),e._v(" feature of SendGrid allows emails to be converted into HTTP POST requests and forwarded to a specified URL in your application. By integrating SendGrid with Krayin CRM, you can seamlessly receive and display incoming emails.")]),e._v(" "),t("h4",{attrs:{id:"set-sendgrid-as-the-email-receiver-driver"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#set-sendgrid-as-the-email-receiver-driver"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Set SendGrid as the Email Receiver Driver")])]),e._v(" "),t("p",[e._v("In the "),t("code",[e._v(".env")]),e._v(" file, ensure that the "),t("code",[e._v("MAIL_RECEIVER_DRIVER")]),e._v(" is set to "),t("code",[e._v("sendgrid")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language-env extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("MAIL_RECEIVER_DRIVER=sendgrid\n")])])]),t("p",[e._v("This tells Krayin CRM to use the SendGrid package to handle incoming emails.")]),e._v(" "),t("h4",{attrs:{id:"setting-up-sendgrid-inbound-parse-with-krayin-crm"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-sendgrid-inbound-parse-with-krayin-crm"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Setting Up SendGrid Inbound Parse with Krayin CRM")])]),e._v(" "),t("ol",[t("li",[t("p",[t("strong",[e._v("Create a Domain and Email in SendGrid")])]),e._v(" "),t("ul",[t("li",[e._v("Log into your "),t("a",{attrs:{href:"https://app.sendgrid.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("SendGrid account"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("li",[e._v("Go to "),t("strong",[e._v("Settings")]),e._v(" > "),t("strong",[e._v("Inbound Parse")]),e._v(".")]),e._v(" "),t("li",[e._v("Click "),t("strong",[e._v("Add Host & URL")]),e._v(" to configure a new Parse Webhook.")]),e._v(" "),t("li",[e._v("Add the domain from which you want to receive emails (e.g., "),t("code",[e._v("example.com")]),e._v(").")]),e._v(" "),t("li",[e._v("Under the "),t("strong",[e._v("URL")]),e._v(" field, specify your Krayin CRM webhook URL, which should be in the format:"),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse\n")])])]),e._v("Replace "),t("code",[e._v("yourdomain.com")]),e._v(" with your actual domain and ensure the endpoint matches your Krayin setup.")])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Configure Krayin CRM to Receive Emails")])]),e._v(" "),t("ul",[t("li",[e._v("Once the webhook is set up in SendGrid, all emails sent to the configured domain will be forwarded to the specified Krayin webhook.")]),e._v(" "),t("li",[e._v("Krayin CRM will handle the incoming email data, including:\n"),t("ul",[t("li",[t("strong",[e._v("From Address:")]),e._v(" The sender's email.")]),e._v(" "),t("li",[t("strong",[e._v("To Address:")]),e._v(" The recipient (your configured email).")]),e._v(" "),t("li",[t("strong",[e._v("Subject:")]),e._v(" Email subject.")]),e._v(" "),t("li",[t("strong",[e._v("Text/HTML Body:")]),e._v(" Email content in plain text or HTML.")]),e._v(" "),t("li",[t("strong",[e._v("Attachments:")]),e._v(" Any files attached to the email.")])])])])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Krayin Endpoint for Inbound Parse")])]),e._v(" "),t("ul",[t("li",[e._v("Ensure that Krayin CRM is set up to receive the POST data from SendGrid. The email content will be sent to the following Krayin endpoint:"),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse\n")])])])]),e._v(" "),t("li",[e._v("Krayin will parse the data sent by SendGrid, store the email information in the database, and display it in the "),t("strong",[e._v("Mail > Inbox")]),e._v(" section.")])])])]),e._v(" "),t("h4",{attrs:{id:"handling-email-attachments"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#handling-email-attachments"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Handling Email Attachments")])]),e._v(" "),t("p",[e._v("Krayin CRM is capable of handling attachments that are sent via email. These attachments will be forwarded from SendGrid to your endpoint as "),t("code",[e._v("multipart/form-data")]),e._v(". Make sure your server can process and store these files for later retrieval in the "),t("strong",[e._v("Mail > Inbox")]),e._v(" section of the CRM.")]),e._v(" "),t("h4",{attrs:{id:"security-considerations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#security-considerations"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Security Considerations")])]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Verify the Request Origin:")]),e._v(" Ensure that incoming requests to your webhook are actually coming from SendGrid. You can verify the origin by checking headers or configuring an API key in SendGrid for additional security.")]),e._v(" "),t("li",[t("strong",[e._v("HTTPS:")]),e._v(" Always use an HTTPS endpoint for secure communication between SendGrid and your server.")])]),e._v(" "),t("h4",{attrs:{id:"debugging-and-testing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#debugging-and-testing"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Debugging and Testing")])]),e._v(" "),t("ul",[t("li",[e._v("SendGrid provides tools to simulate incoming emails, which can be used to test your webhook configuration.")]),e._v(" "),t("li",[e._v("Ensure that your server’s response time is efficient. SendGrid expects a response within 20 seconds. If the email processing takes longer (e.g., saving attachments), consider using asynchronous background tasks.")])]),e._v(" "),t("h4",{attrs:{id:"example-workflow"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example-workflow"}},[e._v("#")]),e._v(" "),t("strong",[e._v("Example Workflow")])]),e._v(" "),t("ol",[t("li",[e._v("A user sends an email to "),t("code",[e._v("contact@example.com")]),e._v(".")]),e._v(" "),t("li",[e._v("SendGrid captures the email and forwards it to your Krayin webhook ("),t("code",[e._v("http://yourdomain.com/admin/mail/inbound-parse")]),e._v(").")]),e._v(" "),t("li",[e._v("Krayin CRM processes the incoming email, stores the details, and displays the email in the "),t("strong",[e._v("Mail > Inbox")]),e._v(" section.")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/60.33991b7f.js b/assets/js/60.77d06899.js similarity index 99% rename from assets/js/60.33991b7f.js rename to assets/js/60.77d06899.js index 3f5f16e..8fdbed8 100644 --- a/assets/js/60.33991b7f.js +++ b/assets/js/60.77d06899.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{357:function(e,t,s){"use strict";s.r(t);var a=s(10),r=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events"}},[e._v("#")]),e._v(" Events")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#creating-an-event-class"}},[e._v("Creating an Event Class")]),t("ul",[t("li",[t("a",{attrs:{href:"#using-package-generator"}},[e._v("Using Package Generator")])]),t("li",[t("a",{attrs:{href:"#manually-registering-events"}},[e._v("Manually Registering Events")])]),t("li",[t("a",{attrs:{href:"#manually-registering-listeners"}},[e._v("Manually Registering Listeners")])])])]),t("li",[t("a",{attrs:{href:"#specifying-events"}},[e._v("Specifying Events")])]),t("li",[t("a",{attrs:{href:"#events-fired-in-krayin"}},[e._v("Events Fired in Krayin")])]),t("li",[t("a",{attrs:{href:"#listening-to-existing-events"}},[e._v("Listening to Existing Events")]),t("ul",[t("li",[t("a",{attrs:{href:"#registering-a-listener"}},[e._v("Registering a Listener")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Event Listeners in Krayin are a way to implement the observer pattern, where listeners respond to events that occur in the application. Events can be thought of as announcements made by the application, and listeners are the actions taken in response to those announcements. All event classes in Krayin are stored in the "),t("code",[e._v("Providers")]),e._v(" directory, and the listeners are stored in the "),t("code",[e._v("Listeners")]),e._v(" directory.")]),e._v(" "),t("p",[e._v("In Krayin, events and listeners are organized in a clear and structured manner:")]),e._v(" "),t("ul",[t("li",[e._v("Events are typically stored in the Events directory.")]),e._v(" "),t("li",[e._v("Listeners are stored in the Listeners directory.")])]),e._v(" "),t("p",[e._v("This organization makes it easy to manage and locate the event-driven components of your application.")]),e._v(" "),t("p",[e._v("To learn in detail about Controllers, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/events",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"creating-an-event-class"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-an-event-class"}},[e._v("#")]),e._v(" Creating an Event Class")]),e._v(" "),t("h3",{attrs:{id:"using-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-package-generator"}},[e._v("#")]),e._v(" Using Package Generator")]),e._v(" "),t("p",[e._v("If you have the Krayin Package Generator installed, you can use the following command to create a new event class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category\n")])])]),t("p",[e._v("If the event class already exists, you can use the --force option to overwrite it:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--force")]),e._v("\n")])])]),t("p",[e._v("Alternatively, if you don't have the package generator, you can create the file manually by creating a new class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-events"}},[e._v("#")]),e._v(" Manually Registering Events")]),e._v(" "),t("p",[e._v("In Krayin, you register events manually in the "),t("code",[e._v("boot")]),e._v(" method of your "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file. Here is an example of how to register events:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Register any other events for your application.\n *\n * @return void\n */")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'event.name'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'path-upto-listener@function'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, "),t("code",[e._v("event.name")]),e._v(" is the name of the event, and "),t("code",[e._v("path-upto-listener@function")]),e._v(" is the listener method that will handle the event.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-listeners"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-listeners"}},[e._v("#")]),e._v(" Manually Registering Listeners")]),e._v(" "),t("p",[e._v("When registering events, you specify the listener function to be executed when an event is triggered. Here is an example of how to register a listener:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("EventServiceProvider")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ServiceProvider")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Bootstrap services.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, the "),t("code",[e._v("lead.create.after")]),e._v(" event will trigger the "),t("code",[e._v("linkToEmail")]),e._v(" method of the "),t("code",[e._v("Leads")]),e._v(" listener in the "),t("code",[e._v("Webkul\\Admin\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("h2",{attrs:{id:"specifying-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specifying-events"}},[e._v("#")]),e._v(" Specifying Events")]),e._v(" "),t("p",[e._v("In Krayin, events are typically fired before and after the execution of CRUD operations. This allows listeners to perform additional actions, such as logging, notifications, or data manipulation, at specific points in the lifecycle of an operation.")]),e._v(" "),t("p",[e._v("For example, you might have events fired during product creation, updating, or deletion. Here’s an example of firing events before and after saving an order:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("namespace")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Sales"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Repositories")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("use")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Admin"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Http"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Requests"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("LeadForm")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("LeadController")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Repository")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Create a new controller instance.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("__construct")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("protected")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadRepository")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$leadRepository")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'entity_type'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'leads'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Store a newly created resource in storage.\n * \n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("store")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadForm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("stageRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("findOrFail")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("lead_pipeline_id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("else")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("pipelineRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("getDefaultPipeline")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("stages")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("first")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("in_array")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("code")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'won'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lost'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'closed_at'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Carbon")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("now")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("leadRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("session")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("flash")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("trans")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin::app.leads.create-success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("redirect")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("route")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin.leads.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("h2",{attrs:{id:"events-fired-in-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-fired-in-krayin"}},[e._v("#")]),e._v(" Events Fired in Krayin")]),e._v(" "),t("p",[e._v("In Krayin, there are several events fired throughout its operations, allowing developers to hook into specific points in the application's lifecycle to customize behavior or add functionality. Here's a list of events that are fired in Krayin, which you can listen to and handle as needed by creating event listeners:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Events name")]),e._v(" "),t("th",[e._v("Functionality")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("activity.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.before")]),e._v(" "),t("td",[e._v("This event will be fired before configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.after")]),e._v(" "),t("td",[e._v("This event will be fired after configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization created .")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("user.account.update-password")]),e._v(" "),t("td",[e._v("This event will be fired after user password gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get deleted")])])])]),e._v(" "),t("h2",{attrs:{id:"listening-to-existing-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-existing-events"}},[e._v("#")]),e._v(" Listening to Existing Events")]),e._v(" "),t("p",[e._v("Krayin uses events and listeners to implement the observer pattern, allowing you to respond to various actions and events within the application. You can listen to specific events and execute custom code when those events are triggered.")]),e._v(" "),t("h3",{attrs:{id:"registering-a-listener"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#registering-a-listener"}},[e._v("#")]),e._v(" Registering a Listener")]),e._v(" "),t("p",[e._v("Open the "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file located in the "),t("code",[e._v("Providers")]),e._v(" directory of your Krayin application. This file is where you register event listeners.")]),e._v(" "),t("p",[e._v("Inside the "),t("code",[e._v("boot()")]),e._v(" method of "),t("code",[e._v("EventServiceProvider.php")]),e._v(", use the "),t("code",[e._v("Event::listen")]),e._v(" method to register your listener. This method takes the event name and a callback function or a class method that will handle the event.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])]),t("p",[e._v("In the example above, we are listening to the "),t("code",[e._v("lead.create.before")]),e._v(" event and specifying the "),t("code",[e._v("createOrder")]),e._v(" function from the "),t("code",[e._v("Order")]),e._v(" listener class in the "),t("code",[e._v("Webkul\\Notification\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("p",[e._v("Replace "),t("code",[e._v("'lead.create.before'")]),e._v(" with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.")]),e._v(" "),t("p",[e._v("By registering the listener, you have associated the "),t("strong",[t("code",[e._v("createOrder")])]),e._v(" function with the "),t("strong",[t("code",[e._v("lead.create.before")])]),e._v(" event. Whenever this event is triggered, the specified function will be executed.")]),e._v(" "),t("p",[e._v("You can modify the listener function according to your requirements to perform the desired operation.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{358:function(e,t,s){"use strict";s.r(t);var a=s(10),r=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events"}},[e._v("#")]),e._v(" Events")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#creating-an-event-class"}},[e._v("Creating an Event Class")]),t("ul",[t("li",[t("a",{attrs:{href:"#using-package-generator"}},[e._v("Using Package Generator")])]),t("li",[t("a",{attrs:{href:"#manually-registering-events"}},[e._v("Manually Registering Events")])]),t("li",[t("a",{attrs:{href:"#manually-registering-listeners"}},[e._v("Manually Registering Listeners")])])])]),t("li",[t("a",{attrs:{href:"#specifying-events"}},[e._v("Specifying Events")])]),t("li",[t("a",{attrs:{href:"#events-fired-in-krayin"}},[e._v("Events Fired in Krayin")])]),t("li",[t("a",{attrs:{href:"#listening-to-existing-events"}},[e._v("Listening to Existing Events")]),t("ul",[t("li",[t("a",{attrs:{href:"#registering-a-listener"}},[e._v("Registering a Listener")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Event Listeners in Krayin are a way to implement the observer pattern, where listeners respond to events that occur in the application. Events can be thought of as announcements made by the application, and listeners are the actions taken in response to those announcements. All event classes in Krayin are stored in the "),t("code",[e._v("Providers")]),e._v(" directory, and the listeners are stored in the "),t("code",[e._v("Listeners")]),e._v(" directory.")]),e._v(" "),t("p",[e._v("In Krayin, events and listeners are organized in a clear and structured manner:")]),e._v(" "),t("ul",[t("li",[e._v("Events are typically stored in the Events directory.")]),e._v(" "),t("li",[e._v("Listeners are stored in the Listeners directory.")])]),e._v(" "),t("p",[e._v("This organization makes it easy to manage and locate the event-driven components of your application.")]),e._v(" "),t("p",[e._v("To learn in detail about Controllers, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/events",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"creating-an-event-class"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-an-event-class"}},[e._v("#")]),e._v(" Creating an Event Class")]),e._v(" "),t("h3",{attrs:{id:"using-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-package-generator"}},[e._v("#")]),e._v(" Using Package Generator")]),e._v(" "),t("p",[e._v("If you have the Krayin Package Generator installed, you can use the following command to create a new event class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category\n")])])]),t("p",[e._v("If the event class already exists, you can use the --force option to overwrite it:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-event CategoryEvent Webkul/Category "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("--force")]),e._v("\n")])])]),t("p",[e._v("Alternatively, if you don't have the package generator, you can create the file manually by creating a new class in the "),t("code",[e._v("packages/Webkul/Category/src/Events")]),e._v(" directory.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-events"}},[e._v("#")]),e._v(" Manually Registering Events")]),e._v(" "),t("p",[e._v("In Krayin, you register events manually in the "),t("code",[e._v("boot")]),e._v(" method of your "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file. Here is an example of how to register events:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Register any other events for your application.\n *\n * @return void\n */")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'event.name'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'path-upto-listener@function'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, "),t("code",[e._v("event.name")]),e._v(" is the name of the event, and "),t("code",[e._v("path-upto-listener@function")]),e._v(" is the listener method that will handle the event.")]),e._v(" "),t("h3",{attrs:{id:"manually-registering-listeners"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manually-registering-listeners"}},[e._v("#")]),e._v(" Manually Registering Listeners")]),e._v(" "),t("p",[e._v("When registering events, you specify the listener function to be executed when an event is triggered. Here is an example of how to register a listener:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("EventServiceProvider")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("ServiceProvider")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Bootstrap services.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("boot")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// ...")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("p",[e._v("In this example, the "),t("code",[e._v("lead.create.after")]),e._v(" event will trigger the "),t("code",[e._v("linkToEmail")]),e._v(" method of the "),t("code",[e._v("Leads")]),e._v(" listener in the "),t("code",[e._v("Webkul\\Admin\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("h2",{attrs:{id:"specifying-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specifying-events"}},[e._v("#")]),e._v(" Specifying Events")]),e._v(" "),t("p",[e._v("In Krayin, events are typically fired before and after the execution of CRUD operations. This allows listeners to perform additional actions, such as logging, notifications, or data manipulation, at specific points in the lifecycle of an operation.")]),e._v(" "),t("p",[e._v("For example, you might have events fired during product creation, updating, or deletion. Here’s an example of firing events before and after saving an order:")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("namespace")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Sales"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Repositories")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("use")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token package"}},[e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Admin"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Http"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Requests"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("LeadForm")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[e._v("LeadController")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("extends")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[e._v("Repository")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Create a new controller instance.\n *\n * @return void\n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("__construct")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("protected")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadRepository")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$leadRepository")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("add")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'entity_type'")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=>")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'leads'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * Store a newly created resource in storage.\n * \n */")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("public")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("function")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[e._v("store")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name type-declaration"}},[e._v("LeadForm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("request")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("stageRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("findOrFail")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("lead_pipeline_id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("else")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("pipelineRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("getDefaultPipeline")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("stages")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("first")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$pipeline")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_stage_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("if")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("in_array")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$stage")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("code")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'won'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lost'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'closed_at'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Carbon")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("now")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$this")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("leadRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("create")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("dispatch")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.after'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$lead")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("session")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("flash")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("trans")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin::app.leads.create-success'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("redirect")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("route")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'admin.leads.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[e._v("$data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead_pipeline_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),t("h2",{attrs:{id:"events-fired-in-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#events-fired-in-krayin"}},[e._v("#")]),e._v(" Events Fired in Krayin")]),e._v(" "),t("p",[e._v("In Krayin, there are several events fired throughout its operations, allowing developers to hook into specific points in the application's lifecycle to customize behavior or add functionality. Here's a list of events that are fired in Krayin, which you can listen to and handle as needed by creating event listeners:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("Events name")]),e._v(" "),t("th",[e._v("Functionality")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("activity.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activities.file.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after file gets uploaded.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("activity.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after activity gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.before")]),e._v(" "),t("td",[e._v("This event will be fired before configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("core.configuration.save.after")]),e._v(" "),t("td",[e._v("This event will be fired after configuration gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization created .")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.organization.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contact.organization.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after organization get deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.create.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.updated.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.before")]),e._v(" "),t("td",[e._v("This events will be fired before contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("contacts.person.delete.after")]),e._v(" "),t("td",[e._v("This events will be fired after contact person gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets created.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets updated.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("lead.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after leads gets deleted.")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quotes leads gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads created")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("leads.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag leads deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets created")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("email.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email gets deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get created")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get updated")])]),e._v(" "),t("tr",[t("td",[e._v("product.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("product.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after products get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get created")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get updated")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("quote.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after quote get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.attribute.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after attribute get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.email_templates.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after email template get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.group.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after group get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.pipeline.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after pipeline get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.role.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after role get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.source.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after source get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.tag.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after tag get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.type.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after type get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.user.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after user get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.workflow.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after workflow get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("user.account.update-password")]),e._v(" "),t("td",[e._v("This event will be fired after user password gets updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.create.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get created")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.update.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get updated")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.before")]),e._v(" "),t("td",[e._v("This event will be fired before web form get deleted")])]),e._v(" "),t("tr",[t("td",[e._v("settings.web_forms.delete.after")]),e._v(" "),t("td",[e._v("This event will be fired after web form get deleted")])])])]),e._v(" "),t("h2",{attrs:{id:"listening-to-existing-events"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-existing-events"}},[e._v("#")]),e._v(" Listening to Existing Events")]),e._v(" "),t("p",[e._v("Krayin uses events and listeners to implement the observer pattern, allowing you to respond to various actions and events within the application. You can listen to specific events and execute custom code when those events are triggered.")]),e._v(" "),t("h3",{attrs:{id:"registering-a-listener"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#registering-a-listener"}},[e._v("#")]),e._v(" Registering a Listener")]),e._v(" "),t("p",[e._v("Open the "),t("code",[e._v("EventServiceProvider.php")]),e._v(" file located in the "),t("code",[e._v("Providers")]),e._v(" directory of your Krayin application. This file is where you register event listeners.")]),e._v(" "),t("p",[e._v("Inside the "),t("code",[e._v("boot()")]),e._v(" method of "),t("code",[e._v("EventServiceProvider.php")]),e._v(", use the "),t("code",[e._v("Event::listen")]),e._v(" method to register your listener. This method takes the event name and a callback function or a class method that will handle the event.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("Event")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("listen")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'lead.create.before'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'Webkul\\Admin\\Listeners\\Leads@linkToEmail'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])]),t("p",[e._v("In the example above, we are listening to the "),t("code",[e._v("lead.create.before")]),e._v(" event and specifying the "),t("code",[e._v("createOrder")]),e._v(" function from the "),t("code",[e._v("Order")]),e._v(" listener class in the "),t("code",[e._v("Webkul\\Notification\\Listeners")]),e._v(" namespace.")]),e._v(" "),t("p",[e._v("Replace "),t("code",[e._v("'lead.create.before'")]),e._v(" with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.")]),e._v(" "),t("p",[e._v("By registering the listener, you have associated the "),t("strong",[t("code",[e._v("createOrder")])]),e._v(" function with the "),t("strong",[t("code",[e._v("lead.create.before")])]),e._v(" event. Whenever this event is triggered, the specified function will be executed.")]),e._v(" "),t("p",[e._v("You can modify the listener function according to your requirements to perform the desired operation.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/61.f5c51a34.js b/assets/js/61.1f35a85e.js similarity index 99% rename from assets/js/61.f5c51a34.js rename to assets/js/61.1f35a85e.js index 7c58a87..a8f4501 100644 --- a/assets/js/61.f5c51a34.js +++ b/assets/js/61.1f35a85e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{356:function(t,e,a){"use strict";a.r(e);var s=a(10),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"helpers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#helpers"}},[t._v("#")]),t._v(" Helpers")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#core-helpers"}},[t._v("Core Helpers")]),e("ul",[e("li",[e("a",{attrs:{href:"#get-the-lists-of-timezone"}},[t._v("Get the lists of timezone")])]),e("li",[e("a",{attrs:{href:"#get-the-list-of-available-locals"}},[t._v("Get the list of available locals")])]),e("li",[e("a",{attrs:{href:"#get-the-list-of-countries"}},[t._v("Get the list of countries")])]),e("li",[e("a",{attrs:{href:"#get-the-country-name"}},[t._v("Get the country name")])]),e("li",[e("a",{attrs:{href:"#get-the-available-states-associated-with-country-code"}},[t._v("Get the available states associated with country code")])]),e("li",[e("a",{attrs:{href:"#get-the-specified-state-name-associated-with-state-code"}},[t._v("Get the specified state name associated with state code")])]),e("li",[e("a",{attrs:{href:"#get-the-grouped-the-states-by-the-countries"}},[t._v("Get the Grouped the states by the countries")])]),e("li",[e("a",{attrs:{href:"#to-sort-the-items"}},[t._v("To Sort the items")])]),e("li",[e("a",{attrs:{href:"#create-singleton-object-through-single-facade"}},[t._v("Create singleton object through single facade")])]),e("li",[e("a",{attrs:{href:"#format-date"}},[t._v("Format Date")])]),e("li",[e("a",{attrs:{href:"#return-currency-symbol-from-currency-code"}},[t._v("Return currency symbol from currency code")])]),e("li",[e("a",{attrs:{href:"#format-base-price"}},[t._v("Format base price")])]),e("li",[e("a",{attrs:{href:"#get-the-config-field"}},[t._v("Get the config field")])]),e("li",[e("a",{attrs:{href:"#get-the-config-data"}},[t._v("Get the config data")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Krayin provides a range of helper methods in its packages to streamline and simplify the development process. These helpers are designed to offer utility functions that facilitate common tasks, reducing the amount of boilerplate code developers need to write and enhancing overall productivity.")]),t._v(" "),e("h2",{attrs:{id:"core-helpers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#core-helpers"}},[t._v("#")]),t._v(" Core Helpers")]),t._v(" "),e("p",[t._v("The core helper methods are part of the Core class in the "),e("code",[t._v("Webkul\\Core")]),t._v(" namespace. These methods provide essential functionality that can be utilized across different parts of the application, making development more efficient and consistent. Let's explore some common methods:")]),t._v(" "),e("h3",{attrs:{id:"get-the-lists-of-timezone"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-lists-of-timezone"}},[t._v("#")]),t._v(" Get the lists of timezone")]),t._v(" "),e("p",[t._v("To retrieve a list of timezones in the CRM, you can use the "),e("code",[t._v("core()->timezones()")]),t._v(" method, which returns the list of timezones.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("timezones")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-list-of-available-locals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-list-of-available-locals"}},[t._v("#")]),t._v(" Get the list of available locals")]),t._v(" "),e("p",[t._v("To retrieve a list of available local in the CRM, you can use the "),e("code",[t._v("core()->locales()")]),t._v(" method, which return the list of available locales")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("locales")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-list-of-countries"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-list-of-countries"}},[t._v("#")]),t._v(" Get the list of countries")]),t._v(" "),e("p",[t._v("To retrieve a list of countries in the CRM, you can use the "),e("code",[t._v("core()->countries()")]),t._v(" method, which returns the list of all countries within the CRM.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("countries")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-country-name"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-country-name"}},[t._v("#")]),t._v(" Get the country name")]),t._v(" "),e("p",[t._v("To retrieve the country name by its country code, you can use the "),e("code",[t._v("core()->country_name($code)")]),t._v(" method, which returns the name of the country associated with the specified country code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("country_name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-available-states-associated-with-country-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-available-states-associated-with-country-code"}},[t._v("#")]),t._v(" Get the available states associated with country code")]),t._v(" "),e("p",[t._v("To retrieve a list of states associated with states in the CRM, you can use the "),e("code",[t._v("core()->states($countryCode)")]),t._v(" method, which returns the all states associated with the country code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("states")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$countryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-specified-state-name-associated-with-state-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-specified-state-name-associated-with-state-code"}},[t._v("#")]),t._v(" Get the specified state name associated with state code")]),t._v(" "),e("p",[t._v("To retrieve the state name by its state code, you can use the "),e("code",[t._v("core()->state_name($code)")]),t._v(" method, which returns the name of the state name associated with the specified state code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("state_name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-grouped-the-states-by-the-countries"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-grouped-the-states-by-the-countries"}},[t._v("#")]),t._v(" Get the Grouped the states by the countries")]),t._v(" "),e("p",[t._v("To retrieve the grouped the states by the countries, you can use the "),e("code",[t._v("core()->findStateByCountryCode($countryCode, $stateCode)")]),t._v(" which takes two argument "),e("code",[t._v("$countryCode")]),t._v(" and "),e("code",[t._v("$stateCode")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findStateByCountryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$countryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$stateCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"to-sort-the-items"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#to-sort-the-items"}},[t._v("#")]),t._v(" To Sort the items")]),t._v(" "),e("p",[t._v("Method to sort through the acl items and put them in order.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sortItems")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$items")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"create-singleton-object-through-single-facade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-singleton-object-through-single-facade"}},[t._v("#")]),t._v(" Create singleton object through single facade")]),t._v(" "),e("p",[t._v("You can use the core method for singleton binding through the core helper methods.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSingletonInstance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$className")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("h3",{attrs:{id:"format-date"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#format-date"}},[t._v("#")]),t._v(" Format Date")]),t._v(" "),e("p",[t._v("You can use "),e("code",[t._v("core()->formatDate($date, $format = 'd M Y h:iA')")]),t._v(" method to format the provided date, you can modify the format date structure by passing second argument.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("formatDate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$date")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$format")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"return-currency-symbol-from-currency-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-currency-symbol-from-currency-code"}},[t._v("#")]),t._v(" Return currency symbol from currency code")]),t._v(" "),e("p",[t._v("To get the symbol of current currency int the crm you can use the method of core helper")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("currencySymbol")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"format-base-price"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#format-base-price"}},[t._v("#")]),t._v(" Format base price")]),t._v(" "),e("p",[t._v("To format the price of provided price you can use the method "),e("code",[t._v("core()->formatBasePrice()")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("formatBasePrice")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$price")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-config-field"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-config-field"}},[t._v("#")]),t._v(" Get the config field")]),t._v(" "),e("p",[t._v("To get the config field you can use the "),e("code",[t._v("core()->getConfigField($fieldName)")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConfigField")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$fieldName")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-config-data"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-config-data"}},[t._v("#")]),t._v(" Get the config data")]),t._v(" "),e("p",[t._v("To retrieve the config data you can use the method "),e("code",[t._v("core()->getConfigData($field)")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConfigData")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$field")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{359:function(t,e,a){"use strict";a.r(e);var s=a(10),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"helpers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#helpers"}},[t._v("#")]),t._v(" Helpers")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#core-helpers"}},[t._v("Core Helpers")]),e("ul",[e("li",[e("a",{attrs:{href:"#get-the-lists-of-timezone"}},[t._v("Get the lists of timezone")])]),e("li",[e("a",{attrs:{href:"#get-the-list-of-available-locals"}},[t._v("Get the list of available locals")])]),e("li",[e("a",{attrs:{href:"#get-the-list-of-countries"}},[t._v("Get the list of countries")])]),e("li",[e("a",{attrs:{href:"#get-the-country-name"}},[t._v("Get the country name")])]),e("li",[e("a",{attrs:{href:"#get-the-available-states-associated-with-country-code"}},[t._v("Get the available states associated with country code")])]),e("li",[e("a",{attrs:{href:"#get-the-specified-state-name-associated-with-state-code"}},[t._v("Get the specified state name associated with state code")])]),e("li",[e("a",{attrs:{href:"#get-the-grouped-the-states-by-the-countries"}},[t._v("Get the Grouped the states by the countries")])]),e("li",[e("a",{attrs:{href:"#to-sort-the-items"}},[t._v("To Sort the items")])]),e("li",[e("a",{attrs:{href:"#create-singleton-object-through-single-facade"}},[t._v("Create singleton object through single facade")])]),e("li",[e("a",{attrs:{href:"#format-date"}},[t._v("Format Date")])]),e("li",[e("a",{attrs:{href:"#return-currency-symbol-from-currency-code"}},[t._v("Return currency symbol from currency code")])]),e("li",[e("a",{attrs:{href:"#format-base-price"}},[t._v("Format base price")])]),e("li",[e("a",{attrs:{href:"#get-the-config-field"}},[t._v("Get the config field")])]),e("li",[e("a",{attrs:{href:"#get-the-config-data"}},[t._v("Get the config data")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Krayin provides a range of helper methods in its packages to streamline and simplify the development process. These helpers are designed to offer utility functions that facilitate common tasks, reducing the amount of boilerplate code developers need to write and enhancing overall productivity.")]),t._v(" "),e("h2",{attrs:{id:"core-helpers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#core-helpers"}},[t._v("#")]),t._v(" Core Helpers")]),t._v(" "),e("p",[t._v("The core helper methods are part of the Core class in the "),e("code",[t._v("Webkul\\Core")]),t._v(" namespace. These methods provide essential functionality that can be utilized across different parts of the application, making development more efficient and consistent. Let's explore some common methods:")]),t._v(" "),e("h3",{attrs:{id:"get-the-lists-of-timezone"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-lists-of-timezone"}},[t._v("#")]),t._v(" Get the lists of timezone")]),t._v(" "),e("p",[t._v("To retrieve a list of timezones in the CRM, you can use the "),e("code",[t._v("core()->timezones()")]),t._v(" method, which returns the list of timezones.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("timezones")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-list-of-available-locals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-list-of-available-locals"}},[t._v("#")]),t._v(" Get the list of available locals")]),t._v(" "),e("p",[t._v("To retrieve a list of available local in the CRM, you can use the "),e("code",[t._v("core()->locales()")]),t._v(" method, which return the list of available locales")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("locales")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-list-of-countries"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-list-of-countries"}},[t._v("#")]),t._v(" Get the list of countries")]),t._v(" "),e("p",[t._v("To retrieve a list of countries in the CRM, you can use the "),e("code",[t._v("core()->countries()")]),t._v(" method, which returns the list of all countries within the CRM.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("countries")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-country-name"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-country-name"}},[t._v("#")]),t._v(" Get the country name")]),t._v(" "),e("p",[t._v("To retrieve the country name by its country code, you can use the "),e("code",[t._v("core()->country_name($code)")]),t._v(" method, which returns the name of the country associated with the specified country code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("country_name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-available-states-associated-with-country-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-available-states-associated-with-country-code"}},[t._v("#")]),t._v(" Get the available states associated with country code")]),t._v(" "),e("p",[t._v("To retrieve a list of states associated with states in the CRM, you can use the "),e("code",[t._v("core()->states($countryCode)")]),t._v(" method, which returns the all states associated with the country code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("states")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$countryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-specified-state-name-associated-with-state-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-specified-state-name-associated-with-state-code"}},[t._v("#")]),t._v(" Get the specified state name associated with state code")]),t._v(" "),e("p",[t._v("To retrieve the state name by its state code, you can use the "),e("code",[t._v("core()->state_name($code)")]),t._v(" method, which returns the name of the state name associated with the specified state code.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("state_name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-grouped-the-states-by-the-countries"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-grouped-the-states-by-the-countries"}},[t._v("#")]),t._v(" Get the Grouped the states by the countries")]),t._v(" "),e("p",[t._v("To retrieve the grouped the states by the countries, you can use the "),e("code",[t._v("core()->findStateByCountryCode($countryCode, $stateCode)")]),t._v(" which takes two argument "),e("code",[t._v("$countryCode")]),t._v(" and "),e("code",[t._v("$stateCode")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("findStateByCountryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$countryCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$stateCode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"to-sort-the-items"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#to-sort-the-items"}},[t._v("#")]),t._v(" To Sort the items")]),t._v(" "),e("p",[t._v("Method to sort through the acl items and put them in order.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sortItems")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$items")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"create-singleton-object-through-single-facade"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-singleton-object-through-single-facade"}},[t._v("#")]),t._v(" Create singleton object through single facade")]),t._v(" "),e("p",[t._v("You can use the core method for singleton binding through the core helper methods.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSingletonInstance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$className")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("h3",{attrs:{id:"format-date"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#format-date"}},[t._v("#")]),t._v(" Format Date")]),t._v(" "),e("p",[t._v("You can use "),e("code",[t._v("core()->formatDate($date, $format = 'd M Y h:iA')")]),t._v(" method to format the provided date, you can modify the format date structure by passing second argument.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("formatDate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$date")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$format")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"return-currency-symbol-from-currency-code"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-currency-symbol-from-currency-code"}},[t._v("#")]),t._v(" Return currency symbol from currency code")]),t._v(" "),e("p",[t._v("To get the symbol of current currency int the crm you can use the method of core helper")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("currencySymbol")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"format-base-price"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#format-base-price"}},[t._v("#")]),t._v(" Format base price")]),t._v(" "),e("p",[t._v("To format the price of provided price you can use the method "),e("code",[t._v("core()->formatBasePrice()")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("formatBasePrice")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$price")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-config-field"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-config-field"}},[t._v("#")]),t._v(" Get the config field")]),t._v(" "),e("p",[t._v("To get the config field you can use the "),e("code",[t._v("core()->getConfigField($fieldName)")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConfigField")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$fieldName")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"get-the-config-data"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-config-data"}},[t._v("#")]),t._v(" Get the config data")]),t._v(" "),e("p",[t._v("To retrieve the config data you can use the method "),e("code",[t._v("core()->getConfigData($field)")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("core")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConfigData")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$field")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/62.95404c2c.js b/assets/js/62.b74fca29.js similarity index 99% rename from assets/js/62.95404c2c.js rename to assets/js/62.b74fca29.js index 634af50..be68170 100644 --- a/assets/js/62.95404c2c.js +++ b/assets/js/62.b74fca29.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{359:function(t,e,a){"use strict";a.r(e);var s=a(10),r=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"override-core-model"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#override-core-model"}},[t._v("#")]),t._v(" Override Core Model")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#overriding-a-model-class"}},[t._v("Overriding a Model Class")]),e("ul",[e("li",[e("a",{attrs:{href:"#define-an-interface-contract"}},[t._v("Define an Interface (Contract)")])]),e("li",[e("a",{attrs:{href:"#register-the-model-override"}},[t._v("Register the Model Override")])]),e("li",[e("a",{attrs:{href:"#implement-the-custom-model-class"}},[t._v("Implement the Custom Model Class")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Krayin utilizes Concord, a Laravel extension, for building modules on top of Laravel's built-in service providers. Concord introduces the concept of model proxies, which allow you to override and extend core models in a modular way.")]),t._v(" "),e("p",[t._v("Concord requires the existence of an interface, such as "),e("code",[t._v("Product")]),t._v(", which serves as a contract that can be bound to a concrete class using Concord's "),e("code",[t._v("registerModel()")]),t._v(" method.")]),t._v(" "),e("p",[t._v("By default, the "),e("code",[t._v("Models\\Product")]),t._v(" class is bound to the "),e("code",[t._v("Contracts\\Product")]),t._v(" interface within the module. If you want to extend or override this class, you can use Concord's "),e("code",[t._v("registerModel()")]),t._v(" method.")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("registerModel()")]),t._v(" method handles the binding of the interface and implementation in Laravel's service container, enabling you to easily type-hint the interface for automatic injection.")]),t._v(" "),e("p",[t._v("For more details, you can visit the "),e("a",{attrs:{href:"https://github.com/artkonekt/concord",target:"_blank",rel:"noopener noreferrer"}},[t._v("Concord GitHub repository"),e("OutboundLink")],1),t._v(" or refer to the "),e("a",{attrs:{href:"https://artkonekt.github.io/concord/#/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Concord documentation"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"overriding-a-model-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#overriding-a-model-class"}},[t._v("#")]),t._v(" Overriding a Model Class")]),t._v(" "),e("p",[t._v("To override a core model in Krayin using Concord, follow these steps:")]),t._v(" "),e("h3",{attrs:{id:"define-an-interface-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-an-interface-contract"}},[t._v("#")]),t._v(" Define an Interface (Contract)")]),t._v(" "),e("p",[t._v("In Krayin's modular structure, each Eloquent model typically corresponds to an interface. This interface acts as a contract that specifies the methods the model must implement.")]),t._v(" "),e("h3",{attrs:{id:"register-the-model-override"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#register-the-model-override"}},[t._v("#")]),t._v(" Register the Model Override")]),t._v(" "),e("p",[t._v("Use Concord's registerModel() method in your module's service provider (ServiceProvider) to bind your custom model implementation to the interface. Here’s how you can do it:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("app")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("concord")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("registerModel")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ProductContract")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("ul",[e("li",[t._v("Replace "),e("code",[t._v("Webkul\\Product\\Contracts\\Product as ProductContract")]),t._v(" with the interface you wish to override.")]),t._v(" "),e("li",[t._v("Replace "),e("code",[t._v("Webkul\\Category\\Models\\Product")]),t._v(" with the path to your custom model class that extends the core model you are overriding.")])]),t._v(" "),e("h3",{attrs:{id:"implement-the-custom-model-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implement-the-custom-model-class"}},[t._v("#")]),t._v(" Implement the Custom Model Class")]),t._v(" "),e("p",[t._v("Your custom model class (Product in this example) should extend the base core model ("),e("code",[t._v("ProductBaseModel")]),t._v("), ensuring it adheres to the contract specified by the interface. Here’s an example:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("app")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("concord")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("registerModel")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ProductContract")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("ul",[e("li",[t._v("Replace "),e("code",[t._v("Webkul\\Product\\Contracts\\Product as ProductContract")]),t._v(" with the interface you wish to override.")]),t._v(" "),e("li",[t._v("Replace "),e("code",[t._v("Webkul\\Category\\Models\\Product")]),t._v(" with the path to your custom model class that extends the core model you are overriding.")])]),t._v(" "),e("h3",{attrs:{id:"implement-the-custom-model-class"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implement-the-custom-model-class"}},[t._v("#")]),t._v(" Implement the Custom Model Class")]),t._v(" "),e("p",[t._v("Your custom model class (Product in this example) should extend the base core model ("),e("code",[t._v("ProductBaseModel")]),t._v("), ensuring it adheres to the contract specified by the interface. Here’s an example:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/before_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Event")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("listen")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.contacts.persons.create.header.after'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/after_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("p",[t._v("Replace "),e("code",[t._v("'path/to/before_content_template.blade.php'")]),t._v(" and "),e("code",[t._v("'path/to/after_content_template.blade.php'")]),t._v(" with the actual paths to the Blade template files you want to inject.")]),t._v(" "),e("div",{staticClass:"custom-block warning"},[e("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),e("p",[t._v("Make sure that you have registered the "),e("strong",[e("code",[t._v("EventServiceProvider")])]),t._v(" in your own service provider.")])]),t._v(" "),e("h3",{attrs:{id:"implementation-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[t._v("#")]),t._v(" Implementation Details")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("$viewRenderEventManager->addTemplate()")]),t._v(": This method adds the specified template file to the rendering queue for the corresponding event. When the event is triggered during template rendering, Krayin will include the specified template's content at the designated injection point.")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Event Handling")]),t._v(": Ensure that you properly handle the events within your application’s event flow. This involves registering listeners correctly in EventServiceProvider and ensuring that the templates being injected are structured and formatted according to your application's requirements.")])])]),t._v(" "),e("h3",{attrs:{id:"considerations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#considerations"}},[t._v("#")]),t._v(" Considerations")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("Integration")]),t._v(": Integrate this functionality carefully into your Krayin application to maintain coherence and readability of your codebase")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Customization")]),t._v(": Customize event names ("),e("code",[t._v("'admin.contacts.persons.create.header.before'")]),t._v(", "),e("code",[t._v("'admin.contacts.persons.create.header.after'")]),t._v(") and template paths according to your specific application needs and structure.")])])]),t._v(" "),e("p",[t._v("By following these steps, you can effectively leverage the "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{364:function(t,e,n){"use strict";n.r(e);var a=n(10),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"view-render-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#view-render-event"}},[t._v("#")]),t._v(" View Render Event")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#render-view"}},[t._v("Render View")]),e("ul",[e("li",[e("a",{attrs:{href:"#listening-to-events"}},[t._v("Listening to Events")])]),e("li",[e("a",{attrs:{href:"#implementation-details"}},[t._v("Implementation Details")])]),e("li",[e("a",{attrs:{href:"#considerations"}},[t._v("Considerations")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin allows developers to inject content dynamically before or after the main content of a template. This functionality is useful for modifying template output without directly altering the template file itself, enhancing flexibility and maintainability in your application.")]),t._v(" "),e("h2",{attrs:{id:"render-view"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#render-view"}},[t._v("#")]),t._v(" Render View")]),t._v(" "),e("p",[t._v("To utilize the "),e("code",[t._v("view_render_event()")]),t._v(" function effectively, follow these steps:")]),t._v(" "),e("p",[t._v("In this example "),e("code",[t._v("admin.contacts.persons.create.header.before")]),t._v(" and "),e("code",[t._v("admin.contacts.persons.create.header.after")]),t._v(" are custom event names that denote where content should be injected before and after the page-header section, respectively inside the "),e("code",[t._v("packages/Webkul/Admin/src/Resources/views/contacts/persons/create.blade.php")]),t._v(" fie")]),t._v(" "),e("h3",{attrs:{id:"listening-to-events"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#listening-to-events"}},[t._v("#")]),t._v(" Listening to Events")]),t._v(" "),e("p",[t._v("To handle these events and inject content dynamically, you need to listen to them in your application’s event system (typically in the "),e("code",[t._v("EventServiceProvider")]),t._v(").")]),t._v(" "),e("p",[t._v("Open your "),e("code",[t._v("EventServiceProvider.php")]),t._v(" file located in "),e("code",[t._v("app/Providers")]),t._v(" or similar directory.")]),t._v(" "),e("p",[t._v("In the "),e("code",[t._v("boot()")]),t._v(" method of your "),e("code",[t._v("EventServiceProvider")]),t._v(", add event listeners as follows:")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/before_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Event")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("listen")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.contacts.persons.create.header.after'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$viewRenderEventManager")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("addTemplate")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'path/to/after_content_template.blade.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("p",[t._v("Replace "),e("code",[t._v("'path/to/before_content_template.blade.php'")]),t._v(" and "),e("code",[t._v("'path/to/after_content_template.blade.php'")]),t._v(" with the actual paths to the Blade template files you want to inject.")]),t._v(" "),e("div",{staticClass:"custom-block warning"},[e("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),e("p",[t._v("Make sure that you have registered the "),e("strong",[e("code",[t._v("EventServiceProvider")])]),t._v(" in your own service provider.")])]),t._v(" "),e("h3",{attrs:{id:"implementation-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[t._v("#")]),t._v(" Implementation Details")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("$viewRenderEventManager->addTemplate()")]),t._v(": This method adds the specified template file to the rendering queue for the corresponding event. When the event is triggered during template rendering, Krayin will include the specified template's content at the designated injection point.")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Event Handling")]),t._v(": Ensure that you properly handle the events within your application’s event flow. This involves registering listeners correctly in EventServiceProvider and ensuring that the templates being injected are structured and formatted according to your application's requirements.")])])]),t._v(" "),e("h3",{attrs:{id:"considerations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#considerations"}},[t._v("#")]),t._v(" Considerations")]),t._v(" "),e("ul",[e("li",[e("p",[e("code",[t._v("Integration")]),t._v(": Integrate this functionality carefully into your Krayin application to maintain coherence and readability of your codebase")])]),t._v(" "),e("li",[e("p",[e("code",[t._v("Customization")]),t._v(": Customize event names ("),e("code",[t._v("'admin.contacts.persons.create.header.before'")]),t._v(", "),e("code",[t._v("'admin.contacts.persons.create.header.after'")]),t._v(") and template paths according to your specific application needs and structure.")])])]),t._v(" "),e("p",[t._v("By following these steps, you can effectively leverage the "),e("code",[t._v("view_render_event()")]),t._v(" function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/64.125f82aa.js b/assets/js/64.718ed29b.js similarity index 97% rename from assets/js/64.125f82aa.js rename to assets/js/64.718ed29b.js index 46a20e4..0d4d3fa 100644 --- a/assets/js/64.125f82aa.js +++ b/assets/js/64.718ed29b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[64],{362:function(e,a,t){"use strict";t.r(a);var n=t(10),i=Object(n.a)({},(function(){var e=this,a=e._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"krayin-apis"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#krayin-apis"}},[e._v("#")]),e._v(" Krayin APIs")]),e._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#rest-api"}},[e._v("REST API")])])])]),a("p"),e._v(" "),a("h2",{attrs:{id:"rest-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rest-api"}},[e._v("#")]),e._v(" REST API")]),e._v(" "),a("p",[e._v("The Krayin REST API enables seamless integration and interaction with the Krayin CRM system. It follows the REST (Representational State Transfer) architecture, providing a robust set of endpoints for managing CRM-related data.")]),e._v(" "),a("p",[e._v("Key Features")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("CRUD Operations: The API supports all basic CRUD (Create, Read, Update, Delete) operations, allowing for comprehensive management of CRM data including customers, leads, contacts, and more.")])]),e._v(" "),a("li",[a("p",[e._v("Pagination: To enhance performance and manage large datasets efficiently, the API includes support for pagination. This helps in retrieving data in chunks rather than loading large volumes of data at once.")])])]),e._v(" "),a("p",[e._v("Integration Capabilities: The REST API is designed to integrate seamlessly with various external systems and applications, including:")]),e._v(" "),a("ul",[a("li",[e._v("PWA (Progressive Web Applications): Use the API to develop PWAs that interact with the CRM, offering a modern, app-like experience on the web.\nMobile Applications: Integrate with mobile apps to enable functionalities such as customer management, lead tracking, and reporting directly from the mobile interface.\nData Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.")])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[64],{360:function(e,a,t){"use strict";t.r(a);var n=t(10),i=Object(n.a)({},(function(){var e=this,a=e._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"krayin-apis"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#krayin-apis"}},[e._v("#")]),e._v(" Krayin APIs")]),e._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#rest-api"}},[e._v("REST API")])])])]),a("p"),e._v(" "),a("h2",{attrs:{id:"rest-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rest-api"}},[e._v("#")]),e._v(" REST API")]),e._v(" "),a("p",[e._v("The Krayin REST API enables seamless integration and interaction with the Krayin CRM system. It follows the REST (Representational State Transfer) architecture, providing a robust set of endpoints for managing CRM-related data.")]),e._v(" "),a("p",[e._v("Key Features")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("CRUD Operations: The API supports all basic CRUD (Create, Read, Update, Delete) operations, allowing for comprehensive management of CRM data including customers, leads, contacts, and more.")])]),e._v(" "),a("li",[a("p",[e._v("Pagination: To enhance performance and manage large datasets efficiently, the API includes support for pagination. This helps in retrieving data in chunks rather than loading large volumes of data at once.")])])]),e._v(" "),a("p",[e._v("Integration Capabilities: The REST API is designed to integrate seamlessly with various external systems and applications, including:")]),e._v(" "),a("ul",[a("li",[e._v("PWA (Progressive Web Applications): Use the API to develop PWAs that interact with the CRM, offering a modern, app-like experience on the web.\nMobile Applications: Integrate with mobile apps to enable functionalities such as customer management, lead tracking, and reporting directly from the mobile interface.\nData Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.")])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/65.87bd1508.js b/assets/js/65.b66a97a3.js similarity index 98% rename from assets/js/65.87bd1508.js rename to assets/js/65.b66a97a3.js index 9c69548..dfe2515 100644 --- a/assets/js/65.87bd1508.js +++ b/assets/js/65.b66a97a3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{364:function(a,t,e){"use strict";e.r(t);var s=e(10),n=Object(s.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"krayin-apis"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#krayin-apis"}},[a._v("#")]),a._v(" Krayin APIs")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#rest-api"}},[a._v("REST API")])]),t("li",[t("a",{attrs:{href:"#explore-rest-api-demo"}},[a._v("Explore REST API Demo")])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"rest-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rest-api"}},[a._v("#")]),a._v(" REST API")]),a._v(" "),t("p",[a._v("Krayin REST API is a medium to use the features of the core Krayin System. By using Krayin REST API, you can integrate your application to serve the default content of Krayin.")]),a._v(" "),t("h2",{attrs:{id:"explore-rest-api-demo"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explore-rest-api-demo"}},[a._v("#")]),a._v(" Explore REST API Demo")]),a._v(" "),t("p",[a._v("Welcome to our API demo! Dive into the interactive showcase of our API functionalities to get a hands-on experience of how our platform works. Click the Link below to access the demo:")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://apidoc.krayincrm.com/api/documentation",target:"_blank",rel:"noopener noreferrer"}},[a._v("Access API Demo"),t("OutboundLink")],1)]),a._v(" "),t("h4",{attrs:{id:"click-the-link-below-to-access-admin-api-documentation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#click-the-link-below-to-access-admin-api-documentation"}},[a._v("#")]),a._v(" Click the Link below to access Admin API documentation")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://apidoc.krayincrm.com/admin/login",target:"_blank",rel:"noopener noreferrer"}},[a._v("Admin"),t("OutboundLink")],1)]),a._v(" "),t("h4",{attrs:{id:"installation-of-rest-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installation-of-rest-api"}},[a._v("#")]),a._v(" Installation of REST API")]),a._v(" "),t("p",[a._v("To install Krayin REST API, you need to follow some steps.")]),a._v(" "),t("ul",[t("li",[a._v("To install Krayin REST API from your console:")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("composer require krayin/rest-api\n")])])]),t("ul",[t("li",[a._v("Add below options in the .env file (i.e. http://localhost/public your domain):")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("SANCTUM_STATEFUL_DOMAINS=http://localhost/public\n")])])]),t("ul",[t("li",[a._v("To configure the REST API L5-Swagger Documentation run below command:")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("php artisan krayin-rest-api:install\n")])])]),t("ul",[t("li",[a._v("To check the Admin end API documentation:")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("http://localhost/public/api/admin/documentation\n")])])]),t("ul",[t("li",[a._v("You can check the "),t("a",{attrs:{href:"https://github.com/DarkaOnLine/L5-Swagger"}},[a._v(" L5-Swagger ")]),a._v(" guidelines too regarding the configuration the API documentation.")])]),a._v(" "),t("ul",[t("li",[a._v("For admin login, add Laravel Sanctum's API token to the Admin model follow the given path.")])]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("packages/Webkul/User/src/Models/Admin.php\n")])])]),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'repository'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Webkul\\Category\\Repositories\\CategoryRepository'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])])]),s("ol",{attrs:{start:"3"}},[s("li",[t._v("Register the Configuration File:")])]),t._v(" "),s("p",[t._v("In the CategoryServiceProvider, register the configuration file inside the register method of the provider.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register services.\n *\n * @return void\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("register")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeConfigFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/Config/attribute_entity_types.php'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'attribute_entity_types'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Now you can use the "),s("code",[t._v("CustomAttribute")]),t._v(" traits, which allows any model to be customized with attributes.")]),t._v(" "),s("p",[t._v("Example Are Give below.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("For Example.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Create the new Resource.\n * \n * @param array $data\n * @return \\Webkul\\Product\\Contracts\\Product\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("array")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword static-context"}},[t._v("parent")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Update the new existing Resource.\n * \n * @param array $data\n * @param int $id\n * @param string $attribute\n * @return \\Webkul\\Product\\Contracts\\Product\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("update")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("array")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword static-context"}},[t._v("parent")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("update")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{371:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"use-model-with-custom-attributes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#use-model-with-custom-attributes"}},[t._v("#")]),t._v(" Use model with custom Attributes")]),t._v(" "),s("p",[t._v("Before using the CustomAttribute trait, you need to set it up.")]),t._v(" "),s("ol",[s("li",[t._v("Create a configuration file inside the Category package's Config directory named attribute_entity_types.php.")]),t._v(" "),s("li",[t._v("Add the following code snippet to the configuration file:")])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'repository'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Webkul\\Category\\Repositories\\CategoryRepository'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])])]),s("ol",{attrs:{start:"3"}},[s("li",[t._v("Register the Configuration File:")])]),t._v(" "),s("p",[t._v("In the CategoryServiceProvider, register the configuration file inside the register method of the provider.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register services.\n *\n * @return void\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("register")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeConfigFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/Config/attribute_entity_types.php'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'attribute_entity_types'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Now you can use the "),s("code",[t._v("CustomAttribute")]),t._v(" traits, which allows any model to be customized with attributes.")]),t._v(" "),s("p",[t._v("Example Are Give below.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("For Example.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Create the new Resource.\n * \n * @param array $data\n * @return \\Webkul\\Product\\Contracts\\Product\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("array")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword static-context"}},[t._v("parent")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Update the new existing Resource.\n * \n * @param array $data\n * @param int $id\n * @param string $attribute\n * @return \\Webkul\\Product\\Contracts\\Product\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("update")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("array")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$attribute")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword static-context"}},[t._v("parent")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("update")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("attributeValueRepository")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("save")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$product")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/73.f8bfbb5f.js b/assets/js/73.b5e98758.js similarity index 98% rename from assets/js/73.f8bfbb5f.js rename to assets/js/73.b5e98758.js index 7a9f5c1..915f28f 100644 --- a/assets/js/73.f8bfbb5f.js +++ b/assets/js/73.b5e98758.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{371:function(t,e,i){"use strict";i.r(e);var a=i(10),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"create-and-using-a-new-attribute"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-and-using-a-new-attribute"}},[t._v("#")]),t._v(" Create and using a new attribute")]),t._v(" "),e("p",[t._v("Krayin CRM is a highly customizable, attribute-based CRM system that allows you to manage various entities such as leads, quotes, contacts, and more through the use of attributes. This flexibility enables you to tailor the system to meet your specific business needs.")]),t._v(" "),e("ul",[e("li",[t._v("Creating Attributes")])]),t._v(" "),e("p",[t._v("To create an attribute in Krayin, follow these steps:")]),t._v(" "),e("ol",[e("li",[e("p",[e("strong",[t._v("Navigate to the Settings")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("In the main dashboard, go to "),e("code",[t._v("Settings")]),t._v(" in the sidebar menu.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Go to Attributes Section")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("Under the "),e("code",[t._v("Settings")]),t._v(" menu, select "),e("code",[t._v("Attributes")]),t._v(" to manage existing attributes or create new ones.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Create a New Attribute")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("Click on the "),e("code",[t._v("Create Attribute")]),t._v(" button.")]),t._v(" "),e("li",[t._v("Fill out the form with the necessary details, such as the name, code, and type of the attribute.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Entity Type")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("One of the key fields in the attribute creation form is the "),e("code",[t._v("Entity Type")]),t._v(". The "),e("code",[t._v("Entity Type")]),t._v(" determines where the attribute will be applied in the system. The available entity types include:\n"),e("ol",[e("li",[e("strong",[t._v("Leads")]),t._v(": Attributes created under this entity type will be associated with the "),e("code",[t._v("Leads")]),t._v(" module.")]),t._v(" "),e("li",[e("strong",[t._v("Person")]),t._v(": Use this entity type to create attributes for the "),e("code",[t._v("Person")]),t._v(" module, allowing you to manage individual contacts.")]),t._v(" "),e("li",[e("strong",[t._v("Organization")]),t._v(": Attributes for managing organizations and companies can be created under this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Products")]),t._v(": Attributes associated with products can be managed under this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Quotes")]),t._v(": If you want to manage quotes with specific attributes, select this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Warehouses")]),t._v(": This entity type is for managing warehouses and their specific attributes.")])])])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Save the Attribute")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("After filling in all the required fields, click "),e("code",[t._v("Save")]),t._v(". The attribute will now be available for the selected entity type.")])])])]),t._v(" "),e("ul",[e("li",[t._v("Using Attributes")])]),t._v(" "),e("p",[t._v("Once you have created an attribute, it will appear in the respective module based on the entity type you selected during creation. For example:")]),t._v(" "),e("ul",[e("li",[t._v("If you created an attribute for "),e("code",[t._v("Leads")]),t._v(", it will be available when managing or viewing leads.")]),t._v(" "),e("li",[t._v("Similarly, attributes for "),e("code",[t._v("Person")]),t._v(", "),e("code",[t._v("Organization")]),t._v(", "),e("code",[t._v("Products")]),t._v(", "),e("code",[t._v("Quotes")]),t._v(", and "),e("code",[t._v("Warehouses")]),t._v(" will be accessible within their corresponding entity type")])]),t._v(" "),e("p",[t._v("These attributes allow you to add custom fields, data types, and other specific requirements to the respective entities, making Krayin a powerful and flexible CRM solution for your business.")]),t._v(" "),e("ul",[e("li",[t._v("Summary")])]),t._v(" "),e("p",[t._v("Krayin’s attribute system provides extensive customization options, making it easy to manage various CRM entities according to your unique requirements. By selecting the appropriate "),e("code",[t._v("Entity Type")]),t._v(" when creating an attribute, you ensure that the attribute is applied to the correct module within the CRM. This approach allows you to build a CRM system tailored to your business needs, with custom fields and data management options for leads, quotes, contacts, and more.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{370:function(t,e,i){"use strict";i.r(e);var a=i(10),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"create-and-using-a-new-attribute"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-and-using-a-new-attribute"}},[t._v("#")]),t._v(" Create and using a new attribute")]),t._v(" "),e("p",[t._v("Krayin CRM is a highly customizable, attribute-based CRM system that allows you to manage various entities such as leads, quotes, contacts, and more through the use of attributes. This flexibility enables you to tailor the system to meet your specific business needs.")]),t._v(" "),e("ul",[e("li",[t._v("Creating Attributes")])]),t._v(" "),e("p",[t._v("To create an attribute in Krayin, follow these steps:")]),t._v(" "),e("ol",[e("li",[e("p",[e("strong",[t._v("Navigate to the Settings")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("In the main dashboard, go to "),e("code",[t._v("Settings")]),t._v(" in the sidebar menu.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Go to Attributes Section")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("Under the "),e("code",[t._v("Settings")]),t._v(" menu, select "),e("code",[t._v("Attributes")]),t._v(" to manage existing attributes or create new ones.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Create a New Attribute")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("Click on the "),e("code",[t._v("Create Attribute")]),t._v(" button.")]),t._v(" "),e("li",[t._v("Fill out the form with the necessary details, such as the name, code, and type of the attribute.")])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Entity Type")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("One of the key fields in the attribute creation form is the "),e("code",[t._v("Entity Type")]),t._v(". The "),e("code",[t._v("Entity Type")]),t._v(" determines where the attribute will be applied in the system. The available entity types include:\n"),e("ol",[e("li",[e("strong",[t._v("Leads")]),t._v(": Attributes created under this entity type will be associated with the "),e("code",[t._v("Leads")]),t._v(" module.")]),t._v(" "),e("li",[e("strong",[t._v("Person")]),t._v(": Use this entity type to create attributes for the "),e("code",[t._v("Person")]),t._v(" module, allowing you to manage individual contacts.")]),t._v(" "),e("li",[e("strong",[t._v("Organization")]),t._v(": Attributes for managing organizations and companies can be created under this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Products")]),t._v(": Attributes associated with products can be managed under this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Quotes")]),t._v(": If you want to manage quotes with specific attributes, select this entity type.")]),t._v(" "),e("li",[e("strong",[t._v("Warehouses")]),t._v(": This entity type is for managing warehouses and their specific attributes.")])])])])]),t._v(" "),e("li",[e("p",[e("strong",[t._v("Save the Attribute")]),t._v(":")]),t._v(" "),e("ul",[e("li",[t._v("After filling in all the required fields, click "),e("code",[t._v("Save")]),t._v(". The attribute will now be available for the selected entity type.")])])])]),t._v(" "),e("ul",[e("li",[t._v("Using Attributes")])]),t._v(" "),e("p",[t._v("Once you have created an attribute, it will appear in the respective module based on the entity type you selected during creation. For example:")]),t._v(" "),e("ul",[e("li",[t._v("If you created an attribute for "),e("code",[t._v("Leads")]),t._v(", it will be available when managing or viewing leads.")]),t._v(" "),e("li",[t._v("Similarly, attributes for "),e("code",[t._v("Person")]),t._v(", "),e("code",[t._v("Organization")]),t._v(", "),e("code",[t._v("Products")]),t._v(", "),e("code",[t._v("Quotes")]),t._v(", and "),e("code",[t._v("Warehouses")]),t._v(" will be accessible within their corresponding entity type")])]),t._v(" "),e("p",[t._v("These attributes allow you to add custom fields, data types, and other specific requirements to the respective entities, making Krayin a powerful and flexible CRM solution for your business.")]),t._v(" "),e("ul",[e("li",[t._v("Summary")])]),t._v(" "),e("p",[t._v("Krayin’s attribute system provides extensive customization options, making it easy to manage various CRM entities according to your unique requirements. By selecting the appropriate "),e("code",[t._v("Entity Type")]),t._v(" when creating an attribute, you ensure that the attribute is applied to the correct module within the CRM. This approach allows you to build a CRM system tailored to your business needs, with custom fields and data management options for leads, quotes, contacts, and more.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/75.6cea3a14.js b/assets/js/75.c829b61b.js similarity index 99% rename from assets/js/75.6cea3a14.js rename to assets/js/75.c829b61b.js index f635fe2..f8bd8e4 100644 --- a/assets/js/75.6cea3a14.js +++ b/assets/js/75.c829b61b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{373:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"docker"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker"}},[t._v("#")]),t._v(" Docker")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")]),a("ul",[a("li",[a("a",{attrs:{href:"#docker-setup-for-krayin"}},[t._v("Docker Setup for Krayin")])]),a("li",[a("a",{attrs:{href:"#_1-using-krayin-docker-image-from-docker-hub"}},[t._v("1. Using Krayin Docker Image from Docker Hub")])]),a("li",[a("a",{attrs:{href:"#_2-using-krayin-github-docker-repository"}},[t._v("2. Using Krayin GitHub Docker Repository")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.docker.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker"),a("OutboundLink")],1),t._v(" is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. Docker can also be used for defining and running multi-container Docker applications using the Docker Compose tool.")]),t._v(" "),a("p",[t._v("With the help of Docker Compose, you can define containers to be built, their configuration, links, volumes, ports, etc., in a single file, and it gets launched by a single command. You can also add multiple servers and services just by adding them to the Docker Compose configuration file. This configuration file is in "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/YAML",target:"_blank",rel:"noopener noreferrer"}},[t._v("YAML"),a("OutboundLink")],1),t._v(" format.")]),t._v(" "),a("h4",{attrs:{id:"application-data-and-database-volume-persistence"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#application-data-and-database-volume-persistence"}},[t._v("#")]),t._v(" Application Data and Database Volume Persistence")]),t._v(" "),a("p",[t._v("It is recommended to keep your application files and database data volume on the Docker host and mount them on the running container. This ensures that the application and database data persistence even in the case of containers' failure or termination. In this way, even if you destroy containers, your data won't get lost unless you remove them forcefully.\nThis compose configuration file mounts the application directory "),a("strong",[a("code",[t._v("app")])]),t._v(" and database volume "),a("strong",[a("code",[t._v("dbvolume")])]),t._v(" from the host to running Docker containers at the time of containers' launch.")]),t._v(" "),a("h3",{attrs:{id:"docker-setup-for-krayin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker-setup-for-krayin"}},[t._v("#")]),t._v(" Docker Setup for Krayin")]),t._v(" "),a("p",[t._v("You can configure Krayin using Docker in two different ways:")]),t._v(" "),a("ol",[a("li",[a("strong",[t._v("Using Krayin Docker Image from Docker Hub")])]),t._v(" "),a("li",[a("strong",[t._v("Using Krayin GitHub Docker Repository")])])]),t._v(" "),a("p",[t._v("Both approaches allow you to set up the application quickly, managing all system requirements like Apache, MySQL, and PHPMyAdmin within isolated containers. Below is a detailed guide for each method.")]),t._v(" "),a("h3",{attrs:{id:"_1-using-krayin-docker-image-from-docker-hub"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-using-krayin-docker-image-from-docker-hub"}},[t._v("#")]),t._v(" 1. "),a("strong",[t._v("Using Krayin Docker Image from Docker Hub")])]),t._v(" "),a("p",[t._v("Follow the steps below to set up Krayin using Docker Hub. This approach provides a pre-configured Docker image of Krayin, allowing for a quick and easy installation.")]),t._v(" "),a("h4",{attrs:{id:"step-1-pull-krayin-docker-image"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-1-pull-krayin-docker-image"}},[t._v("#")]),t._v(" Step 1: Pull Krayin Docker Image")]),t._v(" "),a("p",[t._v("To pull the Krayin Docker image from Docker Hub, use the following command:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" pull webkul/krayin:2.0.1\n")])])]),a("h4",{attrs:{id:"step-2-run-a-new-container"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-2-run-a-new-container"}},[t._v("#")]),t._v(" Step 2: Run a New Container")]),t._v(" "),a("p",[t._v("Once the image is pulled, you can run a new Docker container using the command below. This will bind your local port 80 to the container’s port 80, so Krayin can be accessed via the browser.")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-it")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-d")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-p")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),t._v(":80 webkul/krayin:2.0.1\n")])])]),a("blockquote",[a("p",[a("strong",[t._v("Note:")]),t._v("\nIf port 80 is already in use, you can try using a different port. For example, you can map port 8082 on your local machine to port 80 in the container by running the following command:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-it")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-d")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-p")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8082")]),t._v(":80 webkul/krayin:2.0.1\n")])])]),a("p",[t._v("After this, you can access the application at "),a("code",[t._v("http://localhost:8082/")]),t._v(" instead of "),a("code",[t._v("http://localhost:80")])])]),t._v(" "),a("h4",{attrs:{id:"step-3-access-krayin-in-your-browser"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-3-access-krayin-in-your-browser"}},[t._v("#")]),t._v(" Step 3: Access Krayin in Your Browser")]),t._v(" "),a("p",[t._v("After the container is up and running, open your browser and navigate to "),a("code",[t._v("http://localhost")]),t._v(". This will load the Krayin setup.")]),t._v(" "),a("h4",{attrs:{id:"step-4-admin-login-credentials"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-4-admin-login-credentials"}},[t._v("#")]),t._v(" Step 4: Admin Login Credentials")]),t._v(" "),a("p",[t._v("Use the following credentials to log in to the Krayin admin panel:")]),t._v(" "),a("ul",[a("li",[a("strong",[t._v("Admin Username")]),t._v(": "),a("code",[t._v("admin@example.com")])]),t._v(" "),a("li",[a("strong",[t._v("Admin Password")]),t._v(": "),a("code",[t._v("admin123")])])]),t._v(" "),a("h3",{attrs:{id:"_2-using-krayin-github-docker-repository"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-using-krayin-github-docker-repository"}},[t._v("#")]),t._v(" 2. "),a("strong",[t._v("Using Krayin GitHub Docker Repository")])]),t._v(" "),a("h4",{attrs:{id:"system-requirements"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#system-requirements"}},[t._v("#")]),t._v(" System Requirements")]),t._v(" "),a("p",[t._v("The Krayin GitHub Docker repository automatically handles the system requirements for running Krayin, including the necessary Apache and MySQL configurations. Before proceeding, ensure that you have the latest version of "),a("strong",[t._v("Docker")]),t._v(" and "),a("strong",[t._v("Docker Compose")]),t._v(" installed. You can find installation instructions for your operating system at the following links:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://docs.docker.com/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker Installation Guide"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://docs.docker.com/compose/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker Compose Installation Guide"),a("OutboundLink")],1)])]),t._v(" "),a("h4",{attrs:{id:"docker-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker-configuration"}},[t._v("#")]),t._v(" Docker Configuration")]),t._v(" "),a("ol",[a("li",[a("p",[a("strong",[t._v("Adjust Ports and Paths")]),a("br"),t._v("\nOpen the "),a("code",[t._v("docker-compose.yml")]),t._v(" file and configure the ports for Apache, MySQL, and PHPMyAdmin. You can also specify the volumes and MySQL credentials. Here's an example configuration:")]),t._v(" "),a("div",{staticClass:"language-yaml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-yaml"}},[a("code",[a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("version")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'3.1'")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("services")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-php-apache")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("args")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("container_project_path")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" /var/www/html/\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("uid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# add your uid here")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("user")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" $USER\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("context")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" .\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("dockerfile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" ./Dockerfile\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" krayin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("php"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("apache\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token datetime number"}},[t._v("80:80")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" ./workspace/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("/var/www/html/\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-mysql")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" mysql"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("command")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("default"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("authentication"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("plugin=mysql_native_password\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("restart")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" always\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("environment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("MYSQL_ROOT_HOST")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'%'")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("MYSQL_ROOT_PASSWORD")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" 3306"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3306")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" ./.configs/mysql"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("/var/lib/mysql/\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-phpmyadmin")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" phpmyadmin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("latest\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("restart")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" always\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("environment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_HOST")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" krayin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("mysql\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_USER")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_PASSWORD")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" 8080"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("mysql-data")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Running the Setup")]),a("br"),t._v("\nAfter adjusting the configurations, execute the following command to start the Docker containers:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sh")]),t._v(" setup.sh\n")])])])])]),t._v(" "),a("h4",{attrs:{id:"accessing-krayin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#accessing-krayin"}},[t._v("#")]),t._v(" Accessing Krayin")]),t._v(" "),a("ul",[a("li",[a("p",[a("strong",[t._v("Admin Panel")]),a("br"),t._v("\nAccess the admin panel at:"),a("br"),t._v(" "),a("code",[t._v("http(s)://your_server_endpoint/admin/login")]),a("br"),t._v("\nUse the default credentials:")]),t._v(" "),a("ul",[a("li",[a("strong",[t._v("Email")]),t._v(": "),a("code",[t._v("admin@example.com")])]),t._v(" "),a("li",[a("strong",[t._v("Password")]),t._v(": "),a("code",[t._v("admin123")])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Customer Registration")]),a("br"),t._v("\nRegister and log in as a customer at:"),a("br"),t._v(" "),a("code",[t._v("http(s)://your_server_endpoint/customer/register")])])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{374:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"docker"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker"}},[t._v("#")]),t._v(" Docker")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")]),a("ul",[a("li",[a("a",{attrs:{href:"#docker-setup-for-krayin"}},[t._v("Docker Setup for Krayin")])]),a("li",[a("a",{attrs:{href:"#_1-using-krayin-docker-image-from-docker-hub"}},[t._v("1. Using Krayin Docker Image from Docker Hub")])]),a("li",[a("a",{attrs:{href:"#_2-using-krayin-github-docker-repository"}},[t._v("2. Using Krayin GitHub Docker Repository")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.docker.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker"),a("OutboundLink")],1),t._v(" is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. Docker can also be used for defining and running multi-container Docker applications using the Docker Compose tool.")]),t._v(" "),a("p",[t._v("With the help of Docker Compose, you can define containers to be built, their configuration, links, volumes, ports, etc., in a single file, and it gets launched by a single command. You can also add multiple servers and services just by adding them to the Docker Compose configuration file. This configuration file is in "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/YAML",target:"_blank",rel:"noopener noreferrer"}},[t._v("YAML"),a("OutboundLink")],1),t._v(" format.")]),t._v(" "),a("h4",{attrs:{id:"application-data-and-database-volume-persistence"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#application-data-and-database-volume-persistence"}},[t._v("#")]),t._v(" Application Data and Database Volume Persistence")]),t._v(" "),a("p",[t._v("It is recommended to keep your application files and database data volume on the Docker host and mount them on the running container. This ensures that the application and database data persistence even in the case of containers' failure or termination. In this way, even if you destroy containers, your data won't get lost unless you remove them forcefully.\nThis compose configuration file mounts the application directory "),a("strong",[a("code",[t._v("app")])]),t._v(" and database volume "),a("strong",[a("code",[t._v("dbvolume")])]),t._v(" from the host to running Docker containers at the time of containers' launch.")]),t._v(" "),a("h3",{attrs:{id:"docker-setup-for-krayin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker-setup-for-krayin"}},[t._v("#")]),t._v(" Docker Setup for Krayin")]),t._v(" "),a("p",[t._v("You can configure Krayin using Docker in two different ways:")]),t._v(" "),a("ol",[a("li",[a("strong",[t._v("Using Krayin Docker Image from Docker Hub")])]),t._v(" "),a("li",[a("strong",[t._v("Using Krayin GitHub Docker Repository")])])]),t._v(" "),a("p",[t._v("Both approaches allow you to set up the application quickly, managing all system requirements like Apache, MySQL, and PHPMyAdmin within isolated containers. Below is a detailed guide for each method.")]),t._v(" "),a("h3",{attrs:{id:"_1-using-krayin-docker-image-from-docker-hub"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-using-krayin-docker-image-from-docker-hub"}},[t._v("#")]),t._v(" 1. "),a("strong",[t._v("Using Krayin Docker Image from Docker Hub")])]),t._v(" "),a("p",[t._v("Follow the steps below to set up Krayin using Docker Hub. This approach provides a pre-configured Docker image of Krayin, allowing for a quick and easy installation.")]),t._v(" "),a("h4",{attrs:{id:"step-1-pull-krayin-docker-image"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-1-pull-krayin-docker-image"}},[t._v("#")]),t._v(" Step 1: Pull Krayin Docker Image")]),t._v(" "),a("p",[t._v("To pull the Krayin Docker image from Docker Hub, use the following command:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" pull webkul/krayin:2.0.1\n")])])]),a("h4",{attrs:{id:"step-2-run-a-new-container"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-2-run-a-new-container"}},[t._v("#")]),t._v(" Step 2: Run a New Container")]),t._v(" "),a("p",[t._v("Once the image is pulled, you can run a new Docker container using the command below. This will bind your local port 80 to the container’s port 80, so Krayin can be accessed via the browser.")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-it")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-d")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-p")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),t._v(":80 webkul/krayin:2.0.1\n")])])]),a("blockquote",[a("p",[a("strong",[t._v("Note:")]),t._v("\nIf port 80 is already in use, you can try using a different port. For example, you can map port 8082 on your local machine to port 80 in the container by running the following command:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("docker")]),t._v(" run "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-it")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-d")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-p")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8082")]),t._v(":80 webkul/krayin:2.0.1\n")])])]),a("p",[t._v("After this, you can access the application at "),a("code",[t._v("http://localhost:8082/")]),t._v(" instead of "),a("code",[t._v("http://localhost:80")])])]),t._v(" "),a("h4",{attrs:{id:"step-3-access-krayin-in-your-browser"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-3-access-krayin-in-your-browser"}},[t._v("#")]),t._v(" Step 3: Access Krayin in Your Browser")]),t._v(" "),a("p",[t._v("After the container is up and running, open your browser and navigate to "),a("code",[t._v("http://localhost")]),t._v(". This will load the Krayin setup.")]),t._v(" "),a("h4",{attrs:{id:"step-4-admin-login-credentials"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-4-admin-login-credentials"}},[t._v("#")]),t._v(" Step 4: Admin Login Credentials")]),t._v(" "),a("p",[t._v("Use the following credentials to log in to the Krayin admin panel:")]),t._v(" "),a("ul",[a("li",[a("strong",[t._v("Admin Username")]),t._v(": "),a("code",[t._v("admin@example.com")])]),t._v(" "),a("li",[a("strong",[t._v("Admin Password")]),t._v(": "),a("code",[t._v("admin123")])])]),t._v(" "),a("h3",{attrs:{id:"_2-using-krayin-github-docker-repository"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-using-krayin-github-docker-repository"}},[t._v("#")]),t._v(" 2. "),a("strong",[t._v("Using Krayin GitHub Docker Repository")])]),t._v(" "),a("h4",{attrs:{id:"system-requirements"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#system-requirements"}},[t._v("#")]),t._v(" System Requirements")]),t._v(" "),a("p",[t._v("The Krayin GitHub Docker repository automatically handles the system requirements for running Krayin, including the necessary Apache and MySQL configurations. Before proceeding, ensure that you have the latest version of "),a("strong",[t._v("Docker")]),t._v(" and "),a("strong",[t._v("Docker Compose")]),t._v(" installed. You can find installation instructions for your operating system at the following links:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://docs.docker.com/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker Installation Guide"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://docs.docker.com/compose/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker Compose Installation Guide"),a("OutboundLink")],1)])]),t._v(" "),a("h4",{attrs:{id:"docker-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#docker-configuration"}},[t._v("#")]),t._v(" Docker Configuration")]),t._v(" "),a("ol",[a("li",[a("p",[a("strong",[t._v("Adjust Ports and Paths")]),a("br"),t._v("\nOpen the "),a("code",[t._v("docker-compose.yml")]),t._v(" file and configure the ports for Apache, MySQL, and PHPMyAdmin. You can also specify the volumes and MySQL credentials. Here's an example configuration:")]),t._v(" "),a("div",{staticClass:"language-yaml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-yaml"}},[a("code",[a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("version")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'3.1'")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("services")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-php-apache")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("args")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("container_project_path")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" /var/www/html/\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("uid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# add your uid here")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("user")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" $USER\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("context")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" .\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("dockerfile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" ./Dockerfile\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" krayin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("php"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("apache\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token datetime number"}},[t._v("80:80")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" ./workspace/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("/var/www/html/\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-mysql")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" mysql"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("command")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("default"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("authentication"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("plugin=mysql_native_password\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("restart")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" always\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("environment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("MYSQL_ROOT_HOST")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'%'")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("MYSQL_ROOT_PASSWORD")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" 3306"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3306")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" ./.configs/mysql"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("/var/lib/mysql/\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("krayin-phpmyadmin")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" phpmyadmin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("latest\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("restart")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" always\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("environment")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_HOST")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" krayin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("mysql\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_USER")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("PMA_PASSWORD")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" root\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("ports")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v(" 8080"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# adjust your port here, if you want to change")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("volumes")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v("mysql-data")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Running the Setup")]),a("br"),t._v("\nAfter adjusting the configurations, execute the following command to start the Docker containers:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sh")]),t._v(" setup.sh\n")])])])])]),t._v(" "),a("h4",{attrs:{id:"accessing-krayin"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#accessing-krayin"}},[t._v("#")]),t._v(" Accessing Krayin")]),t._v(" "),a("ul",[a("li",[a("p",[a("strong",[t._v("Admin Panel")]),a("br"),t._v("\nAccess the admin panel at:"),a("br"),t._v(" "),a("code",[t._v("http(s)://your_server_endpoint/admin/login")]),a("br"),t._v("\nUse the default credentials:")]),t._v(" "),a("ul",[a("li",[a("strong",[t._v("Email")]),t._v(": "),a("code",[t._v("admin@example.com")])]),t._v(" "),a("li",[a("strong",[t._v("Password")]),t._v(": "),a("code",[t._v("admin123")])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Customer Registration")]),a("br"),t._v("\nRegister and log in as a customer at:"),a("br"),t._v(" "),a("code",[t._v("http(s)://your_server_endpoint/customer/register")])])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/76.4f1c67f7.js b/assets/js/76.9092b0de.js similarity index 99% rename from assets/js/76.4f1c67f7.js rename to assets/js/76.9092b0de.js index a811703..ab9412d 100644 --- a/assets/js/76.4f1c67f7.js +++ b/assets/js/76.9092b0de.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[76],{374:function(a,t,e){"use strict";e.r(t);var s=e(10),r=Object(s.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"installation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[a._v("#")]),a._v(" Installation")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#install-using-gui-installer"}},[a._v("Install Using GUI Installer")])]),t("li",[t("a",{attrs:{href:"#install-using-composer"}},[a._v("Install Using Composer")])]),t("li",[t("a",{attrs:{href:"#start-using-krayin"}},[a._v("Start Using Krayin")]),t("ul",[t("li",[t("a",{attrs:{href:"#on-a-production-server"}},[a._v("On a Production Server")])]),t("li",[t("a",{attrs:{href:"#on-your-local-server"}},[a._v("On Your Local Server")])]),t("li",[t("a",{attrs:{href:"#login-as-an-admin"}},[a._v("Login as an Admin")])]),t("li",[t("a",{attrs:{href:"#contributing"}},[a._v("Contributing")])]),t("li",[t("a",{attrs:{href:"#license"}},[a._v("License")])])])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"install-using-gui-installer"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-using-gui-installer"}},[a._v("#")]),a._v(" Install Using GUI Installer")]),a._v(" "),t("p",[a._v("To install Krayin using our GUI installer, you can follow any of the following methods:")]),a._v(" "),t("h4",{attrs:{id:"method-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#method-1"}},[a._v("#")]),a._v(" Method 1:")]),a._v(" "),t("ul",[t("li",[t("p",[a._v("Choose the directory where you want to install Krayin. Open your terminal and navigate to this directory.")])]),a._v(" "),t("li",[t("p",[a._v("Once you are in the desired directory, run the following command in your terminal to install Krayin:")]),a._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("composer")]),a._v(" create-project krayin/laravel-crm\n")])])])]),a._v(" "),t("li",[t("p",[a._v("Configure your HTTP server to point to the "),t("strong",[t("code",[a._v("public/")])]),a._v(" directory of the project.")])]),a._v(" "),t("li",[t("p",[a._v("Open your browser and access the following URL:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("http://localhost/krayin/public/\n")])])]),t("p",[a._v("This will launch the Krayin installer.")])])]),a._v(" "),t("h4",{attrs:{id:"method-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#method-2"}},[a._v("#")]),a._v(" Method 2:")]),a._v(" "),t("p",[a._v("Otherwise you can download the zip file and install it using the following steps:")]),a._v(" "),t("ul",[t("li",[t("p",[t("a",{attrs:{href:"https://krayincrm.com/download/",target:"_blank",rel:"noopener noreferrer"}},[a._v("Download Krayin"),t("OutboundLink")],1),a._v(" from our website.")])]),a._v(" "),t("li",[t("p",[a._v("Extract the contents of the downloaded")])]),a._v(" "),t("li",[t("p",[a._v("Navigate to the project root directory.")])]),a._v(" "),t("li",[t("p",[a._v("Run the following command:")]),a._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("composer")]),a._v(" create project\n")])])])]),a._v(" "),t("li",[t("p",[a._v("Configure your HTTP server to point to the "),t("strong",[t("code",[a._v("public/")])]),a._v(" directory of the project.")])]),a._v(" "),t("li",[t("p",[a._v("Open your browser and access the following URL:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("http://localhost/krayin/public/\n")])])]),t("p",[a._v("This will launch the Krayin installer.")])])]),a._v(" "),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[a._v("WARNING")]),a._v(" "),t("p",[a._v("Ensure that Composer is installed on your system")])]),a._v(" "),t("h2",{attrs:{id:"install-using-composer"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-using-composer"}},[a._v("#")]),a._v(" Install Using Composer")]),a._v(" "),t("p",[a._v("To install Krayin using Composer, use the following steps:")]),a._v(" "),t("ul",[t("li",[t("p",[a._v("Choose the directory where you want to install Krayin. Open your terminal and navigate to this directory.")])]),a._v(" "),t("li",[t("p",[a._v("Once you are in the desired directory, run the following command in your terminal to install Krayin:")])]),a._v(" "),t("li",[t("p",[a._v("Run the following command:")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("composer")]),a._v(" create-project krayin/laravel-crm\n")])])])]),a._v(" "),t("li",[t("p",[a._v("Run the following command:")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan krayin-crm:install\n")])])]),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[a._v("WARNING")]),a._v(" "),t("p",[a._v("During the installation process, if the "),t("strong",[t("code",[a._v(".env")])]),a._v(" file doesn't exist, the installer will prompt you to provide the necessary information.")])])]),a._v(" "),t("li",[t("p",[a._v("Follow the prompts during the installation process to provide the following details:")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("- Please enter the application name "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter the application URL "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the default application locale "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the default currency "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database connection "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("host")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database name "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter your database username "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter your database password "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n")])])])]),a._v(" "),t("li",[t("p",[a._v("For Create your admin credentials")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("- Enter the name of the admin user "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n- Enter the email address of the admin user "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n- Configure the password "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("for")]),a._v(" the admin user "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n")])])])])]),a._v(" "),t("h2",{attrs:{id:"start-using-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#start-using-krayin"}},[a._v("#")]),a._v(" Start Using Krayin")]),a._v(" "),t("h3",{attrs:{id:"on-a-production-server"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#on-a-production-server"}},[a._v("#")]),a._v(" On a Production Server")]),a._v(" "),t("p",[a._v("To access Krayin on a production server, open your domain in a web browser. For example:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("https://example.com/\n")])])]),t("h3",{attrs:{id:"on-your-local-server"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#on-your-local-server"}},[a._v("#")]),a._v(" On Your Local Server")]),a._v(" "),t("p",[a._v("To access Krayin on your local server, follow these steps:")]),a._v(" "),t("ol",[t("li",[t("p",[a._v("Configure your HTTP server to point to the "),t("strong",[t("code",[a._v("public/")])]),a._v(" directory of the project.")])]),a._v(" "),t("li",[t("p",[a._v("Run the following command:")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan serve\n")])])])]),a._v(" "),t("li",[t("p",[a._v("Open your browser and access the provided local server URL.")])])]),a._v(" "),t("h3",{attrs:{id:"login-as-an-admin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#login-as-an-admin"}},[a._v("#")]),a._v(" Login as an Admin")]),a._v(" "),t("p",[a._v("To log in as an admin, visit "),t("strong",[t("code",[a._v("https://example.com/admin/")])]),a._v(". If you used the "),t("strong",[t("code",[a._v("php artisan krayin-crm:install")])]),a._v(" command, use the following credentials:")]),a._v(" "),t("div",{staticClass:"language-text extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("Email: admin@example.com\nPassword: admin123\n")])])]),t("h3",{attrs:{id:"contributing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#contributing"}},[a._v("#")]),a._v(" Contributing")]),a._v(" "),t("p",[a._v("Contributions are welcome! Follow the contribution guidelines to get started.")]),a._v(" "),t("h3",{attrs:{id:"license"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#license"}},[a._v("#")]),a._v(" License")]),a._v(" "),t("p",[a._v("Krayin is open-sourced software licensed under the MIT license.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[76],{373:function(a,t,e){"use strict";e.r(t);var s=e(10),r=Object(s.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"installation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[a._v("#")]),a._v(" Installation")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#install-using-gui-installer"}},[a._v("Install Using GUI Installer")])]),t("li",[t("a",{attrs:{href:"#install-using-composer"}},[a._v("Install Using Composer")])]),t("li",[t("a",{attrs:{href:"#start-using-krayin"}},[a._v("Start Using Krayin")]),t("ul",[t("li",[t("a",{attrs:{href:"#on-a-production-server"}},[a._v("On a Production Server")])]),t("li",[t("a",{attrs:{href:"#on-your-local-server"}},[a._v("On Your Local Server")])]),t("li",[t("a",{attrs:{href:"#login-as-an-admin"}},[a._v("Login as an Admin")])]),t("li",[t("a",{attrs:{href:"#contributing"}},[a._v("Contributing")])]),t("li",[t("a",{attrs:{href:"#license"}},[a._v("License")])])])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"install-using-gui-installer"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-using-gui-installer"}},[a._v("#")]),a._v(" Install Using GUI Installer")]),a._v(" "),t("p",[a._v("To install Krayin using our GUI installer, you can follow any of the following methods:")]),a._v(" "),t("h4",{attrs:{id:"method-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#method-1"}},[a._v("#")]),a._v(" Method 1:")]),a._v(" "),t("ul",[t("li",[t("p",[a._v("Choose the directory where you want to install Krayin. Open your terminal and navigate to this directory.")])]),a._v(" "),t("li",[t("p",[a._v("Once you are in the desired directory, run the following command in your terminal to install Krayin:")]),a._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("composer")]),a._v(" create-project krayin/laravel-crm\n")])])])]),a._v(" "),t("li",[t("p",[a._v("Configure your HTTP server to point to the "),t("strong",[t("code",[a._v("public/")])]),a._v(" directory of the project.")])]),a._v(" "),t("li",[t("p",[a._v("Open your browser and access the following URL:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("http://localhost/krayin/public/\n")])])]),t("p",[a._v("This will launch the Krayin installer.")])])]),a._v(" "),t("h4",{attrs:{id:"method-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#method-2"}},[a._v("#")]),a._v(" Method 2:")]),a._v(" "),t("p",[a._v("Otherwise you can download the zip file and install it using the following steps:")]),a._v(" "),t("ul",[t("li",[t("p",[t("a",{attrs:{href:"https://krayincrm.com/download/",target:"_blank",rel:"noopener noreferrer"}},[a._v("Download Krayin"),t("OutboundLink")],1),a._v(" from our website.")])]),a._v(" "),t("li",[t("p",[a._v("Extract the contents of the downloaded")])]),a._v(" "),t("li",[t("p",[a._v("Navigate to the project root directory.")])]),a._v(" "),t("li",[t("p",[a._v("Run the following command:")]),a._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("composer")]),a._v(" create project\n")])])])]),a._v(" "),t("li",[t("p",[a._v("Configure your HTTP server to point to the "),t("strong",[t("code",[a._v("public/")])]),a._v(" directory of the project.")])]),a._v(" "),t("li",[t("p",[a._v("Open your browser and access the following URL:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("http://localhost/krayin/public/\n")])])]),t("p",[a._v("This will launch the Krayin installer.")])])]),a._v(" "),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[a._v("WARNING")]),a._v(" "),t("p",[a._v("Ensure that Composer is installed on your system")])]),a._v(" "),t("h2",{attrs:{id:"install-using-composer"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-using-composer"}},[a._v("#")]),a._v(" Install Using Composer")]),a._v(" "),t("p",[a._v("To install Krayin using Composer, use the following steps:")]),a._v(" "),t("ul",[t("li",[t("p",[a._v("Choose the directory where you want to install Krayin. Open your terminal and navigate to this directory.")])]),a._v(" "),t("li",[t("p",[a._v("Once you are in the desired directory, run the following command in your terminal to install Krayin:")])]),a._v(" "),t("li",[t("p",[a._v("Run the following command:")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("composer")]),a._v(" create-project krayin/laravel-crm\n")])])])]),a._v(" "),t("li",[t("p",[a._v("Run the following command:")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan krayin-crm:install\n")])])]),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[a._v("WARNING")]),a._v(" "),t("p",[a._v("During the installation process, if the "),t("strong",[t("code",[a._v(".env")])]),a._v(" file doesn't exist, the installer will prompt you to provide the necessary information.")])])]),a._v(" "),t("li",[t("p",[a._v("Follow the prompts during the installation process to provide the following details:")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("- Please enter the application name "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter the application URL "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the default application locale "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the default currency "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database connection "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("host")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database name "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter your database username "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter your database password "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n")])])])]),a._v(" "),t("li",[t("p",[a._v("For Create your admin credentials")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("- Enter the name of the admin user "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n- Enter the email address of the admin user "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n- Configure the password "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("for")]),a._v(" the admin user "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n")])])])])]),a._v(" "),t("h2",{attrs:{id:"start-using-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#start-using-krayin"}},[a._v("#")]),a._v(" Start Using Krayin")]),a._v(" "),t("h3",{attrs:{id:"on-a-production-server"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#on-a-production-server"}},[a._v("#")]),a._v(" On a Production Server")]),a._v(" "),t("p",[a._v("To access Krayin on a production server, open your domain in a web browser. For example:")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("https://example.com/\n")])])]),t("h3",{attrs:{id:"on-your-local-server"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#on-your-local-server"}},[a._v("#")]),a._v(" On Your Local Server")]),a._v(" "),t("p",[a._v("To access Krayin on your local server, follow these steps:")]),a._v(" "),t("ol",[t("li",[t("p",[a._v("Configure your HTTP server to point to the "),t("strong",[t("code",[a._v("public/")])]),a._v(" directory of the project.")])]),a._v(" "),t("li",[t("p",[a._v("Run the following command:")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan serve\n")])])])]),a._v(" "),t("li",[t("p",[a._v("Open your browser and access the provided local server URL.")])])]),a._v(" "),t("h3",{attrs:{id:"login-as-an-admin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#login-as-an-admin"}},[a._v("#")]),a._v(" Login as an Admin")]),a._v(" "),t("p",[a._v("To log in as an admin, visit "),t("strong",[t("code",[a._v("https://example.com/admin/")])]),a._v(". If you used the "),t("strong",[t("code",[a._v("php artisan krayin-crm:install")])]),a._v(" command, use the following credentials:")]),a._v(" "),t("div",{staticClass:"language-text extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("Email: admin@example.com\nPassword: admin123\n")])])]),t("h3",{attrs:{id:"contributing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#contributing"}},[a._v("#")]),a._v(" Contributing")]),a._v(" "),t("p",[a._v("Contributions are welcome! Follow the contribution guidelines to get started.")]),a._v(" "),t("h3",{attrs:{id:"license"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#license"}},[a._v("#")]),a._v(" License")]),a._v(" "),t("p",[a._v("Krayin is open-sourced software licensed under the MIT license.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/42.7fa39424.js b/assets/js/77.0970e185.js similarity index 98% rename from assets/js/42.7fa39424.js rename to assets/js/77.0970e185.js index 9bc3f88..934c7e1 100644 --- a/assets/js/42.7fa39424.js +++ b/assets/js/77.0970e185.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{338:function(e,t,s){"use strict";s.r(t);var r=s(10),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"requirements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[e._v("#")]),e._v(" Requirements")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#server-configuration"}},[e._v("Server configuration")])]),t("li",[t("a",{attrs:{href:"#php-extensions"}},[e._v("PHP Extensions")])]),t("li",[t("a",{attrs:{href:"#php-configuration"}},[e._v("PHP Configuration")])]),t("li",[t("a",{attrs:{href:"#supported-database-servers"}},[e._v("Supported Database Servers")])])])]),t("p"),e._v(" "),t("p",[e._v("Before installing Krayin please make sure your server meets the following requirements,")]),e._v(" "),t("h2",{attrs:{id:"server-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#server-configuration"}},[e._v("#")]),e._v(" Server configuration")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("SERVER")]),e._v(": Apache 2 or NGINX")]),e._v(" "),t("li",[t("strong",[e._v("RAM")]),e._v(": 4GB or higher")]),e._v(" "),t("li",[t("strong",[e._v("Node")]),e._v(": v16.16.0 (LTS) or higher")]),e._v(" "),t("li",[t("strong",[e._v("PHP")]),e._v(": 8.1 or higher")]),e._v(" "),t("li",[t("strong",[e._v("Composer")]),e._v(": 2.5 or higher")])]),e._v(" "),t("h2",{attrs:{id:"php-extensions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#php-extensions"}},[e._v("#")]),e._v(" PHP Extensions")]),e._v(" "),t("p",[e._v("Ensure the following extensions are installed and enabled. You can check using the "),t("strong",[t("code",[e._v("phpinfo()")])]),e._v(" page or the "),t("strong",[t("code",[e._v("php -m")])]),e._v(" command.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("php-intl extension")]),e._v(": This extension is required for internationalization support in Krayin.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("php-gd extension")]),e._v(": The "),t("strong",[t("code",[e._v("php-gd")])]),e._v(" extension must be properly installed to ensure correct image functionality in the project. If not installed correctly, image-related features may not work as expected.")]),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Note")]),e._v(" "),t("p",[e._v("It is important to ensure proper installation of the "),t("strong",[t("code",[e._v("php-gd")])]),e._v(" extension to avoid any issues with image manipulation in Krayin.")])])])]),e._v(" "),t("h2",{attrs:{id:"php-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#php-configuration"}},[e._v("#")]),e._v(" PHP Configuration")]),e._v(" "),t("p",[e._v("Open your "),t("strong",[t("code",[e._v("php.ini")])]),e._v(" file and modify the following settings.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("memory_limit")]),e._v(": Set the "),t("strong",[t("code",[e._v("memory_limit")])]),e._v(" directive to "),t("strong",[t("code",[e._v("4G")])]),e._v(" or higher to ensure sufficient memory allocation for the application.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("max_execution_time")]),e._v(": Adjust the "),t("strong",[t("code",[e._v("max_execution_time")])]),e._v(" directive to "),t("strong",[t("code",[e._v("360")])]),e._v(" or higher. This value determines the maximum time (in seconds) a script is allowed to run. Increasing this value ensures that longer operations, such as import/export processes, can be completed successfully.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("date.timezone")]),e._v(": Set the "),t("strong",[t("code",[e._v("date.timezone")])]),e._v(" directive to your specific timezone. For example, "),t("strong",[t("code",[e._v("Asia/Kolkata")])]),e._v(". This ensures that date and time-related functions work accurately based on the specified timezone.")])])]),e._v(" "),t("div",{staticClass:"language-ini extra-class"},[t("pre",{pre:!0,attrs:{class:"language-ini"}},[t("code",[t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("memory_limit")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("4G")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("max_execution_time")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("360")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("date.timezone")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("Asia/Kolkata <- Change this to your own timezone.")]),e._v("\n")])])]),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Remember to restart your web server")]),e._v(" "),t("p",[e._v("Whenever you make changes to the PHP configuration file, be sure to restart Apache or NGINX to apply the modifications.")])]),e._v(" "),t("h2",{attrs:{id:"supported-database-servers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supported-database-servers"}},[e._v("#")]),e._v(" Supported Database Servers")]),e._v(" "),t("p",[e._v("Krayin supports the following database servers:")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("MySQL")]),e._v(": Version 8.0.32 or higher is recommended for optimal performance and compatibility.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("MariaDB")]),e._v(": Version 10.3 or higher is recommended for optimal performance and compatibility.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Database Collation")]),e._v(": The recommended collation for the database is "),t("strong",[t("code",[e._v("utf8mb4_unicode_ci")])]),e._v(", which ensures proper handling of Unicode characters and multilingual support.")])])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{376:function(e,t,s){"use strict";s.r(t);var r=s(10),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"requirements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[e._v("#")]),e._v(" Requirements")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#server-configuration"}},[e._v("Server configuration")])]),t("li",[t("a",{attrs:{href:"#php-extensions"}},[e._v("PHP Extensions")])]),t("li",[t("a",{attrs:{href:"#php-configuration"}},[e._v("PHP Configuration")])]),t("li",[t("a",{attrs:{href:"#supported-database-servers"}},[e._v("Supported Database Servers")])])])]),t("p"),e._v(" "),t("p",[e._v("Before installing Krayin please make sure your server meets the following requirements,")]),e._v(" "),t("h2",{attrs:{id:"server-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#server-configuration"}},[e._v("#")]),e._v(" Server configuration")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("SERVER")]),e._v(": Apache 2 or NGINX")]),e._v(" "),t("li",[t("strong",[e._v("RAM")]),e._v(": 4GB or higher")]),e._v(" "),t("li",[t("strong",[e._v("Node")]),e._v(": v16.16.0 (LTS) or higher")]),e._v(" "),t("li",[t("strong",[e._v("PHP")]),e._v(": 8.1 or higher")]),e._v(" "),t("li",[t("strong",[e._v("Composer")]),e._v(": 2.5 or higher")])]),e._v(" "),t("h2",{attrs:{id:"php-extensions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#php-extensions"}},[e._v("#")]),e._v(" PHP Extensions")]),e._v(" "),t("p",[e._v("Ensure the following extensions are installed and enabled. You can check using the "),t("strong",[t("code",[e._v("phpinfo()")])]),e._v(" page or the "),t("strong",[t("code",[e._v("php -m")])]),e._v(" command.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("php-intl extension")]),e._v(": This extension is required for internationalization support in Krayin.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("php-gd extension")]),e._v(": The "),t("strong",[t("code",[e._v("php-gd")])]),e._v(" extension must be properly installed to ensure correct image functionality in the project. If not installed correctly, image-related features may not work as expected.")]),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Note")]),e._v(" "),t("p",[e._v("It is important to ensure proper installation of the "),t("strong",[t("code",[e._v("php-gd")])]),e._v(" extension to avoid any issues with image manipulation in Krayin.")])])])]),e._v(" "),t("h2",{attrs:{id:"php-configuration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#php-configuration"}},[e._v("#")]),e._v(" PHP Configuration")]),e._v(" "),t("p",[e._v("Open your "),t("strong",[t("code",[e._v("php.ini")])]),e._v(" file and modify the following settings.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("memory_limit")]),e._v(": Set the "),t("strong",[t("code",[e._v("memory_limit")])]),e._v(" directive to "),t("strong",[t("code",[e._v("4G")])]),e._v(" or higher to ensure sufficient memory allocation for the application.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("max_execution_time")]),e._v(": Adjust the "),t("strong",[t("code",[e._v("max_execution_time")])]),e._v(" directive to "),t("strong",[t("code",[e._v("360")])]),e._v(" or higher. This value determines the maximum time (in seconds) a script is allowed to run. Increasing this value ensures that longer operations, such as import/export processes, can be completed successfully.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("date.timezone")]),e._v(": Set the "),t("strong",[t("code",[e._v("date.timezone")])]),e._v(" directive to your specific timezone. For example, "),t("strong",[t("code",[e._v("Asia/Kolkata")])]),e._v(". This ensures that date and time-related functions work accurately based on the specified timezone.")])])]),e._v(" "),t("div",{staticClass:"language-ini extra-class"},[t("pre",{pre:!0,attrs:{class:"language-ini"}},[t("code",[t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("memory_limit")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("4G")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("max_execution_time")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("360")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token key attr-name"}},[e._v("date.timezone")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token value attr-value"}},[e._v("Asia/Kolkata <- Change this to your own timezone.")]),e._v("\n")])])]),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Remember to restart your web server")]),e._v(" "),t("p",[e._v("Whenever you make changes to the PHP configuration file, be sure to restart Apache or NGINX to apply the modifications.")])]),e._v(" "),t("h2",{attrs:{id:"supported-database-servers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#supported-database-servers"}},[e._v("#")]),e._v(" Supported Database Servers")]),e._v(" "),t("p",[e._v("Krayin supports the following database servers:")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("MySQL")]),e._v(": Version 8.0.32 or higher is recommended for optimal performance and compatibility.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("MariaDB")]),e._v(": Version 10.3 or higher is recommended for optimal performance and compatibility.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Database Collation")]),e._v(": The recommended collation for the database is "),t("strong",[t("code",[e._v("utf8mb4_unicode_ci")])]),e._v(", which ensures proper handling of Unicode characters and multilingual support.")])])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/78.77d81075.js b/assets/js/78.0be53998.js similarity index 98% rename from assets/js/78.77d81075.js rename to assets/js/78.0be53998.js index 5ee5e9f..24297a1 100644 --- a/assets/js/78.77d81075.js +++ b/assets/js/78.0be53998.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[78],{377:function(e,n,a){"use strict";a.r(n);var t=a(10),o=Object(t.a)({},(function(){var e=this,n=e._self._c;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h2",{attrs:{id:"package-development"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#package-development"}},[e._v("#")]),e._v(" Package Development")]),e._v(" "),n("p",[e._v("If you are looking to extend the functionalities of Krayin CRM platform, creating a package is the way to go. A package is a self-contained module that adds specific features to the platform. It allows developers to add custom functionality to the platform without modifying the core codebase.")]),e._v(" "),n("p",[e._v("This guide will walk you through the process of developing a package for Krayin.")]),e._v(" "),n("p",[e._v("In Krayin, we have created numerous packages located at "),n("strong",[n("code",[e._v("packages/Webkul/")])]),e._v(". Below is a basic tree structure of a package:")]),e._v(" "),n("div",{staticClass:"language-directory-structure extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("└── Webkul\n └── Category\n └── src\n ├── Config\n │ ├── acl.php\n │ ├── admin-menu.php\n │ └── system.php\n ├── Console\n │ └── Commands\n ├── Contracts\n │ └── Category.php\n ├── Database\n │ ├── Migrations\n │ │ └── 2023_04_21_173057_create_categories_table.php\n │ └── Seeders\n ├── Events\n ├── Http\n │ ├── Controllers\n │ │ └── Admin\n │ │ └── CategoryController.php\n │ ├── Middleware\n │ └── Requests\n │ └── CategoryRequest.php\n ├── Listeners\n ├── Mail\n ├── Models\n │ ├── Category.php\n │ └── CategoryProxy.php\n ├── Providers\n │ ├── CategoryServiceProvider.php\n │ └── ModuleServiceProvider.php\n ├── Routes\n │ └── admin-routes.php\n ├── Repositories\n │ └── CategoryRepository.php\n └── Resources\n ├── assets\n │ ├── images\n │ │ └── category-icon.png\n │ ├── js\n │ │ └── app.js\n │ └── css\n │ └── app.css\n ├── lang\n │ ├── ar.php\n │ └── en.php\n └── views\n ├── admin\n │ └── layouts\n │ └── style.blade.php\n ├── index.blade.php\n ├── create.blade.php\n └── edit.blade.php\n")])])])])}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[78],{375:function(e,n,a){"use strict";a.r(n);var t=a(10),o=Object(t.a)({},(function(){var e=this,n=e._self._c;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h2",{attrs:{id:"package-development"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#package-development"}},[e._v("#")]),e._v(" Package Development")]),e._v(" "),n("p",[e._v("If you are looking to extend the functionalities of Krayin CRM platform, creating a package is the way to go. A package is a self-contained module that adds specific features to the platform. It allows developers to add custom functionality to the platform without modifying the core codebase.")]),e._v(" "),n("p",[e._v("This guide will walk you through the process of developing a package for Krayin.")]),e._v(" "),n("p",[e._v("In Krayin, we have created numerous packages located at "),n("strong",[n("code",[e._v("packages/Webkul/")])]),e._v(". Below is a basic tree structure of a package:")]),e._v(" "),n("div",{staticClass:"language-directory-structure extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("└── Webkul\n └── Category\n └── src\n ├── Config\n │ ├── acl.php\n │ ├── admin-menu.php\n │ └── system.php\n ├── Console\n │ └── Commands\n ├── Contracts\n │ └── Category.php\n ├── Database\n │ ├── Migrations\n │ │ └── 2023_04_21_173057_create_categories_table.php\n │ └── Seeders\n ├── Events\n ├── Http\n │ ├── Controllers\n │ │ └── Admin\n │ │ └── CategoryController.php\n │ ├── Middleware\n │ └── Requests\n │ └── CategoryRequest.php\n ├── Listeners\n ├── Mail\n ├── Models\n │ ├── Category.php\n │ └── CategoryProxy.php\n ├── Providers\n │ ├── CategoryServiceProvider.php\n │ └── ModuleServiceProvider.php\n ├── Routes\n │ └── admin-routes.php\n ├── Repositories\n │ └── CategoryRepository.php\n └── Resources\n ├── assets\n │ ├── images\n │ │ └── category-icon.png\n │ ├── js\n │ │ └── app.js\n │ └── css\n │ └── app.css\n ├── lang\n │ ├── ar.php\n │ └── en.php\n └── views\n ├── admin\n │ └── layouts\n │ └── style.blade.php\n ├── index.blade.php\n ├── create.blade.php\n └── edit.blade.php\n")])])])])}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/79.535aa00d.js b/assets/js/79.bba635c4.js similarity index 99% rename from assets/js/79.535aa00d.js rename to assets/js/79.bba635c4.js index 9f91fc2..a61ddfc 100644 --- a/assets/js/79.535aa00d.js +++ b/assets/js/79.bba635c4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[79],{376:function(t,e,s){"use strict";s.r(e);var a=s(10),n=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#menu"}},[t._v("#")]),t._v(" Menu")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#configure-the-menu"}},[t._v("Configure the menu")]),e("ul",[e("li",[e("a",{attrs:{href:"#create-configuration-file"}},[t._v("Create Configuration File")])]),e("li",[e("a",{attrs:{href:"#define-menu-items"}},[t._v("Define Menu Items")])]),e("li",[e("a",{attrs:{href:"#define-routes"}},[t._v("Define Routes")])]),e("li",[e("a",{attrs:{href:"#add-menu-icon"}},[t._v("Add Menu Icon")])]),e("li",[e("a",{attrs:{href:"#merge-configuration"}},[t._v("Merge Configuration")])]),e("li",[e("a",{attrs:{href:"#optimize-application"}},[t._v("Optimize Application")])])])]),e("li",[e("a",{attrs:{href:"#level-of-menu"}},[t._v("Level of Menu")]),e("ul",[e("li",[e("a",{attrs:{href:"#first-level-sidebar"}},[t._v("First Level (Sidebar)")])]),e("li",[e("a",{attrs:{href:"#second-level-hover-menu"}},[t._v("Second Level (Hover Menu)")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("The menu in Krayin allows developers to customize and extend the default menu items within the admin panel. By adding custom menu items, you can provide easy access to various sections and features specific to your package. This guide will walk you through the process of configuring the menu for your custom package.")]),t._v(" "),e("h2",{attrs:{id:"configure-the-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configure-the-menu"}},[t._v("#")]),t._v(" Configure the menu")]),t._v(" "),e("p",[t._v("To ensure that the menu includes the necessary configuration, follow these steps:")]),t._v(" "),e("h3",{attrs:{id:"create-configuration-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-file"}},[t._v("#")]),t._v(" Create Configuration File")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("Navigate to your package's source directory, typically located at "),e("code",[t._v("packages/Webkul/Category/src")]),t._v(".")])]),t._v(" "),e("li",[e("p",[t._v("Create a new directory named "),e("code",[t._v("Config")]),t._v(" if it doesn't already exist.")])]),t._v(" "),e("li",[e("p",[t._v("Inside the "),e("code",[t._v("Config")]),t._v(" directory, create a file "),e("code",[t._v("named menu.php")]),t._v(".")])])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Config\n └── menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),e("h3",{attrs:{id:"define-menu-items"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-menu-items"}},[t._v("#")]),t._v(" Define Menu Items")]),t._v(" "),e("p",[t._v("Open "),e("code",[t._v("menu.php")]),t._v(" and define your menu items using an array structure. Each item should include:")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("key")]),t._v(" Unique identifier for the menu item.")]),t._v(" "),e("li",[e("code",[t._v("name")]),t._v(" Display name of the menu item.")]),t._v(" "),e("li",[e("code",[t._v("route")]),t._v(" Laravel route name corresponding to the menu item.")]),t._v(" "),e("li",[e("code",[t._v("sort")]),t._v(" Optional. Sort order for menu items.")]),t._v(" "),e("li",[e("code",[t._v("icon")]),t._v(" Optional. CSS class for an icon associated with the menu item.")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category.admin.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sort'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon-category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),e("h3",{attrs:{id:"define-routes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-routes"}},[t._v("#")]),t._v(" Define Routes")]),t._v(" "),e("p",[t._v("In your package's "),e("code",[t._v("routes.php")]),t._v(" file, define the named route used in "),e("code",[t._v("menu.php")]),t._v(" as follows.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category.admin.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("In this step, we define the route that corresponds to the menu item added in the previous step.")]),t._v(" "),e("h3",{attrs:{id:"add-menu-icon"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-menu-icon"}},[t._v("#")]),t._v(" Add Menu Icon")]),t._v(" "),e("p",[t._v("You can add menu icon by creating the file icons.scss, follow the below provided directory structure.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── assets\n ├── css\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("css\n ├── js\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("js\n └── images\n \n")])])]),e("p",[t._v("Here the example how you can add menu icon.")]),t._v(" "),e("div",{staticClass:"language-scss extra-class"},[e("pre",{pre:!0,attrs:{class:"language-scss"}},[e("code",[e("span",{pre:!0,attrs:{class:"token selector"}},[t._v(".icon-category ")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-position")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" -371px -2px"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-image")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token url"}},[t._v("url")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../images/sprite-main.svg"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h3",{attrs:{id:"merge-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#merge-configuration"}},[t._v("#")]),t._v(" Merge Configuration")]),t._v(" "),e("p",[t._v("In your package's service provider ("),e("code",[t._v("CategoryServiceProvider")]),t._v("), use "),e("code",[t._v("mergeConfigFrom()")]),t._v(" to integrate your "),e("code",[t._v("menu.php")]),t._v(" configuration with the core menu.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeConfigFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/Config/menu.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'menu.admin'")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("h3",{attrs:{id:"optimize-application"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#optimize-application"}},[t._v("#")]),t._v(" Optimize Application")]),t._v(" "),e("p",[t._v("Finally, run the following command to optimize your application:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("php artisan optimize:clear\n")])])]),e("p",[t._v("After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.")]),t._v(" "),e("h2",{attrs:{id:"level-of-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#level-of-menu"}},[t._v("#")]),t._v(" Level of Menu")]),t._v(" "),e("p",[t._v("In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:")]),t._v(" "),e("h3",{attrs:{id:"first-level-sidebar"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#first-level-sidebar"}},[t._v("#")]),t._v(" First Level (Sidebar)")]),t._v(" "),e("p",[t._v("This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.")]),t._v(" "),e("h3",{attrs:{id:"second-level-hover-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#second-level-hover-menu"}},[t._v("#")]),t._v(" Second Level (Hover Menu)")]),t._v(" "),e("p",[t._v('When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.')])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[79],{377:function(t,e,s){"use strict";s.r(e);var a=s(10),n=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#menu"}},[t._v("#")]),t._v(" Menu")]),t._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#configure-the-menu"}},[t._v("Configure the menu")]),e("ul",[e("li",[e("a",{attrs:{href:"#create-configuration-file"}},[t._v("Create Configuration File")])]),e("li",[e("a",{attrs:{href:"#define-menu-items"}},[t._v("Define Menu Items")])]),e("li",[e("a",{attrs:{href:"#define-routes"}},[t._v("Define Routes")])]),e("li",[e("a",{attrs:{href:"#add-menu-icon"}},[t._v("Add Menu Icon")])]),e("li",[e("a",{attrs:{href:"#merge-configuration"}},[t._v("Merge Configuration")])]),e("li",[e("a",{attrs:{href:"#optimize-application"}},[t._v("Optimize Application")])])])]),e("li",[e("a",{attrs:{href:"#level-of-menu"}},[t._v("Level of Menu")]),e("ul",[e("li",[e("a",{attrs:{href:"#first-level-sidebar"}},[t._v("First Level (Sidebar)")])]),e("li",[e("a",{attrs:{href:"#second-level-hover-menu"}},[t._v("Second Level (Hover Menu)")])])])])])]),e("p"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("The menu in Krayin allows developers to customize and extend the default menu items within the admin panel. By adding custom menu items, you can provide easy access to various sections and features specific to your package. This guide will walk you through the process of configuring the menu for your custom package.")]),t._v(" "),e("h2",{attrs:{id:"configure-the-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configure-the-menu"}},[t._v("#")]),t._v(" Configure the menu")]),t._v(" "),e("p",[t._v("To ensure that the menu includes the necessary configuration, follow these steps:")]),t._v(" "),e("h3",{attrs:{id:"create-configuration-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-file"}},[t._v("#")]),t._v(" Create Configuration File")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("Navigate to your package's source directory, typically located at "),e("code",[t._v("packages/Webkul/Category/src")]),t._v(".")])]),t._v(" "),e("li",[e("p",[t._v("Create a new directory named "),e("code",[t._v("Config")]),t._v(" if it doesn't already exist.")])]),t._v(" "),e("li",[e("p",[t._v("Inside the "),e("code",[t._v("Config")]),t._v(" directory, create a file "),e("code",[t._v("named menu.php")]),t._v(".")])])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Config\n └── menu"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),e("h3",{attrs:{id:"define-menu-items"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-menu-items"}},[t._v("#")]),t._v(" Define Menu Items")]),t._v(" "),e("p",[t._v("Open "),e("code",[t._v("menu.php")]),t._v(" and define your menu items using an array structure. Each item should include:")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("key")]),t._v(" Unique identifier for the menu item.")]),t._v(" "),e("li",[e("code",[t._v("name")]),t._v(" Display name of the menu item.")]),t._v(" "),e("li",[e("code",[t._v("route")]),t._v(" Laravel route name corresponding to the menu item.")]),t._v(" "),e("li",[e("code",[t._v("sort")]),t._v(" Optional. Sort order for menu items.")]),t._v(" "),e("li",[e("code",[t._v("icon")]),t._v(" Optional. CSS class for an icon associated with the menu item.")])]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category.admin.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sort'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon-category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),e("h3",{attrs:{id:"define-routes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#define-routes"}},[t._v("#")]),t._v(" Define Routes")]),t._v(" "),e("p",[t._v("In your package's "),e("code",[t._v("routes.php")]),t._v(" file, define the named route used in "),e("code",[t._v("menu.php")]),t._v(" as follows.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category.admin.index'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("p",[t._v("In this step, we define the route that corresponds to the menu item added in the previous step.")]),t._v(" "),e("h3",{attrs:{id:"add-menu-icon"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-menu-icon"}},[t._v("#")]),t._v(" Add Menu Icon")]),t._v(" "),e("p",[t._v("You can add menu icon by creating the file icons.scss, follow the below provided directory structure.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── assets\n ├── css\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("css\n ├── js\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("js\n └── images\n \n")])])]),e("p",[t._v("Here the example how you can add menu icon.")]),t._v(" "),e("div",{staticClass:"language-scss extra-class"},[e("pre",{pre:!0,attrs:{class:"language-scss"}},[e("code",[e("span",{pre:!0,attrs:{class:"token selector"}},[t._v(".icon-category ")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-position")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" -371px -2px"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-image")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token url"}},[t._v("url")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../images/sprite-main.svg"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h3",{attrs:{id:"merge-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#merge-configuration"}},[t._v("#")]),t._v(" Merge Configuration")]),t._v(" "),e("p",[t._v("In your package's service provider ("),e("code",[t._v("CategoryServiceProvider")]),t._v("), use "),e("code",[t._v("mergeConfigFrom()")]),t._v(" to integrate your "),e("code",[t._v("menu.php")]),t._v(" configuration with the core menu.")]),t._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeConfigFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("dirname")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/Config/menu.php'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'menu.admin'")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),e("h3",{attrs:{id:"optimize-application"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#optimize-application"}},[t._v("#")]),t._v(" Optimize Application")]),t._v(" "),e("p",[t._v("Finally, run the following command to optimize your application:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("php artisan optimize:clear\n")])])]),e("p",[t._v("After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.")]),t._v(" "),e("h2",{attrs:{id:"level-of-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#level-of-menu"}},[t._v("#")]),t._v(" Level of Menu")]),t._v(" "),e("p",[t._v("In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:")]),t._v(" "),e("h3",{attrs:{id:"first-level-sidebar"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#first-level-sidebar"}},[t._v("#")]),t._v(" First Level (Sidebar)")]),t._v(" "),e("p",[t._v("This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.")]),t._v(" "),e("h3",{attrs:{id:"second-level-hover-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#second-level-hover-menu"}},[t._v("#")]),t._v(" Second Level (Hover Menu)")]),t._v(" "),e("p",[t._v('When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.')])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/80.9636be31.js b/assets/js/80.0a433807.js similarity index 99% rename from assets/js/80.9636be31.js rename to assets/js/80.0a433807.js index 0c98efb..dcdf842 100644 --- a/assets/js/80.9636be31.js +++ b/assets/js/80.0a433807.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[80],{378:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"bundling-assets"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bundling-assets"}},[t._v("#")]),t._v(" Bundling Assets")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#directory-structure"}},[t._v("Directory Structure")])]),s("li",[s("a",{attrs:{href:"#configure-compiling-assets"}},[t._v("Configure Compiling Assets")])]),s("li",[s("a",{attrs:{href:"#create-configuration-files"}},[t._v("Create Configuration Files")]),s("ul",[s("li",[s("a",{attrs:{href:"#set-up-package-json"}},[t._v("Set Up package.json")])]),s("li",[s("a",{attrs:{href:"#set-up-webpack-mix-js"}},[t._v("Set Up webpack.mix.js")])]),s("li",[s("a",{attrs:{href:"#importing-laravel-mix"}},[t._v("Importing Laravel Mix")])]),s("li",[s("a",{attrs:{href:"#merging-manifests"}},[t._v("Merging Manifests")])]),s("li",[s("a",{attrs:{href:"#setting-the-public-path"}},[t._v("Setting the Public Path")])]),s("li",[s("a",{attrs:{href:"#mix-configuration"}},[t._v("Mix Configuration")])]),s("li",[s("a",{attrs:{href:"#asset-compilation"}},[t._v("Asset Compilation")])]),s("li",[s("a",{attrs:{href:"#webpack-configuration"}},[t._v("Webpack Configuration")])]),s("li",[s("a",{attrs:{href:"#source-maps"}},[t._v("Source Maps")])]),s("li",[s("a",{attrs:{href:"#versioning"}},[t._v("Versioning")])])])]),s("li",[s("a",{attrs:{href:"#load-assets-in-blade-file"}},[t._v("Load Assets in Blade File")])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("Assets in web development refer to files such as stylesheets, scripts, and images that are utilized to enhance the functionality, design, and interactivity of a web application or website. These files are essential for providing styling, behavior, and media content to the user interface.")]),t._v(" "),s("ul",[s("li",[s("strong",[t._v("CSS")]),t._v(": Cascading Style Sheets (CSS) define the presentation and layout of HTML elements, ensuring consistent styling across pages.")]),t._v(" "),s("li",[s("strong",[t._v("JavaScript")]),t._v(": JavaScript (JS) adds interactivity and dynamic behavior to web pages, enabling features like form validation, animations, and AJAX requests.")]),t._v(" "),s("li",[s("strong",[t._v("Images")]),t._v(": Images enhance visual content, including logos, illustrations, and photographs, making web pages more engaging and informative.")])]),t._v(" "),s("p",[t._v("To learn in detail about Bundling Asset, you can visit the Laravel documentation "),s("a",{attrs:{href:"https://laravel.com/docs/10.x/frontend#bundling-assets",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"directory-structure"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[t._v("#")]),t._v(" Directory Structure")]),t._v(" "),s("p",[t._v("To maintain organization and manage these assets effectively, developers typically structure them within dedicated directories in the project's "),s("code",[t._v("Resources\\assets")]),t._v(" directory. For instance:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("/Resources/assets/images")]),t._v(": Stores image files used throughout the application.")]),t._v(" "),s("li",[s("code",[t._v("/Resources/assets/js")]),t._v(": Holds JavaScript files such as "),s("code",[t._v("app.js")]),t._v(" for client-side scripting.")]),t._v(" "),s("li",[s("code",[t._v("/Resources/assets/sass")]),t._v(": Contains CSS files like "),s("code",[t._v("app.css")]),t._v(" for styling the application.")])]),t._v(" "),s("p",[t._v("Here's the updated directory structure:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Resources\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── assets\n ├── css\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("css\n ├── js\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("js\n └── images\n \n")])])]),s("h2",{attrs:{id:"configure-compiling-assets"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#configure-compiling-assets"}},[t._v("#")]),t._v(" Configure Compiling Assets")]),t._v(" "),s("p",[t._v("To compile the assets, perform the following steps:")]),t._v(" "),s("h2",{attrs:{id:"create-configuration-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-files"}},[t._v("#")]),t._v(" Create Configuration Files")]),t._v(" "),s("p",[t._v("First, create the following configuration files in the root directory of your package, specifically inside "),s("code",[t._v("packages/Webkul/Category")]),t._v(":")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("package.json")])]),t._v(" "),s("li",[s("code",[t._v("webpack.mix.js")])])]),t._v(" "),s("h3",{attrs:{id:"set-up-package-json"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#set-up-package-json"}},[t._v("#")]),t._v(" Set Up package.json")]),t._v(" "),s("p",[t._v("Copy and paste the following code into your "),s("code",[t._v("package.json")]),t._v(" file:")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"private"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dev"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"npm run development"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"development"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"watch"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"watch-poll"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch -- --watch-options-poll=1000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hot"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch --hot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prod"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"npm run production"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"production"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix --production"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"axios"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.21.4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cross-env"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^7.0.3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"jquery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^3.6.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^6.0.6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.0.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lodash"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^4.17.19"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"postcss"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^8.1.14"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sass"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.32.8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sass-loader"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^11.0.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.6.12"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-loader"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^15.9.6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-template-compiler"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.6.12"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moment"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.29.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vee-validate"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.2.15"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-cal"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^3.10.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-kanban"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.8.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-timeago"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^5.1.3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vuedraggable"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.24.3"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),s("h4",{attrs:{id:"explanation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("package.json")]),t._v(" file includes the following:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Ensures the package is private and not published to a registry.")])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("Scripts")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("dev: Runs the development script. This command is a shortcut for running npm run development.")])]),t._v(" "),s("li",[s("p",[t._v("development: Executes mix. This typically refers to Laravel Mix, a wrapper around Webpack, to compile and bundle assets in development mode.")])]),t._v(" "),s("li",[s("p",[t._v("watch: Runs mix watch. This command watches for file changes and automatically recompiles assets whenever a change is detected, useful during development for continuous integration of updates.")])]),t._v(" "),s("li",[s("p",[t._v("watch-poll: Runs mix watch with the --watch-options-poll=1000 option. This enables polling for file changes every 1000 milliseconds (1 second), which can be useful in certain development environments where file change notifications are unreliable.")])]),t._v(" "),s("li",[s("p",[t._v("hot: Runs mix watch --hot. This command enables Hot Module Replacement (HMR), allowing modules to be replaced without a full browser refresh, enhancing development experience by maintaining application state.")])]),t._v(" "),s("li",[s("p",[t._v("prod: Runs the production script. This command is a shortcut for running npm run production.")])]),t._v(" "),s("li",[s("p",[t._v("production: Executes mix --production. This compiles and bundles assets for production, typically with optimizations like minification, which makes the assets smaller and faster to load in a production environment.")])])])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("DevDependencies:")]),t._v("\nThe devDependencies section in a package.json file specifies the packages that are required for the development of the application. These dependencies are not included in the production build. Here’s a brief overview of each dependency listed:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("axios: A popular promise-based HTTP client for making requests to servers. It is used to handle HTTP requests and responses.")])]),t._v(" "),s("li",[s("p",[t._v("cross-env: A utility that allows you to set environment variables across different platforms in a consistent way. This is particularly useful for ensuring scripts work across various operating systems.")])]),t._v(" "),s("li",[s("p",[t._v("jquery: A fast, small, and feature-rich JavaScript library. It simplifies things like HTML document traversal and manipulation, event handling, and animation.")])]),t._v(" "),s("li",[s("p",[t._v("laravel-mix: An elegant wrapper around Webpack for the Laravel framework. It simplifies the process of compiling and minifying CSS and JavaScript files.")])]),t._v(" "),s("li",[s("p",[t._v("laravel-mix-merge-manifest: A Laravel Mix extension that merges manifests when you have multiple Mix instances in your project. This is useful for complex projects with multiple entry points.")])]),t._v(" "),s("li",[s("p",[t._v("lodash: A modern JavaScript utility library delivering modularity, performance, and extras. It provides helpful functions for working with arrays, numbers, objects, strings, etc.")])]),t._v(" "),s("li",[s("p",[t._v("postcss: A tool for transforming CSS with JavaScript plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS syntax, inline images, and more.")])]),t._v(" "),s("li",[s("p",[t._v("sass: A preprocessor scripting language that is interpreted or compiled into CSS. It allows you to use features such as variables, nested rules, and mixins.")])]),t._v(" "),s("li",[s("p",[t._v("sass-loader: A loader for Webpack that compiles SCSS or SASS files to CSS. It allows you to use Sass in your Webpack workflow.")])]),t._v(" "),s("li",[s("p",[t._v("vue: A progressive JavaScript framework for building user interfaces. Vue is designed to be incrementally adaptable and focuses on the view layer.")])]),t._v(" "),s("li",[s("p",[t._v("vue-loader: A loader for Webpack that allows you to write Vue components in a single file format, combining HTML, JavaScript, and CSS.")])]),t._v(" "),s("li",[s("p",[t._v("vue-template-compiler: A package used to pre-compile Vue templates into render functions. It is typically used alongside vue-loader to compile Vue components.")])])])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("Dependencies:")]),t._v(" These are essential packages required for the project to function, including:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("moment: A widely-used library for parsing, validating, manipulating, and formatting dates in JavaScript. It simplifies working with dates and times.")])]),t._v(" "),s("li",[s("p",[t._v("vee-validate: A form validation library for Vue.js that allows you to validate form inputs with simple declarative syntax. It helps manage form validation logic and provides user feedback on form errors.")])]),t._v(" "),s("li",[s("p",[t._v("vue-cal: A flexible calendar component for Vue.js. It provides features like multi-range selection, drag-and-drop, and custom event rendering, making it useful for implementing calendar functionality in applications.")])]),t._v(" "),s("li",[s("p",[t._v("vue-kanban: A Kanban board component for Vue.js. It allows you to create and manage tasks in a Kanban-style board, useful for project management and task tracking applications.")])]),t._v(" "),s("li",[s("p",[t._v('vue-timeago: A Vue.js component that automatically updates the display of dates and times to a "time ago" format, such as "3 minutes ago" or "2 days ago". It enhances the user interface by providing relative time formatting.')])]),t._v(" "),s("li",[s("p",[t._v("vuedraggable: A Vue.js component based on the Sortable.js library that enables drag-and-drop functionality. It allows you to create draggable lists and components, enhancing the interactivity of your application.")])])])])]),t._v(" "),s("h3",{attrs:{id:"set-up-webpack-mix-js"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#set-up-webpack-mix-js"}},[t._v("#")]),t._v(" Set Up webpack.mix.js")]),t._v(" "),s("p",[t._v("Here the configuration of webpack.min.js you can customize for your configuration")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'undefined'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'publishable/assets'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../../public/vendor/webkul/category/assets"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPublicPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("publicPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeManifest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("disableNotifications")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("js")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/js/app.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"js/category.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/sass/app.scss"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"css/category.css"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("options")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("processCssUrls")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("vue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("webpackConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("resolve")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("alias")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v("'vue$'")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue/dist/vue.runtime.js'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sourceMaps")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("version")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This script is a configuration file for Laravel Mix, a tool for compiling and optimizing frontend assets in a Laravel application. Let's break down each part of the code:")]),t._v(" "),s("h3",{attrs:{id:"importing-laravel-mix"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#importing-laravel-mix"}},[t._v("#")]),t._v(" Importing Laravel Mix")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'undefined'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This code imports Laravel Mix. The conditional check ensures that "),s("code",[t._v("mix")]),t._v(" is defined, though it's unnecessary here as "),s("code",[t._v("require")]),t._v(" should always return the module correctly.")]),t._v(" "),s("h3",{attrs:{id:"merging-manifests"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#merging-manifests"}},[t._v("#")]),t._v(" Merging Manifests")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("This imports the "),s("code",[t._v("laravel-mix-merge-manifest")]),t._v(" package, which allows merging multiple Mix manifests.")]),t._v(" "),s("h3",{attrs:{id:"setting-the-public-path"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-the-public-path"}},[t._v("#")]),t._v(" Setting the Public Path")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'publishable/assets'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../../public/vendor/webkul/admin/assets"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The "),s("code",[t._v("publicPath")]),t._v(" is set based on whether the build is for production or development. In production, it sets the path to "),s("code",[t._v("publishable/assets")]),t._v(", otherwise, it sets the path to "),s("code",[t._v("../../../public/vendor/webkul/admin/assets")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"mix-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mix-configuration"}},[t._v("#")]),t._v(" Mix Configuration")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPublicPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("publicPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeManifest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("disableNotifications")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("ul",[s("li",[s("p",[t._v("mix.setPublicPath(publicPath): Sets the public directory where the compiled assets will be stored.")])]),t._v(" "),s("li",[s("p",[t._v("mix.mergeManifest(): Merges the Mix manifests.")])]),t._v(" "),s("li",[s("p",[t._v("mix.disableNotifications(): Disables system notifications for the build process.")])])]),t._v(" "),s("h3",{attrs:{id:"asset-compilation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#asset-compilation"}},[t._v("#")]),t._v(" Asset Compilation")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("js")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/js/app.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"js/admin.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/sass/app.scss"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"css/admin.css"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("options")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("processCssUrls")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("vue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])]),s("ul",[s("li",[s("p",[t._v("mix.js(): Compiles the JavaScript file from the specified source to the specified destination.")])]),t._v(" "),s("li",[s("p",[t._v("mix.copy(): Copies image files from the source directory to the public path.")])]),t._v(" "),s("li",[s("p",[t._v("mix.sass(): Compiles the SASS file to CSS.")])]),t._v(" "),s("li",[s("p",[t._v("options({ processCssUrls: false }): Disables the processing of URLs found in CSS files.")])]),t._v(" "),s("li",[s("p",[t._v("vue(): Configures Laravel Mix to handle Vue.js single-file components.")])])]),t._v(" "),s("h3",{attrs:{id:"webpack-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#webpack-configuration"}},[t._v("#")]),t._v(" Webpack Configuration")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("webpackConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("resolve")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("alias")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v("'vue$'")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue/dist/vue.runtime.js'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("This customizes the Webpack configuration. It sets an alias for Vue to use the runtime-only build.")]),t._v(" "),s("h3",{attrs:{id:"source-maps"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#source-maps"}},[t._v("#")]),t._v(" Source Maps")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sourceMaps")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This generates source maps only in non-production environments to help with debugging.")]),t._v(" "),s("h3",{attrs:{id:"versioning"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#versioning"}},[t._v("#")]),t._v(" Versioning")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("version")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This enables versioning in production, appending a unique hash to filenames to help with cache busting.")]),t._v(" "),s("p",[t._v("Overall, this configuration sets up Laravel Mix to handle JavaScript, images, SASS, and Vue.js components, with different behaviors for development and production environments.")]),t._v(" "),s("h2",{attrs:{id:"load-assets-in-blade-file"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#load-assets-in-blade-file"}},[t._v("#")]),t._v(" Load Assets in Blade File")]),t._v(" "),s("p",[t._v("Add the following code to your Blade file to load assets from your package:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("link rel"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"stylesheet"')]),t._v(" href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/ui/assets/css/ui.css') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("link rel"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"stylesheet"')]),t._v(" href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/category/assets/css/category.css') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"text/javascript"')]),t._v(" src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/category/assets/js/category.js') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"text/javascript"')]),t._v(" src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/ui/assets/js/ui.js') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[80],{380:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"bundling-assets"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bundling-assets"}},[t._v("#")]),t._v(" Bundling Assets")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#directory-structure"}},[t._v("Directory Structure")])]),s("li",[s("a",{attrs:{href:"#configure-compiling-assets"}},[t._v("Configure Compiling Assets")])]),s("li",[s("a",{attrs:{href:"#create-configuration-files"}},[t._v("Create Configuration Files")]),s("ul",[s("li",[s("a",{attrs:{href:"#set-up-package-json"}},[t._v("Set Up package.json")])]),s("li",[s("a",{attrs:{href:"#set-up-webpack-mix-js"}},[t._v("Set Up webpack.mix.js")])]),s("li",[s("a",{attrs:{href:"#importing-laravel-mix"}},[t._v("Importing Laravel Mix")])]),s("li",[s("a",{attrs:{href:"#merging-manifests"}},[t._v("Merging Manifests")])]),s("li",[s("a",{attrs:{href:"#setting-the-public-path"}},[t._v("Setting the Public Path")])]),s("li",[s("a",{attrs:{href:"#mix-configuration"}},[t._v("Mix Configuration")])]),s("li",[s("a",{attrs:{href:"#asset-compilation"}},[t._v("Asset Compilation")])]),s("li",[s("a",{attrs:{href:"#webpack-configuration"}},[t._v("Webpack Configuration")])]),s("li",[s("a",{attrs:{href:"#source-maps"}},[t._v("Source Maps")])]),s("li",[s("a",{attrs:{href:"#versioning"}},[t._v("Versioning")])])])]),s("li",[s("a",{attrs:{href:"#load-assets-in-blade-file"}},[t._v("Load Assets in Blade File")])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("Assets in web development refer to files such as stylesheets, scripts, and images that are utilized to enhance the functionality, design, and interactivity of a web application or website. These files are essential for providing styling, behavior, and media content to the user interface.")]),t._v(" "),s("ul",[s("li",[s("strong",[t._v("CSS")]),t._v(": Cascading Style Sheets (CSS) define the presentation and layout of HTML elements, ensuring consistent styling across pages.")]),t._v(" "),s("li",[s("strong",[t._v("JavaScript")]),t._v(": JavaScript (JS) adds interactivity and dynamic behavior to web pages, enabling features like form validation, animations, and AJAX requests.")]),t._v(" "),s("li",[s("strong",[t._v("Images")]),t._v(": Images enhance visual content, including logos, illustrations, and photographs, making web pages more engaging and informative.")])]),t._v(" "),s("p",[t._v("To learn in detail about Bundling Asset, you can visit the Laravel documentation "),s("a",{attrs:{href:"https://laravel.com/docs/10.x/frontend#bundling-assets",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"directory-structure"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[t._v("#")]),t._v(" Directory Structure")]),t._v(" "),s("p",[t._v("To maintain organization and manage these assets effectively, developers typically structure them within dedicated directories in the project's "),s("code",[t._v("Resources\\assets")]),t._v(" directory. For instance:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("/Resources/assets/images")]),t._v(": Stores image files used throughout the application.")]),t._v(" "),s("li",[s("code",[t._v("/Resources/assets/js")]),t._v(": Holds JavaScript files such as "),s("code",[t._v("app.js")]),t._v(" for client-side scripting.")]),t._v(" "),s("li",[s("code",[t._v("/Resources/assets/sass")]),t._v(": Contains CSS files like "),s("code",[t._v("app.css")]),t._v(" for styling the application.")])]),t._v(" "),s("p",[t._v("Here's the updated directory structure:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Resources\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── assets\n ├── css\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("css\n ├── js\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("js\n └── images\n \n")])])]),s("h2",{attrs:{id:"configure-compiling-assets"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#configure-compiling-assets"}},[t._v("#")]),t._v(" Configure Compiling Assets")]),t._v(" "),s("p",[t._v("To compile the assets, perform the following steps:")]),t._v(" "),s("h2",{attrs:{id:"create-configuration-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#create-configuration-files"}},[t._v("#")]),t._v(" Create Configuration Files")]),t._v(" "),s("p",[t._v("First, create the following configuration files in the root directory of your package, specifically inside "),s("code",[t._v("packages/Webkul/Category")]),t._v(":")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("package.json")])]),t._v(" "),s("li",[s("code",[t._v("webpack.mix.js")])])]),t._v(" "),s("h3",{attrs:{id:"set-up-package-json"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#set-up-package-json"}},[t._v("#")]),t._v(" Set Up package.json")]),t._v(" "),s("p",[t._v("Copy and paste the following code into your "),s("code",[t._v("package.json")]),t._v(" file:")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"private"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dev"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"npm run development"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"development"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"watch"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"watch-poll"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch -- --watch-options-poll=1000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hot"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix watch --hot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prod"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"npm run production"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"production"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mix --production"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"axios"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.21.4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cross-env"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^7.0.3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"jquery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^3.6.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^6.0.6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.0.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lodash"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^4.17.19"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"postcss"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^8.1.14"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sass"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.32.8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sass-loader"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^11.0.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.6.12"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-loader"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^15.9.6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-template-compiler"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.6.12"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moment"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.29.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vee-validate"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.2.15"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-cal"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^3.10.1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-kanban"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.8.0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vue-timeago"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^5.1.3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"vuedraggable"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^2.24.3"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),s("h4",{attrs:{id:"explanation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("package.json")]),t._v(" file includes the following:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Ensures the package is private and not published to a registry.")])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("Scripts")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("dev: Runs the development script. This command is a shortcut for running npm run development.")])]),t._v(" "),s("li",[s("p",[t._v("development: Executes mix. This typically refers to Laravel Mix, a wrapper around Webpack, to compile and bundle assets in development mode.")])]),t._v(" "),s("li",[s("p",[t._v("watch: Runs mix watch. This command watches for file changes and automatically recompiles assets whenever a change is detected, useful during development for continuous integration of updates.")])]),t._v(" "),s("li",[s("p",[t._v("watch-poll: Runs mix watch with the --watch-options-poll=1000 option. This enables polling for file changes every 1000 milliseconds (1 second), which can be useful in certain development environments where file change notifications are unreliable.")])]),t._v(" "),s("li",[s("p",[t._v("hot: Runs mix watch --hot. This command enables Hot Module Replacement (HMR), allowing modules to be replaced without a full browser refresh, enhancing development experience by maintaining application state.")])]),t._v(" "),s("li",[s("p",[t._v("prod: Runs the production script. This command is a shortcut for running npm run production.")])]),t._v(" "),s("li",[s("p",[t._v("production: Executes mix --production. This compiles and bundles assets for production, typically with optimizations like minification, which makes the assets smaller and faster to load in a production environment.")])])])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("DevDependencies:")]),t._v("\nThe devDependencies section in a package.json file specifies the packages that are required for the development of the application. These dependencies are not included in the production build. Here’s a brief overview of each dependency listed:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("axios: A popular promise-based HTTP client for making requests to servers. It is used to handle HTTP requests and responses.")])]),t._v(" "),s("li",[s("p",[t._v("cross-env: A utility that allows you to set environment variables across different platforms in a consistent way. This is particularly useful for ensuring scripts work across various operating systems.")])]),t._v(" "),s("li",[s("p",[t._v("jquery: A fast, small, and feature-rich JavaScript library. It simplifies things like HTML document traversal and manipulation, event handling, and animation.")])]),t._v(" "),s("li",[s("p",[t._v("laravel-mix: An elegant wrapper around Webpack for the Laravel framework. It simplifies the process of compiling and minifying CSS and JavaScript files.")])]),t._v(" "),s("li",[s("p",[t._v("laravel-mix-merge-manifest: A Laravel Mix extension that merges manifests when you have multiple Mix instances in your project. This is useful for complex projects with multiple entry points.")])]),t._v(" "),s("li",[s("p",[t._v("lodash: A modern JavaScript utility library delivering modularity, performance, and extras. It provides helpful functions for working with arrays, numbers, objects, strings, etc.")])]),t._v(" "),s("li",[s("p",[t._v("postcss: A tool for transforming CSS with JavaScript plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS syntax, inline images, and more.")])]),t._v(" "),s("li",[s("p",[t._v("sass: A preprocessor scripting language that is interpreted or compiled into CSS. It allows you to use features such as variables, nested rules, and mixins.")])]),t._v(" "),s("li",[s("p",[t._v("sass-loader: A loader for Webpack that compiles SCSS or SASS files to CSS. It allows you to use Sass in your Webpack workflow.")])]),t._v(" "),s("li",[s("p",[t._v("vue: A progressive JavaScript framework for building user interfaces. Vue is designed to be incrementally adaptable and focuses on the view layer.")])]),t._v(" "),s("li",[s("p",[t._v("vue-loader: A loader for Webpack that allows you to write Vue components in a single file format, combining HTML, JavaScript, and CSS.")])]),t._v(" "),s("li",[s("p",[t._v("vue-template-compiler: A package used to pre-compile Vue templates into render functions. It is typically used alongside vue-loader to compile Vue components.")])])])]),t._v(" "),s("li",[s("p",[s("strong",[t._v("Dependencies:")]),t._v(" These are essential packages required for the project to function, including:")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("moment: A widely-used library for parsing, validating, manipulating, and formatting dates in JavaScript. It simplifies working with dates and times.")])]),t._v(" "),s("li",[s("p",[t._v("vee-validate: A form validation library for Vue.js that allows you to validate form inputs with simple declarative syntax. It helps manage form validation logic and provides user feedback on form errors.")])]),t._v(" "),s("li",[s("p",[t._v("vue-cal: A flexible calendar component for Vue.js. It provides features like multi-range selection, drag-and-drop, and custom event rendering, making it useful for implementing calendar functionality in applications.")])]),t._v(" "),s("li",[s("p",[t._v("vue-kanban: A Kanban board component for Vue.js. It allows you to create and manage tasks in a Kanban-style board, useful for project management and task tracking applications.")])]),t._v(" "),s("li",[s("p",[t._v('vue-timeago: A Vue.js component that automatically updates the display of dates and times to a "time ago" format, such as "3 minutes ago" or "2 days ago". It enhances the user interface by providing relative time formatting.')])]),t._v(" "),s("li",[s("p",[t._v("vuedraggable: A Vue.js component based on the Sortable.js library that enables drag-and-drop functionality. It allows you to create draggable lists and components, enhancing the interactivity of your application.")])])])])]),t._v(" "),s("h3",{attrs:{id:"set-up-webpack-mix-js"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#set-up-webpack-mix-js"}},[t._v("#")]),t._v(" Set Up webpack.mix.js")]),t._v(" "),s("p",[t._v("Here the configuration of webpack.min.js you can customize for your configuration")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'undefined'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'publishable/assets'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../../public/vendor/webkul/category/assets"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPublicPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("publicPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeManifest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("disableNotifications")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("js")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/js/app.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"js/category.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/sass/app.scss"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"css/category.css"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("options")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("processCssUrls")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("vue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("webpackConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("resolve")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("alias")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v("'vue$'")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue/dist/vue.runtime.js'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sourceMaps")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("version")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This script is a configuration file for Laravel Mix, a tool for compiling and optimizing frontend assets in a Laravel application. Let's break down each part of the code:")]),t._v(" "),s("h3",{attrs:{id:"importing-laravel-mix"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#importing-laravel-mix"}},[t._v("#")]),t._v(" Importing Laravel Mix")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'undefined'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mix "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This code imports Laravel Mix. The conditional check ensures that "),s("code",[t._v("mix")]),t._v(" is defined, though it's unnecessary here as "),s("code",[t._v("require")]),t._v(" should always return the module correctly.")]),t._v(" "),s("h3",{attrs:{id:"merging-manifests"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#merging-manifests"}},[t._v("#")]),t._v(" Merging Manifests")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"laravel-mix-merge-manifest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("This imports the "),s("code",[t._v("laravel-mix-merge-manifest")]),t._v(" package, which allows merging multiple Mix manifests.")]),t._v(" "),s("h3",{attrs:{id:"setting-the-public-path"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-the-public-path"}},[t._v("#")]),t._v(" Setting the Public Path")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'publishable/assets'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../../public/vendor/webkul/admin/assets"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The "),s("code",[t._v("publicPath")]),t._v(" is set based on whether the build is for production or development. In production, it sets the path to "),s("code",[t._v("publishable/assets")]),t._v(", otherwise, it sets the path to "),s("code",[t._v("../../../public/vendor/webkul/admin/assets")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"mix-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mix-configuration"}},[t._v("#")]),t._v(" Mix Configuration")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPublicPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("publicPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mergeManifest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("disableNotifications")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("ul",[s("li",[s("p",[t._v("mix.setPublicPath(publicPath): Sets the public directory where the compiled assets will be stored.")])]),t._v(" "),s("li",[s("p",[t._v("mix.mergeManifest(): Merges the Mix manifests.")])]),t._v(" "),s("li",[s("p",[t._v("mix.disableNotifications(): Disables system notifications for the build process.")])])]),t._v(" "),s("h3",{attrs:{id:"asset-compilation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#asset-compilation"}},[t._v("#")]),t._v(" Asset Compilation")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("js")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/js/app.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"js/admin.js"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" publicPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/images"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/src/Resources/assets/sass/app.scss"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"css/admin.css"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("options")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("processCssUrls")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("vue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])]),s("ul",[s("li",[s("p",[t._v("mix.js(): Compiles the JavaScript file from the specified source to the specified destination.")])]),t._v(" "),s("li",[s("p",[t._v("mix.copy(): Copies image files from the source directory to the public path.")])]),t._v(" "),s("li",[s("p",[t._v("mix.sass(): Compiles the SASS file to CSS.")])]),t._v(" "),s("li",[s("p",[t._v("options({ processCssUrls: false }): Disables the processing of URLs found in CSS files.")])]),t._v(" "),s("li",[s("p",[t._v("vue(): Configures Laravel Mix to handle Vue.js single-file components.")])])]),t._v(" "),s("h3",{attrs:{id:"webpack-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#webpack-configuration"}},[t._v("#")]),t._v(" Webpack Configuration")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("webpackConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("resolve")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("alias")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string-property property"}},[t._v("'vue$'")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue/dist/vue.runtime.js'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("This customizes the Webpack configuration. It sets an alias for Vue to use the runtime-only build.")]),t._v(" "),s("h3",{attrs:{id:"source-maps"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#source-maps"}},[t._v("#")]),t._v(" Source Maps")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sourceMaps")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This generates source maps only in non-production environments to help with debugging.")]),t._v(" "),s("h3",{attrs:{id:"versioning"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#versioning"}},[t._v("#")]),t._v(" Versioning")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("inProduction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n mix"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("version")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This enables versioning in production, appending a unique hash to filenames to help with cache busting.")]),t._v(" "),s("p",[t._v("Overall, this configuration sets up Laravel Mix to handle JavaScript, images, SASS, and Vue.js components, with different behaviors for development and production environments.")]),t._v(" "),s("h2",{attrs:{id:"load-assets-in-blade-file"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#load-assets-in-blade-file"}},[t._v("#")]),t._v(" Load Assets in Blade File")]),t._v(" "),s("p",[t._v("Add the following code to your Blade file to load assets from your package:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("link rel"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"stylesheet"')]),t._v(" href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/ui/assets/css/ui.css') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("link rel"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"stylesheet"')]),t._v(" href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/category/assets/css/category.css') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"text/javascript"')]),t._v(" src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/category/assets/js/category.js') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"text/javascript"')]),t._v(" src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ asset('vendor/webkul/ui/assets/js/ui.js') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/82.830c1ccd.js b/assets/js/82.d05c3f26.js similarity index 99% rename from assets/js/82.830c1ccd.js rename to assets/js/82.d05c3f26.js index 9b36014..5384598 100644 --- a/assets/js/82.830c1ccd.js +++ b/assets/js/82.d05c3f26.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[82],{380:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"controller"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#controller"}},[t._v("#")]),t._v(" Controller")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#how-to-create-controllers"}},[t._v("How to create Controllers")]),a("ul",[a("li",[a("a",{attrs:{href:"#directory-structure"}},[t._v("Directory Structure")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("In Laravel, controllers are responsible for handling the request logic of an application. They act as intermediaries between the models and views, processing user input, interacting with the data layer, and returning the appropriate responses. By organizing related request handling logic into separate classes, controllers make it easier to manage and maintain the application's codebase.")]),t._v(" "),a("p",[t._v("To learn in detail about Controllers, you can visit the Laravel documentation "),a("a",{attrs:{href:"https://laravel.com/docs/11.x/controllers",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"how-to-create-controllers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#how-to-create-controllers"}},[t._v("#")]),t._v(" How to create Controllers")]),t._v(" "),a("p",[t._v('To start building a controller for our category within the Laravel package named "Category," follow the steps below:')]),t._v(" "),a("h3",{attrs:{id:"directory-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[t._v("#")]),t._v(" Directory Structure")]),t._v(" "),a("p",[t._v("Create the necessary directory structure within the "),a("code",[t._v("packages/Webkul/Category/src")]),t._v(" path. To create the directory structure follow the following steps:")]),t._v(" "),a("ol",[a("li",[t._v("Navigate to the "),a("code",[t._v("packages/Webkul/Category/src")]),t._v(" directory.")]),t._v(" "),a("li",[t._v("Create an "),a("code",[t._v("Http")]),t._v(" directory inside "),a("code",[t._v("src")]),t._v(".")]),t._v(" "),a("li",[t._v("Inside the "),a("code",[t._v("Http")]),t._v(" directory, create another directory named "),a("code",[t._v("Controllers")]),t._v(".")]),t._v(" "),a("li",[t._v("Inside the "),a("code",[t._v("Controllers")]),t._v(" directory, create base controller named "),a("code",[t._v("Controller.php")]),t._v(" which is extends the "),a("code",[t._v("Laravel")]),t._v(" core controller:")])]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("view")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::admin.index'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compact")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Category details.\n * \n * @return \\Illuminate\\View\\View\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("show")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),a("p",[t._v("The Updated directory structure will look like this.")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Http\n └── Controllers\n ├── Controller"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n └── Category\n └── CategoryController"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),a("p",[t._v('By following these steps, you will have created the necessary structure and files for handling category within your "Category" package. You can now add the specific logic for each method to handle the functionality required for your category into the admin.')])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[82],{378:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"controller"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#controller"}},[t._v("#")]),t._v(" Controller")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#how-to-create-controllers"}},[t._v("How to create Controllers")]),a("ul",[a("li",[a("a",{attrs:{href:"#directory-structure"}},[t._v("Directory Structure")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("In Laravel, controllers are responsible for handling the request logic of an application. They act as intermediaries between the models and views, processing user input, interacting with the data layer, and returning the appropriate responses. By organizing related request handling logic into separate classes, controllers make it easier to manage and maintain the application's codebase.")]),t._v(" "),a("p",[t._v("To learn in detail about Controllers, you can visit the Laravel documentation "),a("a",{attrs:{href:"https://laravel.com/docs/11.x/controllers",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"how-to-create-controllers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#how-to-create-controllers"}},[t._v("#")]),t._v(" How to create Controllers")]),t._v(" "),a("p",[t._v('To start building a controller for our category within the Laravel package named "Category," follow the steps below:')]),t._v(" "),a("h3",{attrs:{id:"directory-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[t._v("#")]),t._v(" Directory Structure")]),t._v(" "),a("p",[t._v("Create the necessary directory structure within the "),a("code",[t._v("packages/Webkul/Category/src")]),t._v(" path. To create the directory structure follow the following steps:")]),t._v(" "),a("ol",[a("li",[t._v("Navigate to the "),a("code",[t._v("packages/Webkul/Category/src")]),t._v(" directory.")]),t._v(" "),a("li",[t._v("Create an "),a("code",[t._v("Http")]),t._v(" directory inside "),a("code",[t._v("src")]),t._v(".")]),t._v(" "),a("li",[t._v("Inside the "),a("code",[t._v("Http")]),t._v(" directory, create another directory named "),a("code",[t._v("Controllers")]),t._v(".")]),t._v(" "),a("li",[t._v("Inside the "),a("code",[t._v("Controllers")]),t._v(" directory, create base controller named "),a("code",[t._v("Controller.php")]),t._v(" which is extends the "),a("code",[t._v("Laravel")]),t._v(" core controller:")])]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("categoryRepository")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("view")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::admin.index'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compact")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Category details.\n * \n * @return \\Illuminate\\View\\View\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("show")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword type-hint"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$id")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),a("p",[t._v("The Updated directory structure will look like this.")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Http\n └── Controllers\n ├── Controller"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n └── Category\n └── CategoryController"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),a("p",[t._v('By following these steps, you will have created the necessary structure and files for handling category within your "Category" package. You can now add the specific logic for each method to handle the functionality required for your category into the admin.')])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/84.4f0b2bb7.js b/assets/js/84.54b6f5a1.js similarity index 99% rename from assets/js/84.4f0b2bb7.js rename to assets/js/84.54b6f5a1.js index ab76e68..bf610e2 100644 --- a/assets/js/84.4f0b2bb7.js +++ b/assets/js/84.54b6f5a1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[84],{383:function(a,t,s){"use strict";s.r(t);var n=s(10),e=Object(n.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#migrations"}},[a._v("#")]),a._v(" Migrations")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[a._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[a._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#loading-migration-from-package"}},[a._v("Loading Migration from Package")])]),t("li",[t("a",{attrs:{href:"#creating-tables-from-migrations"}},[a._v("Creating Tables from Migrations")])])])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),t("p",[a._v("Migrations are like version control for your database, allowing your team to define and share the application's database schema definition.")]),a._v(" "),t("p",[a._v("Krayin leverages the Laravel Schema facade to offer database-agnostic support for creating and manipulating tables across various database systems supported by Laravel. Migrations in Krayin utilize this powerful feature to manage database schema changes efficiently.")]),a._v(" "),t("p",[a._v("To understand Migrations in detail, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/10.x/migrations",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),t("OutboundLink")],1),a._v(".")]),a._v(" "),t("p",[a._v("Let's create a new migration file for your application. We will assume that the package name is \""),t("strong",[a._v("Category")]),a._v('". Follow these steps:')]),a._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[a._v("#")]),a._v(" Using Krayin Package Generator")]),a._v(" "),t("p",[a._v("This command creates a new migration class in the "),t("strong",[t("code",[a._v("packages/Webkul/Category/src/Database/Migrations")])]),a._v(" directory.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan package:make-migration CreateCategoryTable Webkul/Category\n")])])]),t("ul",[t("li",[t("code",[a._v("CreateCategoryTable")]),a._v(" Specifies the name of the migration file.")]),a._v(" "),t("li",[t("code",[a._v("Webkul/Category")]),a._v(" Specifies the package name")])]),a._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[a._v("#")]),a._v(" Using Laravel Artisan Command")]),a._v(" "),t("p",[a._v("Create a "),t("code",[a._v("Database")]),a._v(" directory in the "),t("code",[a._v("packages/Webkul/Category/src")]),a._v(" path. Inside the "),t("code",[a._v("Database")]),a._v(" directory, create "),t("code",[a._v("Migrations")]),a._v(" and "),t("code",[a._v("Seeders")]),a._v(" directories.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Database\n ├── Migrations\n └── Seeders\n")])])]),t("p",[a._v("Run the following command with the "),t("code",[a._v("--path")]),a._v(" option to specify where your migration file will be placed.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan make:migration create_categories_table "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("packages/Webkul/Category/src/Database/Migrations\n")])])]),t("p",[a._v("To create a new database table Copy the code provided here and paste it into your migration file. The create method used on the Schema facade. The create method accepts two arguments: the first is the name of the table, while the second is a closure which receives a Blueprint object that may be used to define the new table:")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("integer")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'parent_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token keyword type-declaration"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("longText")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'description'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("tinyInteger")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("default")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("timestamps")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/**\n * Reverse the migrations.\n *\n * @return void\n */")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("function")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[a._v("down")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[a._v("Schema")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("dropIfExists")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),t("h3",{attrs:{id:"loading-migration-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#loading-migration-from-package"}},[a._v("#")]),a._v(" Loading Migration from Package")]),a._v(" "),t("p",[a._v("We need to add the migrations to our service provider to load them.")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadMigrationsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Database/Migrations'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),t("h3",{attrs:{id:"creating-tables-from-migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-tables-from-migrations"}},[a._v("#")]),a._v(" Creating Tables from Migrations")]),a._v(" "),t("p",[a._v("Run the following command to create the "),t("strong",[t("code",[a._v("Category")])]),a._v(" table in your database.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("php artisan migrate\n")])])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[84],{382:function(a,t,s){"use strict";s.r(t);var n=s(10),e=Object(n.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#migrations"}},[a._v("#")]),a._v(" Migrations")]),a._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[a._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[a._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#loading-migration-from-package"}},[a._v("Loading Migration from Package")])]),t("li",[t("a",{attrs:{href:"#creating-tables-from-migrations"}},[a._v("Creating Tables from Migrations")])])])])])]),t("p"),a._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),t("p",[a._v("Migrations are like version control for your database, allowing your team to define and share the application's database schema definition.")]),a._v(" "),t("p",[a._v("Krayin leverages the Laravel Schema facade to offer database-agnostic support for creating and manipulating tables across various database systems supported by Laravel. Migrations in Krayin utilize this powerful feature to manage database schema changes efficiently.")]),a._v(" "),t("p",[a._v("To understand Migrations in detail, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/10.x/migrations",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),t("OutboundLink")],1),a._v(".")]),a._v(" "),t("p",[a._v("Let's create a new migration file for your application. We will assume that the package name is \""),t("strong",[a._v("Category")]),a._v('". Follow these steps:')]),a._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[a._v("#")]),a._v(" Using Krayin Package Generator")]),a._v(" "),t("p",[a._v("This command creates a new migration class in the "),t("strong",[t("code",[a._v("packages/Webkul/Category/src/Database/Migrations")])]),a._v(" directory.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan package:make-migration CreateCategoryTable Webkul/Category\n")])])]),t("ul",[t("li",[t("code",[a._v("CreateCategoryTable")]),a._v(" Specifies the name of the migration file.")]),a._v(" "),t("li",[t("code",[a._v("Webkul/Category")]),a._v(" Specifies the package name")])]),a._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[a._v("#")]),a._v(" Using Laravel Artisan Command")]),a._v(" "),t("p",[a._v("Create a "),t("code",[a._v("Database")]),a._v(" directory in the "),t("code",[a._v("packages/Webkul/Category/src")]),a._v(" path. Inside the "),t("code",[a._v("Database")]),a._v(" directory, create "),t("code",[a._v("Migrations")]),a._v(" and "),t("code",[a._v("Seeders")]),a._v(" directories.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── Database\n ├── Migrations\n └── Seeders\n")])])]),t("p",[a._v("Run the following command with the "),t("code",[a._v("--path")]),a._v(" option to specify where your migration file will be placed.")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[a._v("php artisan make:migration create_categories_table "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("packages/Webkul/Category/src/Database/Migrations\n")])])]),t("p",[a._v("To create a new database table Copy the code provided here and paste it into your migration file. The create method used on the Schema facade. The create method accepts two arguments: the first is the name of the table, while the second is a closure which receives a Blueprint object that may be used to define the new table:")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("id")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("integer")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'parent_id'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token keyword type-declaration"}},[a._v("string")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("longText")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'description'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("nullable")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("tinyInteger")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'status'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("default")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$table")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("timestamps")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/**\n * Reverse the migrations.\n *\n * @return void\n */")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("function")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[a._v("down")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[a._v("Schema")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("::")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("dropIfExists")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),t("h3",{attrs:{id:"loading-migration-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#loading-migration-from-package"}},[a._v("#")]),a._v(" Loading Migration from Package")]),a._v(" "),t("p",[a._v("We need to add the migrations to our service provider to load them.")]),a._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadMigrationsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Database/Migrations'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),t("h3",{attrs:{id:"creating-tables-from-migrations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-tables-from-migrations"}},[a._v("#")]),a._v(" Creating Tables from Migrations")]),a._v(" "),t("p",[a._v("Run the following command to create the "),t("strong",[t("code",[a._v("Category")])]),a._v(" table in your database.")]),a._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[a._v("php artisan migrate\n")])])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/85.a920e252.js b/assets/js/85.2a3d5a8a.js similarity index 99% rename from assets/js/85.a920e252.js rename to assets/js/85.2a3d5a8a.js index 5b27b36..44fe9c1 100644 --- a/assets/js/85.a920e252.js +++ b/assets/js/85.2a3d5a8a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[85],{382:function(e,t,a){"use strict";a.r(t);var s=a(10),n=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#models"}},[e._v("#")]),e._v(" Models")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[e._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[e._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#create-the-contract"}},[e._v("Create the Contract")])]),t("li",[t("a",{attrs:{href:"#create-the-proxy"}},[e._v("Create the Proxy")])]),t("li",[t("a",{attrs:{href:"#create-the-model"}},[e._v("Create the Model")])]),t("li",[t("a",{attrs:{href:"#create-module-service-provider"}},[e._v("Create Module Service Provider")])]),t("li",[t("a",{attrs:{href:"#registering-moduleserviceprovider"}},[e._v("Registering ModuleServiceProvider")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v('Laravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using Eloquent, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.\nTo understand Models in detail, you can visit the Laravel documentation '),t("a",{attrs:{href:"https://laravel.com/docs/10.x/eloquent",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We are using the "),t("a",{attrs:{href:"https://packagist.org/packages/konekt/concord",target:"_blank",rel:"noopener noreferrer"}},[e._v("konekt/concord"),t("OutboundLink")],1),e._v(" package, which is an extension of Laravel. It helps in building modular Laravel applications.")]),e._v(" "),t("p",[e._v("Let's create a new model for your application. We will assume that the package name is \""),t("strong",[e._v("Category")]),e._v('". Follow these steps:')]),e._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[e._v("#")]),e._v(" Using Krayin Package Generator")]),e._v(" "),t("p",[e._v("To create a new "),t("code",[e._v("Category")]),e._v(" Model inside your package using the Krayin Package Generator, follow these steps")]),e._v(" "),t("p",[e._v("Execute the following command in your terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-model Category Webkul/Category\n")])])]),t("p",[e._v("This command creates the following files:")]),e._v(" "),t("ul",[t("li",[e._v("New model "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model proxy "),t("strong",[t("code",[e._v("CategoryProxy.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model contract "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Contracts")])]),e._v(" directory.")])]),e._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[e._v("#")]),e._v(" Using Laravel Artisan Command")]),e._v(" "),t("p",[e._v("Before creating the model class, it's essential to create two additional components: the "),t("code",[e._v("Contract")]),e._v(" and the "),t("code",[e._v("Proxy")]),e._v(".")]),e._v(" "),t("h3",{attrs:{id:"create-the-contract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-contract"}},[e._v("#")]),e._v(" Create the Contract")]),e._v(" "),t("p",[e._v("Laravel's Contracts are a set of interfaces that define the core services provided by the framework. For example, the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Queue\\Queue")])]),e._v(" contract defines the methods needed for queueing jobs, while the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Mail\\Mailer")])]),e._v(" contract defines the methods needed for sending an email.")]),e._v(" "),t("p",[e._v("Each contract has a corresponding implementation provided by the framework. For example, Laravel provides a queue implementation with various drivers and a mailer implementation powered by SwiftMailer.")]),e._v(" "),t("p",[e._v("All Laravel contracts are stored in their own GitHub repository. This provides a quick reference for all available contracts and a single, decoupled package that can be used by package developers.")]),e._v(" "),t("p",[e._v("Now, create a directory named "),t("strong",[t("code",[e._v("Contracts")])]),e._v(" inside "),t("strong",[t("code",[e._v("Webkul/Category/src/")])]),e._v(" and create an interface file named "),t("strong",[t("code",[e._v("Category.php")])]),e._v(".")]),e._v(" "),t("div",{staticClass:"language-structure extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("packages\n└── Webkul\n └── Category\n └── src\n └── Contracts\n └── Category.php\n")])])]),t("p",[e._v("Copy the following code into the "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" file.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// Other service providers")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Category"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Providers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("ModuleServiceProvider")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[85],{383:function(e,t,a){"use strict";a.r(t);var s=a(10),n=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"models"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#models"}},[e._v("#")]),e._v(" Models")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#using-krayin-package-generator"}},[e._v("Using Krayin Package Generator")])]),t("li",[t("a",{attrs:{href:"#using-laravel-artisan-command"}},[e._v("Using Laravel Artisan Command")]),t("ul",[t("li",[t("a",{attrs:{href:"#create-the-contract"}},[e._v("Create the Contract")])]),t("li",[t("a",{attrs:{href:"#create-the-proxy"}},[e._v("Create the Proxy")])]),t("li",[t("a",{attrs:{href:"#create-the-model"}},[e._v("Create the Model")])]),t("li",[t("a",{attrs:{href:"#create-module-service-provider"}},[e._v("Create Module Service Provider")])]),t("li",[t("a",{attrs:{href:"#registering-moduleserviceprovider"}},[e._v("Registering ModuleServiceProvider")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v('Laravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using Eloquent, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.\nTo understand Models in detail, you can visit the Laravel documentation '),t("a",{attrs:{href:"https://laravel.com/docs/10.x/eloquent",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("We are using the "),t("a",{attrs:{href:"https://packagist.org/packages/konekt/concord",target:"_blank",rel:"noopener noreferrer"}},[e._v("konekt/concord"),t("OutboundLink")],1),e._v(" package, which is an extension of Laravel. It helps in building modular Laravel applications.")]),e._v(" "),t("p",[e._v("Let's create a new model for your application. We will assume that the package name is \""),t("strong",[e._v("Category")]),e._v('". Follow these steps:')]),e._v(" "),t("h2",{attrs:{id:"using-krayin-package-generator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[e._v("#")]),e._v(" Using Krayin Package Generator")]),e._v(" "),t("p",[e._v("To create a new "),t("code",[e._v("Category")]),e._v(" Model inside your package using the Krayin Package Generator, follow these steps")]),e._v(" "),t("p",[e._v("Execute the following command in your terminal:")]),e._v(" "),t("div",{staticClass:"language-sh extra-class"},[t("pre",{pre:!0,attrs:{class:"language-sh"}},[t("code",[e._v("php artisan package:make-model Category Webkul/Category\n")])])]),t("p",[e._v("This command creates the following files:")]),e._v(" "),t("ul",[t("li",[e._v("New model "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model proxy "),t("strong",[t("code",[e._v("CategoryProxy.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Models")])]),e._v(" directory.")]),e._v(" "),t("li",[e._v("New model contract "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" in the "),t("strong",[t("code",[e._v("packages/Webkul/Category/src/Contracts")])]),e._v(" directory.")])]),e._v(" "),t("h2",{attrs:{id:"using-laravel-artisan-command"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#using-laravel-artisan-command"}},[e._v("#")]),e._v(" Using Laravel Artisan Command")]),e._v(" "),t("p",[e._v("Before creating the model class, it's essential to create two additional components: the "),t("code",[e._v("Contract")]),e._v(" and the "),t("code",[e._v("Proxy")]),e._v(".")]),e._v(" "),t("h3",{attrs:{id:"create-the-contract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-contract"}},[e._v("#")]),e._v(" Create the Contract")]),e._v(" "),t("p",[e._v("Laravel's Contracts are a set of interfaces that define the core services provided by the framework. For example, the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Queue\\Queue")])]),e._v(" contract defines the methods needed for queueing jobs, while the "),t("strong",[t("code",[e._v("Illuminate\\Contracts\\Mail\\Mailer")])]),e._v(" contract defines the methods needed for sending an email.")]),e._v(" "),t("p",[e._v("Each contract has a corresponding implementation provided by the framework. For example, Laravel provides a queue implementation with various drivers and a mailer implementation powered by SwiftMailer.")]),e._v(" "),t("p",[e._v("All Laravel contracts are stored in their own GitHub repository. This provides a quick reference for all available contracts and a single, decoupled package that can be used by package developers.")]),e._v(" "),t("p",[e._v("Now, create a directory named "),t("strong",[t("code",[e._v("Contracts")])]),e._v(" inside "),t("strong",[t("code",[e._v("Webkul/Category/src/")])]),e._v(" and create an interface file named "),t("strong",[t("code",[e._v("Category.php")])]),e._v(".")]),e._v(" "),t("div",{staticClass:"language-structure extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("packages\n└── Webkul\n └── Category\n └── src\n └── Contracts\n └── Category.php\n")])])]),t("p",[e._v("Copy the following code into the "),t("strong",[t("code",[e._v("Category.php")])]),e._v(" file.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// Other service providers")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Webkul"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Category"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("Providers"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("ModuleServiceProvider")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/86.f56488fd.js b/assets/js/86.f56488fd.js new file mode 100644 index 0000000..54c3ac5 --- /dev/null +++ b/assets/js/86.f56488fd.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[86],{384:function(t,a,e){"use strict";e.r(a);var s=e(10),r=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"getting-started"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#prerequisites"}},[t._v("Prerequisites")])]),a("li",[a("a",{attrs:{href:"#using-krayin-package-generator"}},[t._v("Using Krayin Package Generator")]),a("ul",[a("li",[a("a",{attrs:{href:"#registering-your-package"}},[t._v("Registering Your Package")])]),a("li",[a("a",{attrs:{href:"#registering-your-package-using-cli"}},[t._v("Registering Your Package Using CLI")])]),a("li",[a("a",{attrs:{href:"#run-the-commands"}},[t._v("Run the Commands")])])])]),a("li",[a("a",{attrs:{href:"#manual-setup-of-files"}},[t._v("Manual Setup of Files")]),a("ul",[a("li",[a("a",{attrs:{href:"#create-package-directory"}},[t._v("Create Package Directory")])]),a("li",[a("a",{attrs:{href:"#create-service-provider"}},[t._v("Create Service Provider")])]),a("li",[a("a",{attrs:{href:"#register-your-package"}},[t._v("Register Your Package")])]),a("li",[a("a",{attrs:{href:"#run-the-commands"}},[t._v("Run the Commands")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("A package is a self-contained module that encapsulates specific features or functionality, allowing developers to add custom features without altering the core codebase. This approach not only preserves the integrity of the core system but also ensures that updates and maintenance can be carried out smoothly.")]),t._v(" "),a("p",[t._v("By developing packages, you can introduce new functionalities, integrate third-party services, or customize existing features to better meet your business requirements. Each package is isolated, promoting clean code practices and enabling easier debugging and testing.")]),t._v(" "),a("p",[t._v("This guide will take you through the process of creating a package for Krayin, from setting up the directory structure to defining configurations, routes, controllers, models, and views. By the end of this guide, you will have a solid understanding of how to develop and integrate packages into the Krayin platform, enhancing its capabilities while maintaining a robust and maintainable codebase.")]),t._v(" "),a("h2",{attrs:{id:"prerequisites"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisites"}},[t._v("#")]),t._v(" Prerequisites")]),t._v(" "),a("ul",[a("li",[t._v("A working Krayin application")]),t._v(" "),a("li",[t._v("Composer installed")])]),t._v(" "),a("h2",{attrs:{id:"using-krayin-package-generator"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-krayin-package-generator"}},[t._v("#")]),t._v(" Using Krayin Package Generator")]),t._v(" "),a("p",[t._v("To facilitate package development, you can use the "),a("a",{attrs:{href:"https://github.com/krayin/laravel-crm-package-generator",target:"_blank",rel:"noopener noreferrer"}},[t._v("Krayin Package Generator"),a("OutboundLink")],1),t._v(". Follow the steps below to install it:")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Install the Krayin Package Generator by running the following command in the root directory of your Krayin application:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" require krayin/krayin-package-generator\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Once installed, you can generate your package using the following command:")]),t._v(" "),a("p",[t._v('We will assume that the package name is "'),a("strong",[t._v("Category")]),t._v('".')]),t._v(" "),a("ul",[a("li",[t._v("If the package directory does not exist:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("php artisan package:make Webkul/Category\n")])])]),a("ul",[a("li",[t._v("If the package directory already exists, you can use the "),a("strong",[a("code",[t._v("--force")])]),t._v(" option to overwrite it:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("php artisan package:make Webkul/Category "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--force")]),t._v("\n")])])]),a("p",[t._v("This command will set up the necessary files and directories in the "),a("strong",[a("code",[t._v("packages")])]),t._v(" directory.")])])]),t._v(" "),a("h3",{attrs:{id:"registering-your-package"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#registering-your-package"}},[t._v("#")]),t._v(" Registering Your Package")]),t._v(" "),a("p",[t._v("To register your package, follow these steps:")]),t._v(" "),a("p",[t._v("Add your package's namespace to the "),a("strong",[a("code",[t._v("psr-4")])]),t._v(" section in the "),a("strong",[a("code",[t._v("composer.json")])]),t._v(" file located in the root directory of your Krayin application. Update it as follows:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"autoload"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ...\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"psr-4"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Webkul\\\\Category\\\\"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"packages/Webkul/Category/src"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n ...\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Register your package's service provider in the "),a("strong",[a("code",[t._v("config/app.php")])]),t._v(" file located in the root directory of your Krayin application. Add the following line to the "),a("strong",[a("code",[t._v("providers")])]),t._v(" array:")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("defaultProviders")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("merge")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Other service providers")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Other configuration options")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),a("h3",{attrs:{id:"registering-your-package-using-cli"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#registering-your-package-using-cli"}},[t._v("#")]),t._v(" Registering Your Package Using CLI")]),t._v(" "),a("h4",{attrs:{id:"step-1-verify-the-composer-json-file"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-1-verify-the-composer-json-file"}},[t._v("#")]),t._v(" Step 1: Verify the "),a("code",[t._v("composer.json")]),t._v(" File")]),t._v(" "),a("p",[t._v("Before proceeding, ensure that your package has a valid "),a("code",[t._v("composer.json")]),t._v(" file. This file defines your package's configuration and dependencies. Below is an example of what the "),a("code",[t._v("composer.json")]),t._v(" file for "),a("code",[t._v("krayin/laravel-admin")]),t._v(" should look like:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"krayin/laravel-admin"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"license"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MIT"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"authors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Example"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"email"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admin@example.com"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"autoload"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"psr-4"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Webkul\\\\Admin\\\\"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"src/"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extra"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"laravel"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"providers"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Webkul\\\\Admin\\\\Providers\\\\AdminServiceProvider"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"aliases"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minimum-stability"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dev"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"key-elements-of-the-composer-json-file"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#key-elements-of-the-composer-json-file"}},[t._v("#")]),t._v(" Key Elements of the "),a("code",[t._v("composer.json")]),t._v(" File")]),t._v(" "),a("ul",[a("li",[a("strong",[t._v("Package Name:")]),t._v(" "),a("code",[t._v('"krayin/laravel-admin"')]),t._v(" – The name of the package to be installed.")]),t._v(" "),a("li",[a("strong",[t._v("License:")]),t._v(" "),a("code",[t._v('"MIT"')]),t._v(" – Defines the license for the package.")]),t._v(" "),a("li",[a("strong",[t._v("Authors:")]),t._v(" Information about the package authors, such as name and email.")]),t._v(" "),a("li",[a("strong",[t._v("Autoloading:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v('"psr-4"')]),t._v(" autoloading is used to map the "),a("code",[t._v("Webkul\\Admin")]),t._v(" namespace to the "),a("code",[t._v("src/")]),t._v(" directory.")])])]),t._v(" "),a("li",[a("strong",[t._v("Providers:")]),t._v(" The "),a("code",[t._v("AdminServiceProvider")]),t._v(" is listed as a provider to be registered with Laravel automatically.")]),t._v(" "),a("li",[a("strong",[t._v("Minimum Stability:")]),t._v(" Set to "),a("code",[t._v('"dev"')]),t._v(" to allow development versions of the package to be installed.")])]),t._v(" "),a("h4",{attrs:{id:"step-2-install-the-package-locally"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#step-2-install-the-package-locally"}},[t._v("#")]),t._v(" Step 2: Install the Package Locally")]),t._v(" "),a("p",[t._v("Once the "),a("code",[t._v("composer.json")]),t._v(" file is set up, you can install the package locally via Composer's command-line interface.")]),t._v(" "),a("p",[t._v("Run the following command:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" require krayin/laravel-admin dev-master\n")])])]),a("p",[t._v("This command tells Composer to require the "),a("code",[t._v("krayin/laravel-admin")]),t._v(" package and install it along with any other dependencies listed in the package's "),a("code",[t._v("composer.json")]),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"run-the-commands"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#run-the-commands"}},[t._v("#")]),t._v(" Run the Commands")]),t._v(" "),a("p",[t._v("Run the following commands to autoload your package and publish its assets and configurations:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" dump-autoload\nphp artisan optimize\nphp artisan vendor:publish "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--provider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider\n")])])]),a("p",[t._v("When prompted to select which items to publish, choose the number corresponding to "),a("strong",[a("code",[t._v('"Webkul\\Category\\Providers\\CategoryServiceProvider"')])]),t._v(" and press enter to publish all assets and configurations.")]),t._v(" "),a("p",[t._v("Congratulations! Your package is now registered and ready to use. Start creating something cool!")]),t._v(" "),a("h2",{attrs:{id:"manual-setup-of-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#manual-setup-of-files"}},[t._v("#")]),t._v(" Manual Setup of Files")]),t._v(" "),a("p",[t._v("If you prefer to set up your package manually, follow these steps assuming you are familiar with package directory structures and workflows. We'll use the default "),a("strong",[a("code",[t._v("package")])]),t._v(" directory in Krayin as an example.")]),t._v(" "),a("h3",{attrs:{id:"create-package-directory"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-package-directory"}},[t._v("#")]),t._v(" Create Package Directory")]),t._v(" "),a("p",[t._v("Inside the "),a("strong",[a("code",[t._v("packages/Webkul")])]),t._v(" directory, create a directory with your package name. Your structure should look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("└── packages\n └── Webkul\n └── Category\n")])])]),a("p",[t._v("In your package directory, create a directory named as "),a("strong",[a("code",[t._v("src")])]),t._v(". This is where you'll put all your package-related files. Your updated structure will look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n")])])]),a("h3",{attrs:{id:"create-service-provider"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-service-provider"}},[t._v("#")]),t._v(" Create Service Provider")]),t._v(" "),a("p",[t._v("In the "),a("strong",[a("code",[t._v("src")])]),t._v(" directory, create a directory named as "),a("strong",[a("code",[t._v("Providers")])]),t._v(". Inside that directory, create a file named as "),a("strong",[a("code",[t._v("CategoryServiceProvider.php")])]),t._v(". Your structure should look like this:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" └── packages\n └── Webkul\n └── Category\n └── src\n └── Providers\n └── CategoryServiceProvider.php\n")])])]),a("p",[t._v("Copy the following code and paste it into "),a("strong",[a("code",[t._v("CategoryServiceProvider.php")])]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-php extra-class"},[a("pre",{pre:!0,attrs:{class:"language-php"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token php language-php"}},[a("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("ServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("defaultProviders")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("merge")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[t._v("Webkul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Providers"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryServiceProvider")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),a("h3",{attrs:{id:"run-the-commands-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#run-the-commands-2"}},[t._v("#")]),t._v(" Run the Commands")]),t._v(" "),a("p",[t._v("Run the following command to autoload your package:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("composer")]),t._v(" dump-autoload\n")])])]),a("p",[t._v("Your package is now ready to use !")])])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/87.6edfe556.js b/assets/js/87.91be584e.js similarity index 99% rename from assets/js/87.6edfe556.js rename to assets/js/87.91be584e.js index 52a3856..8f6d4af 100644 --- a/assets/js/87.6edfe556.js +++ b/assets/js/87.91be584e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[87],{385:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#datagrid"}},[t._v("#")]),t._v(" DataGrid")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#global-properties-of-datagrid"}},[t._v("Global Properties of DataGrid")])]),s("li",[s("a",{attrs:{href:"#how-datagrid-works"}},[t._v("How DataGrid Works")])]),s("li",[s("a",{attrs:{href:"#multiple-datagrids"}},[t._v("Multiple DataGrids")]),s("ul",[s("li",[s("a",{attrs:{href:"#datagrid-to-json"}},[t._v("DataGrid to JSON")])]),s("li",[s("a",{attrs:{href:"#render-datagrid"}},[t._v("Render DataGrid")])])])]),s("li",[s("a",{attrs:{href:"#sample-datagrid"}},[t._v("Sample DataGrid")])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("A DataGrid is a concept of displaying your database records in a tabular format. It is a powerful tool that helps you present large amounts of data in an organized way. At Krayin, we have implemented this feature, which allows you to use it to display data in a tabular format or write code from scratch to display data. In addition to the basic functionality of DataGrid, we have also implemented additional features such as sorting, filtering, and mass action, which are explained in detail below.")]),t._v(" "),s("h2",{attrs:{id:"global-properties-of-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#global-properties-of-datagrid"}},[t._v("#")]),t._v(" Global Properties of DataGrid")]),t._v(" "),s("p",[t._v("Here are the global properties of the DataGrid:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Property")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("index")])])]),t._v(" "),s("td",[t._v("This property is defined in the grid, and the value assigned to this property must be unique, typically the primary key, so that data will be uniquely identified and operations performed will be based on your index value.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("sortOrder")])])]),t._v(" "),s("td",[t._v("The "),s("strong",[s("code",[t._v("sortOrder")])]),t._v(" key is used to arrange the results in ascending or descending order. Set the "),s("strong",[s("code",[t._v("sortOrder")])]),t._v(" variable to "),s("strong",[s("code",[t._v("asc")])]),t._v(" or "),s("strong",[s("code",[t._v("desc")])]),t._v(".")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("queryBuilder")])])]),t._v(" "),s("td",[t._v("This is used to perform database operations in your application.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableMassAction")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable the mass action in DataGrid.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableAction")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable the action column of DataGrid.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("paginate")])])]),t._v(" "),s("td",[t._v("Set the "),s("strong",[s("code",[t._v("paginate")])]),t._v(" property to "),s("strong",[s("code",[t._v("true")])]),t._v(" to allow pagination on your page.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("itemsPerPage")])])]),t._v(" "),s("td",[t._v("The "),s("strong",[s("code",[t._v("itemsPerPage")])]),t._v(" key is used to display the number of items per page.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableFilterMap")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable filtering on the basis of columns.")])])])]),t._v(" "),s("h2",{attrs:{id:"how-datagrid-works"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#how-datagrid-works"}},[t._v("#")]),t._v(" How DataGrid Works")]),t._v(" "),s("p",[t._v("The "),s("strong",[s("code",[t._v("DataGrid")])]),t._v(" abstract class is created in the "),s("strong",[s("code",[t._v("Webkul\\Ui")])]),t._v(" package. In the abstract class, a list of properties and methods are declared. To create your own DataGrid, you need to extend the "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\DataGrid")])]),t._v(" abstract class.")]),t._v(" "),s("p",[t._v("In "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\DataGrid.php")])]),t._v(" abstract class, two abstract methods are declared "),s("strong",[s("code",[t._v("prepareQueryBuilder()")])]),t._v(" and "),s("strong",[s("code",[t._v("addColumns()")])]),t._v(". You can prepare your grid by defining these two methods.")]),t._v(" "),s("ul",[s("li",[s("p",[s("strong",[s("code",[t._v("prepareQueryBuilder()")])]),t._v(": In this method, records are retrieved through queries applicable to the database and stored in a collection. When records are retrieved, the "),s("strong",[s("code",[t._v("setQueryBuilder()")])]),t._v(" method is called.")])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("setQueryBuilder()")])]),t._v(": This method is used for setting the "),s("strong",[s("code",[t._v("$queryBuilder")])]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("DB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("table")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addSelect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addFilter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("addColumns()")])]),t._v(": In this method, columns are created which are displayed in the grid. The parameter accepts an array in key-value pairs. Some of the essential keys are described below:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("index")])])]),t._v(" "),s("td",[t._v("This key is defined in the grid, and the value assigned to this key must be unique, typically the primary key, so that data will be uniquely identified and operations performed will be based on your index value.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("label")])])]),t._v(" "),s("td",[t._v("This key defines the name of the column.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("type")])])]),t._v(" "),s("td",[t._v("This key accepts the type of data in the column.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("searchable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column searchable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("sortable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column sortable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("filterable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column filterable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("wrapper")])])]),t._v(" "),s("td",[t._v("Perform actions based on a condition satisfied or apply some customization to the value.")])])])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("addColumns")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::app.admin.datagrid.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'number'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'searchable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'filterable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("prepareActions()")])]),t._v(": This method is defined when there is a need to perform any action such as edit or delete on the grid. In this method, the "),s("strong",[s("code",[t._v("addAction()")])]),t._v(" method is called to define a particular action.")])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("addAction()")])]),t._v(": This method is used for adding actions (like "),s("strong",[s("code",[t._v("edit")])]),t._v(", "),s("strong",[s("code",[t._v("delete")])]),t._v(", etc.) to each row generated by the DataGrid.")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("title")])])]),t._v(" "),s("td",[t._v("The text to be displayed is written here.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("method")])])]),t._v(" "),s("td",[t._v("HTTP methods are declared.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("route")])])]),t._v(" "),s("td",[t._v("This key accepts the route of the icon.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("icon")])])]),t._v(" "),s("td",[t._v("Class of the icon to be displayed in the action column. You may prefer text also.")])])])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareActions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::app.admin.datagrid.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'GET'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.category.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon pencil-lg-icon'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h2",{attrs:{id:"multiple-datagrids"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#multiple-datagrids"}},[t._v("#")]),t._v(" Multiple DataGrids")]),t._v(" "),s("p",[t._v("When working with multiple DataGrids, the default DataGrid implementation can handle only a single request at a time. This means that operations such as filtration, sorting, and others can conflict when implementing multiple DataGrids. To overcome this, we provide a trait called "),s("strong",[s("code",[t._v("ProvideDataGridPlus")])]),t._v(" in the namespace "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\Traits")])]),t._v(".")]),t._v(" "),s("p",[t._v("Follow the steps below to implement multiple DataGrids:")]),t._v(" "),s("ol",[s("li",[s("p",[t._v("Create a directory called "),s("strong",[s("code",[t._v("DataGrids")])]),t._v(" inside the "),s("strong",[s("code",[t._v("src")])]),t._v(" directory of your package. Within the "),s("strong",[s("code",[t._v("DataGrids")])]),t._v(" directory, create a file called "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(" that extends the "),s("strong",[s("code",[t._v("DataGrid")])]),t._v(" class from the "),s("strong",[s("code",[t._v("Webkul\\Ui")])]),t._v(" package. The directory structure will be as follows:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── DataGrids\n └── CategoryDataGrid.php\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Add the following code to your DataGrid file, i.e., "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Ui"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrid")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryDataGrid")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataGrid")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"datagrid-to-json"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#datagrid-to-json"}},[t._v("#")]),t._v(" DataGrid to JSON")]),t._v(" "),s("ol",{attrs:{start:"3"}},[s("li",[s("p",[t._v("Import the "),s("strong",[s("code",[t._v("ProvideDataGridPlus")])]),t._v(" trait into the "),s("strong",[s("code",[t._v("CategoryDataGrid")])]),t._v(" class:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Admin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Traits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("ProvideDropdownOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryDataGrid")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataGrid")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("ProvideDropdownOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("After that, the "),s("strong",[s("code",[t._v("toJson()")])]),t._v(" method will be available in the DataGrid instance, which provides data to the component.")])]),t._v(" "),s("li",[s("p",[t._v("Now, go to "),s("strong",[s("code",[t._v("Admin/CategoryController.php")])]),t._v(" and locate the "),s("strong",[s("code",[t._v("index")])]),t._v(" method. Use the "),s("strong",[s("code",[t._v("toJson()")])]),t._v(" method as follows:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryDataGrid")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryController")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Controller")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Display a listing of the resource.\n *\n * @return \\Illuminate\\View\\View\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("index")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("request")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ajax")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("app")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryDataGrid")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toJson")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::admin.index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"render-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#render-datagrid"}},[t._v("#")]),t._v(" Render DataGrid")]),t._v(" "),s("ol",{attrs:{start:"6"}},[s("li",[s("p",[t._v("In the view file "),s("strong",[s("code",[t._v("views/admin/index.blade.php")])]),t._v(", use the "),s("strong",[s("code",[t._v("table-component")])]),t._v(" component and specify the URL from which it will load the JSON data:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("@"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("section")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'content-wrapper'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("div "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"content full-page"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("component data"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ route('admin.categories.index') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("template v"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("header"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("h1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view_render_event")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.products.index.header.before'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Breadcrumbs")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("render")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Category'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view_render_event")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.products.index.header.after'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("h1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("template v"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("action"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("a href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ route('admin.categories.create') }}\"")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"btn btn-md btn-primary"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Create Category'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("component"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("div"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n@stop\n")])])]),s("p",[t._v("With these steps, your DataGrid is now ready to be used.")])])]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("Make sure to copy the sample code provided below to your own "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(" file, as we have already included all the necessary methods and functions there. This code can be used later as an example for your implementation.")])]),t._v(" "),s("h2",{attrs:{id:"sample-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sample-datagrid"}},[t._v("#")]),t._v(" Sample DataGrid")]),t._v(" "),s("p",[t._v("Here's an improved version of the provided DataGrid sample:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addSelect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addFilter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Add columns.\n *\n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("addColumns")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Prepare actions.\n *\n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareActions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'GET'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.categories.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'pencil-icon'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'DELETE'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.categories.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'confirm_text'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.massaction.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'resource'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'user'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'trash-icon'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[87],{387:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#datagrid"}},[t._v("#")]),t._v(" DataGrid")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#global-properties-of-datagrid"}},[t._v("Global Properties of DataGrid")])]),s("li",[s("a",{attrs:{href:"#how-datagrid-works"}},[t._v("How DataGrid Works")])]),s("li",[s("a",{attrs:{href:"#multiple-datagrids"}},[t._v("Multiple DataGrids")]),s("ul",[s("li",[s("a",{attrs:{href:"#datagrid-to-json"}},[t._v("DataGrid to JSON")])]),s("li",[s("a",{attrs:{href:"#render-datagrid"}},[t._v("Render DataGrid")])])])]),s("li",[s("a",{attrs:{href:"#sample-datagrid"}},[t._v("Sample DataGrid")])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("A DataGrid is a concept of displaying your database records in a tabular format. It is a powerful tool that helps you present large amounts of data in an organized way. At Krayin, we have implemented this feature, which allows you to use it to display data in a tabular format or write code from scratch to display data. In addition to the basic functionality of DataGrid, we have also implemented additional features such as sorting, filtering, and mass action, which are explained in detail below.")]),t._v(" "),s("h2",{attrs:{id:"global-properties-of-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#global-properties-of-datagrid"}},[t._v("#")]),t._v(" Global Properties of DataGrid")]),t._v(" "),s("p",[t._v("Here are the global properties of the DataGrid:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Property")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("index")])])]),t._v(" "),s("td",[t._v("This property is defined in the grid, and the value assigned to this property must be unique, typically the primary key, so that data will be uniquely identified and operations performed will be based on your index value.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("sortOrder")])])]),t._v(" "),s("td",[t._v("The "),s("strong",[s("code",[t._v("sortOrder")])]),t._v(" key is used to arrange the results in ascending or descending order. Set the "),s("strong",[s("code",[t._v("sortOrder")])]),t._v(" variable to "),s("strong",[s("code",[t._v("asc")])]),t._v(" or "),s("strong",[s("code",[t._v("desc")])]),t._v(".")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("queryBuilder")])])]),t._v(" "),s("td",[t._v("This is used to perform database operations in your application.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableMassAction")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable the mass action in DataGrid.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableAction")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable the action column of DataGrid.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("paginate")])])]),t._v(" "),s("td",[t._v("Set the "),s("strong",[s("code",[t._v("paginate")])]),t._v(" property to "),s("strong",[s("code",[t._v("true")])]),t._v(" to allow pagination on your page.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("itemsPerPage")])])]),t._v(" "),s("td",[t._v("The "),s("strong",[s("code",[t._v("itemsPerPage")])]),t._v(" key is used to display the number of items per page.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("enableFilterMap")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to enable or disable filtering on the basis of columns.")])])])]),t._v(" "),s("h2",{attrs:{id:"how-datagrid-works"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#how-datagrid-works"}},[t._v("#")]),t._v(" How DataGrid Works")]),t._v(" "),s("p",[t._v("The "),s("strong",[s("code",[t._v("DataGrid")])]),t._v(" abstract class is created in the "),s("strong",[s("code",[t._v("Webkul\\Ui")])]),t._v(" package. In the abstract class, a list of properties and methods are declared. To create your own DataGrid, you need to extend the "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\DataGrid")])]),t._v(" abstract class.")]),t._v(" "),s("p",[t._v("In "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\DataGrid.php")])]),t._v(" abstract class, two abstract methods are declared "),s("strong",[s("code",[t._v("prepareQueryBuilder()")])]),t._v(" and "),s("strong",[s("code",[t._v("addColumns()")])]),t._v(". You can prepare your grid by defining these two methods.")]),t._v(" "),s("ul",[s("li",[s("p",[s("strong",[s("code",[t._v("prepareQueryBuilder()")])]),t._v(": In this method, records are retrieved through queries applicable to the database and stored in a collection. When records are retrieved, the "),s("strong",[s("code",[t._v("setQueryBuilder()")])]),t._v(" method is called.")])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("setQueryBuilder()")])]),t._v(": This method is used for setting the "),s("strong",[s("code",[t._v("$queryBuilder")])]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("DB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("table")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addSelect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addFilter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("addColumns()")])]),t._v(": In this method, columns are created which are displayed in the grid. The parameter accepts an array in key-value pairs. Some of the essential keys are described below:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("index")])])]),t._v(" "),s("td",[t._v("This key is defined in the grid, and the value assigned to this key must be unique, typically the primary key, so that data will be uniquely identified and operations performed will be based on your index value.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("label")])])]),t._v(" "),s("td",[t._v("This key defines the name of the column.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("type")])])]),t._v(" "),s("td",[t._v("This key accepts the type of data in the column.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("searchable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column searchable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("sortable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column sortable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("filterable")])])]),t._v(" "),s("td",[t._v("This accepts boolean values "),s("strong",[s("code",[t._v("true")])]),t._v(" or "),s("strong",[s("code",[t._v("false")])]),t._v(" to make the column filterable.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("wrapper")])])]),t._v(" "),s("td",[t._v("Perform actions based on a condition satisfied or apply some customization to the value.")])])])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("addColumns")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::app.admin.datagrid.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'number'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'searchable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'filterable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("prepareActions()")])]),t._v(": This method is defined when there is a need to perform any action such as edit or delete on the grid. In this method, the "),s("strong",[s("code",[t._v("addAction()")])]),t._v(" method is called to define a particular action.")])]),t._v(" "),s("li",[s("p",[s("strong",[s("code",[t._v("addAction()")])]),t._v(": This method is used for adding actions (like "),s("strong",[s("code",[t._v("edit")])]),t._v(", "),s("strong",[s("code",[t._v("delete")])]),t._v(", etc.) to each row generated by the DataGrid.")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Functionality")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("strong",[s("code",[t._v("title")])])]),t._v(" "),s("td",[t._v("The text to be displayed is written here.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("method")])])]),t._v(" "),s("td",[t._v("HTTP methods are declared.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("route")])])]),t._v(" "),s("td",[t._v("This key accepts the route of the icon.")])]),t._v(" "),s("tr",[s("td",[s("strong",[s("code",[t._v("icon")])])]),t._v(" "),s("td",[t._v("Class of the icon to be displayed in the action column. You may prefer text also.")])])])]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareActions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::app.admin.datagrid.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'GET'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.category.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon pencil-lg-icon'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h2",{attrs:{id:"multiple-datagrids"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#multiple-datagrids"}},[t._v("#")]),t._v(" Multiple DataGrids")]),t._v(" "),s("p",[t._v("When working with multiple DataGrids, the default DataGrid implementation can handle only a single request at a time. This means that operations such as filtration, sorting, and others can conflict when implementing multiple DataGrids. To overcome this, we provide a trait called "),s("strong",[s("code",[t._v("ProvideDataGridPlus")])]),t._v(" in the namespace "),s("strong",[s("code",[t._v("Webkul\\Ui\\DataGrid\\Traits")])]),t._v(".")]),t._v(" "),s("p",[t._v("Follow the steps below to implement multiple DataGrids:")]),t._v(" "),s("ol",[s("li",[s("p",[t._v("Create a directory called "),s("strong",[s("code",[t._v("DataGrids")])]),t._v(" inside the "),s("strong",[s("code",[t._v("src")])]),t._v(" directory of your package. Within the "),s("strong",[s("code",[t._v("DataGrids")])]),t._v(" directory, create a file called "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(" that extends the "),s("strong",[s("code",[t._v("DataGrid")])]),t._v(" class from the "),s("strong",[s("code",[t._v("Webkul\\Ui")])]),t._v(" package. The directory structure will be as follows:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("└── packages\n └── Webkul\n └── Category\n └── src\n ├── ...\n └── DataGrids\n └── CategoryDataGrid.php\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Add the following code to your DataGrid file, i.e., "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Ui"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrid")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryDataGrid")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataGrid")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"datagrid-to-json"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#datagrid-to-json"}},[t._v("#")]),t._v(" DataGrid to JSON")]),t._v(" "),s("ol",{attrs:{start:"3"}},[s("li",[s("p",[t._v("Import the "),s("strong",[s("code",[t._v("ProvideDataGridPlus")])]),t._v(" trait into the "),s("strong",[s("code",[t._v("CategoryDataGrid")])]),t._v(" class:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Admin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Traits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("ProvideDropdownOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryDataGrid")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataGrid")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("ProvideDropdownOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("After that, the "),s("strong",[s("code",[t._v("toJson()")])]),t._v(" method will be available in the DataGrid instance, which provides data to the component.")])]),t._v(" "),s("li",[s("p",[t._v("Now, go to "),s("strong",[s("code",[t._v("Admin/CategoryController.php")])]),t._v(" and locate the "),s("strong",[s("code",[t._v("index")])]),t._v(" method. Use the "),s("strong",[s("code",[t._v("toJson()")])]),t._v(" method as follows:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token package"}},[t._v("Webkul"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Category"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("DataGrids"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("CategoryDataGrid")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name-definition class-name"}},[t._v("CategoryController")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Controller")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Display a listing of the resource.\n *\n * @return \\Illuminate\\View\\View\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("index")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("request")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ajax")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("app")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryDataGrid")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toJson")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'category::admin.index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"render-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#render-datagrid"}},[t._v("#")]),t._v(" Render DataGrid")]),t._v(" "),s("ol",{attrs:{start:"6"}},[s("li",[s("p",[t._v("In the view file "),s("strong",[s("code",[t._v("views/admin/index.blade.php")])]),t._v(", use the "),s("strong",[s("code",[t._v("table-component")])]),t._v(" component and specify the URL from which it will load the JSON data:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("@"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("section")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'content-wrapper'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("div "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"content full-page"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("component data"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("src"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ route('admin.categories.index') }}\"")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("template v"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("header"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("h1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view_render_event")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.products.index.header.before'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Breadcrumbs")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("render")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Category'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("view_render_event")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.products.index.header.after'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("h1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("template v"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("slot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("action"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("a href"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v("\"{{ route('admin.categories.create') }}\"")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[t._v('"btn btn-md btn-primary"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("__")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Create Category'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("component"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("div"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n@stop\n")])])]),s("p",[t._v("With these steps, your DataGrid is now ready to be used.")])])]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("Make sure to copy the sample code provided below to your own "),s("strong",[s("code",[t._v("CategoryDataGrid.php")])]),t._v(" file, as we have already included all the necessary methods and functions there. This code can be used later as an example for your implementation.")])]),t._v(" "),s("h2",{attrs:{id:"sample-datagrid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sample-datagrid"}},[t._v("#")]),t._v(" Sample DataGrid")]),t._v(" "),s("p",[t._v("Here's an improved version of the provided DataGrid sample:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addSelect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addFilter")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories.id'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("setQueryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$queryBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Add columns.\n *\n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("addColumns")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Slug'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Name'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addColumn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'label'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'Description'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'type'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'string'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'sortable'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Prepare actions.\n *\n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("prepareActions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'GET'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.categories.edit'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'pencil-icon'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$this")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'title'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'method'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'DELETE'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'route'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin.categories.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'confirm_text'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("trans")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'ui::app.datagrid.massaction.delete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'resource'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'user'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'icon'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'trash-icon'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/52.d94ee6e4.js b/assets/js/88.317319ac.js similarity index 98% rename from assets/js/52.d94ee6e4.js rename to assets/js/88.317319ac.js index f76d541..9ba8a3c 100644 --- a/assets/js/52.d94ee6e4.js +++ b/assets/js/88.317319ac.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{349:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"layouts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#layouts"}},[t._v("#")]),t._v(" Layouts")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#category-layout"}},[t._v("Category Layout")])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Layouts in Krayin are fundamental to structuring your application's views in a consistent and reusable way. They provide a template for rendering HTML across multiple pages, ensuring a unified design and user experience. By defining layouts, you can streamline development, improve maintainability, and enhance the overall aesthetics of your web application.")]),t._v(" "),a("p",[t._v("To learn in detail about Layouts, you can visit the Laravel documentation "),a("a",{attrs:{href:"https://laravel.com/docs/11.x/blade",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"category-layout"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#category-layout"}},[t._v("#")]),t._v(" Category Layout")]),t._v(" "),a("p",[a("code",[t._v("@extends('category::layouts.master')")]),t._v(" This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit".')]),t._v(" "),a("p",[t._v("To extend the default layout of the Krayin admin panel, you'll create or modify the "),a("code",[t._v("index.blade.php")]),t._v(" file located at "),a("code",[t._v("packages/Webkul/Category/src/Resources/views/admin/index.blade.php")]),t._v(". Below is a detailed breakdown of how to integrate and customize the layout:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[t._v("@extends('category::layouts.master')\n\n@push('css')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token style"}},[a("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* */")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n\n@section('page_title')\n {{ __('category::categories.index.title') }}\n@endsection\n\n@section('content-wrapper')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("content full-page"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- --\x3e")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endsection\n\n@push('scripts')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token script"}},[a("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Prop Name")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("strong",[a("code",[t._v("@extends('category::layouts.master')")])])]),t._v(" "),a("td",[t._v("This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit"')])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('page_title')")])])]),t._v(" "),a("td",[t._v("This is used to define the title of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('content-wrapper')")])])]),t._v(" "),a("td",[t._v("This is used to define the body of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('css')")])])]),t._v(" "),a("td",[t._v("This is used to add additional css.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('scripts')")])])]),t._v(" "),a("td",[t._v("This is used to add additional javascript.")])])])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in "),a("strong",[a("code",[t._v("lang/app.php")])]),t._v(".")])]),t._v(" "),a("p",[t._v("If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside "),a("code",[t._v("Resources\\Views\\Layouts\\master.blade.php")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{385:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"layouts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#layouts"}},[t._v("#")]),t._v(" Layouts")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),a("li",[a("a",{attrs:{href:"#category-layout"}},[t._v("Category Layout")])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Layouts in Krayin are fundamental to structuring your application's views in a consistent and reusable way. They provide a template for rendering HTML across multiple pages, ensuring a unified design and user experience. By defining layouts, you can streamline development, improve maintainability, and enhance the overall aesthetics of your web application.")]),t._v(" "),a("p",[t._v("To learn in detail about Layouts, you can visit the Laravel documentation "),a("a",{attrs:{href:"https://laravel.com/docs/11.x/blade",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"category-layout"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#category-layout"}},[t._v("#")]),t._v(" Category Layout")]),t._v(" "),a("p",[a("code",[t._v("@extends('category::layouts.master')")]),t._v(" This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit".')]),t._v(" "),a("p",[t._v("To extend the default layout of the Krayin admin panel, you'll create or modify the "),a("code",[t._v("index.blade.php")]),t._v(" file located at "),a("code",[t._v("packages/Webkul/Category/src/Resources/views/admin/index.blade.php")]),t._v(". Below is a detailed breakdown of how to integrate and customize the layout:")]),t._v(" "),a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[t._v("@extends('category::layouts.master')\n\n@push('css')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token style"}},[a("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* */")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n\n@section('page_title')\n {{ __('category::categories.index.title') }}\n@endsection\n\n@section('content-wrapper')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("content full-page"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!-- --\x3e")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endsection\n\n@push('scripts')\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token script"}},[a("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n@endpush\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Prop Name")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("strong",[a("code",[t._v("@extends('category::layouts.master')")])])]),t._v(" "),a("td",[t._v("This "),a("code",[t._v("@extends")]),t._v(' Blade directive to specify which layout the child view should "inherit"')])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('page_title')")])])]),t._v(" "),a("td",[t._v("This is used to define the title of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@section('content-wrapper')")])])]),t._v(" "),a("td",[t._v("This is used to define the body of the page.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('css')")])])]),t._v(" "),a("td",[t._v("This is used to add additional css.")])]),t._v(" "),a("tr",[a("td",[a("strong",[a("code",[t._v("@push('scripts')")])])]),t._v(" "),a("td",[t._v("This is used to add additional javascript.")])])])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in "),a("strong",[a("code",[t._v("lang/app.php")])]),t._v(".")])]),t._v(" "),a("p",[t._v("If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside "),a("code",[t._v("Resources\\Views\\Layouts\\master.blade.php")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/89.f3215088.js b/assets/js/89.8f0dc9b2.js similarity index 99% rename from assets/js/89.f3215088.js rename to assets/js/89.8f0dc9b2.js index 647eaac..77c4450 100644 --- a/assets/js/89.f3215088.js +++ b/assets/js/89.8f0dc9b2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{388:function(a,e,t){"use strict";t.r(e);var s=t(10),n=Object(s.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"localization"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#localization"}},[a._v("#")]),a._v(" Localization")]),a._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#publishing-the-language-files"}},[a._v("Publishing the Language Files")])]),e("li",[e("a",{attrs:{href:"#configuring-the-locale"}},[a._v("Configuring the Locale")])]),e("li",[e("a",{attrs:{href:"#create-a-new-locale"}},[a._v("Create a new Locale")]),e("ul",[e("li",[e("a",{attrs:{href:"#directory-structure"}},[a._v("Directory Structure")])]),e("li",[e("a",{attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("Writing a Translation in app.php")])])])]),e("li",[e("a",{attrs:{href:"#load-translation-from-package"}},[a._v("Load Translation from Package")]),e("ul",[e("li",[e("a",{attrs:{href:"#update-the-service-provider"}},[a._v("Update the Service Provider")])]),e("li",[e("a",{attrs:{href:"#use-translations-in-blade-files"}},[a._v("Use Translations in Blade Files")])])])])])]),e("p"),a._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),e("p",[a._v("Laravel's localization features provide a convenient way to retrieve strings in various languages, allowing you to easily support multiple languages within your application.")]),a._v(" "),e("p",[a._v("Language strings may be stored in files within the application's lang directory. Within this directory, there may be subdirectories for each language supported by the application. This is the approach Laravel uses to manage translation strings for built-in Laravel features such as validation error messages:")]),a._v(" "),e("p",[a._v("To learn in detail about Localization, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/localization",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),e("OutboundLink")],1),a._v(".")]),a._v(" "),e("h2",{attrs:{id:"publishing-the-language-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#publishing-the-language-files"}},[a._v("#")]),a._v(" Publishing the Language Files")]),a._v(" "),e("p",[a._v("By default, the Laravel application skeleton does not include the lang directory. If you would like to customize Laravel's language files or create your own, you should scaffold the lang directory via the lang:publish Artisan command. The lang:publish command will create the lang directory in your application and publish the default set of language files used by Laravel:")]),a._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[a._v("php artisan lang:publish\n")])])]),e("h2",{attrs:{id:"configuring-the-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configuring-the-locale"}},[a._v("#")]),a._v(" Configuring the Locale")]),a._v(" "),e("p",[a._v("The default language for your application is stored in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file's "),e("code",[a._v("locale")]),a._v(" configuration option, which is typically set using the "),e("code",[a._v("APP_LOCALE")]),a._v(" environment variable. You are free to modify this value to suit the needs of your application.")]),a._v(" "),e("p",[a._v("You may also configure a "),e("code",[a._v('"fallback language"')]),a._v(", which will be used when the default language does not contain a given translation string. Like the default language, the fallback language is also configured in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file, and its value is typically set using the APP_FALLBACK_LOCALE environment variable.")]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[a._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Locale Configuration\n |--------------------------------------------------------------------------\n |\n | The application locale determines the default locale that will be used\n | by the translation service provider. You are free to set this value\n | to any of the locales which will be supported by the application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("env")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'APP_LOCALE'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Fallback Locale\n |--------------------------------------------------------------------------\n |\n | The fallback locale determines the locale to use when the current one\n | is not available. You may change the value to correspond to any of\n | the language directories that are provided through your application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'fallback_locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n")])])]),e("h2",{attrs:{id:"create-a-new-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-locale"}},[a._v("#")]),a._v(" Create a new Locale")]),a._v(" "),e("p",[a._v("To support localization in your package, you need to create language files. Follow the steps below to set up a language file for English translations.")]),a._v(" "),e("h4",{attrs:{id:"create-the-lang-folder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-lang-folder"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("lang")]),a._v(" Folder")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to the "),e("code",[a._v("packages/Webkul/Category/src/Resources")]),a._v(" directory.")]),a._v(" "),e("li",[a._v("Create a directory named "),e("code",[a._v("lang")]),a._v(".")])]),a._v(" "),e("h4",{attrs:{id:"create-language-code-folders"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-language-code-folders"}},[a._v("#")]),a._v(" Create Language Code Folders")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("lang")]),a._v(" directory, create different directories for each language you want to support. For example, you can create directories for English ("),e("code",[a._v("en")]),a._v("), Hindi ("),e("code",[a._v("hi")]),a._v("), etc.")]),a._v(" "),e("li",[a._v("For now, let's create a directory named "),e("code",[a._v("en")]),a._v(" to represent English.")])]),a._v(" "),e("h4",{attrs:{id:"create-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-app-php-file"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("en")]),a._v(" directory, create a file named "),e("code",[a._v("app.php")]),a._v(" for language translations.")])]),a._v(" "),e("h3",{attrs:{id:"directory-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[a._v("#")]),a._v(" Directory Structure")]),a._v(" "),e("p",[a._v("The updated directory structure will look like this:")]),a._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[a._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── lang\n └── en\n └── app.php\n")])])]),e("h3",{attrs:{id:"writing-a-translation-in-app-php"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("#")]),a._v(" Writing a Translation in "),e("code",[a._v("app.php")])]),a._v(" "),e("p",[a._v("To add translations for your package, you can edit the "),e("code",[a._v("app.php")]),a._v(" file located in the language directory ("),e("code",[a._v("en")]),a._v(" in this case). Below is an example of how you can define translations:")]),a._v(" "),e("h4",{attrs:{id:"open-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#open-the-app-php-file"}},[a._v("#")]),a._v(" Open the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to "),e("code",[a._v("packages/Webkul/Category/src/Resources/lang/en")]),a._v(".")]),a._v(" "),e("li",[a._v("Open the "),e("code",[a._v("app.php")]),a._v(" file.")])]),a._v(" "),e("h4",{attrs:{id:"add-the-translation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-the-translation"}},[a._v("#")]),a._v(" Add the Translation")]),a._v(" "),e("ul",[e("li",[a._v("Inside "),e("code",[a._v("app.php")]),a._v(", define your translations as an associative array. For example:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'index'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'Categories'")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),e("h2",{attrs:{id:"load-translation-from-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#load-translation-from-package"}},[a._v("#")]),a._v(" Load Translation from Package")]),a._v(" "),e("p",[a._v("To make translations from your package accessible, you need to register the language file in the service provider and then use them in your Blade templates.")]),a._v(" "),e("h3",{attrs:{id:"update-the-service-provider"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update-the-service-provider"}},[a._v("#")]),a._v(" Update the Service Provider")]),a._v(" "),e("ul",[e("li",[a._v("Open the "),e("code",[a._v("CategoryServiceProvider.php")]),a._v(" file located in "),e("code",[a._v("packages/Webkul/Category/src/Providers")]),a._v(".")]),a._v(" "),e("li",[a._v("Add the following code to the "),e("code",[a._v("boot")]),a._v(" method:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadTranslationsFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Resources/lang'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),e("h4",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("This code uses "),e("code",[a._v("$this->loadTranslationsFrom")]),a._v(" to register translations from the lang directory of your package ("),e("code",[a._v("packages/ Webkul/Category/src/Resources/lang")]),a._v(") under the namespace "),e("code",[a._v("'category'")]),a._v(".")])]),a._v(" "),e("li",[e("p",[a._v("The "),e("code",[a._v("loadTranslationsFrom")]),a._v(" method registers translations for the "),e("code",[a._v("'category'")]),a._v(" namespace from the specified path ("),e("code",[a._v("__DIR__ . '/../Resources/lang'")]),a._v(").")])]),a._v(" "),e("li",[e("p",[a._v("This makes translations accessible throughout your Laravel application using the "),e("code",[a._v("'category'")]),a._v(" namespace prefix.")])])]),a._v(" "),e("h3",{attrs:{id:"use-translations-in-blade-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-translations-in-blade-files"}},[a._v("#")]),a._v(" Use Translations in Blade Files")]),a._v(" "),e("p",[a._v("In your Blade templates ("),e("code",[a._v(".blade.php")]),a._v(" files), you can use the "),e("code",[a._v("@lang")]),a._v(" helper function to retrieve translations. Use the namespace 'category' followed by the translation key. For example:")]),a._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[a._v("@lang('category::categories.index.title')\n")])])]),e("h4",{attrs:{id:"explanation-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("The "),e("code",[a._v("@lang('category::categories.index.title')")]),a._v(" syntax fetches the translation for for "),e("code",[a._v("categories")]),a._v(" > "),e("code",[a._v("index")]),a._v(" > "),e("code",[a._v("title")])])]),a._v(" "),e("li",[e("p",[a._v("Replace "),e("code",[a._v("'categories.index.title'")]),a._v(" with your actual translation keys to use different translations as needed in your application.")])])]),a._v(" "),e("p",[a._v("By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{386:function(a,e,t){"use strict";t.r(e);var s=t(10),n=Object(s.a)({},(function(){var a=this,e=a._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"localization"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#localization"}},[a._v("#")]),a._v(" Localization")]),a._v(" "),e("p"),e("div",{staticClass:"table-of-contents"},[e("ul",[e("li",[e("a",{attrs:{href:"#introduction"}},[a._v("Introduction")])]),e("li",[e("a",{attrs:{href:"#publishing-the-language-files"}},[a._v("Publishing the Language Files")])]),e("li",[e("a",{attrs:{href:"#configuring-the-locale"}},[a._v("Configuring the Locale")])]),e("li",[e("a",{attrs:{href:"#create-a-new-locale"}},[a._v("Create a new Locale")]),e("ul",[e("li",[e("a",{attrs:{href:"#directory-structure"}},[a._v("Directory Structure")])]),e("li",[e("a",{attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("Writing a Translation in app.php")])])])]),e("li",[e("a",{attrs:{href:"#load-translation-from-package"}},[a._v("Load Translation from Package")]),e("ul",[e("li",[e("a",{attrs:{href:"#update-the-service-provider"}},[a._v("Update the Service Provider")])]),e("li",[e("a",{attrs:{href:"#use-translations-in-blade-files"}},[a._v("Use Translations in Blade Files")])])])])])]),e("p"),a._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),e("p",[a._v("Laravel's localization features provide a convenient way to retrieve strings in various languages, allowing you to easily support multiple languages within your application.")]),a._v(" "),e("p",[a._v("Language strings may be stored in files within the application's lang directory. Within this directory, there may be subdirectories for each language supported by the application. This is the approach Laravel uses to manage translation strings for built-in Laravel features such as validation error messages:")]),a._v(" "),e("p",[a._v("To learn in detail about Localization, you can visit the Laravel documentation "),e("a",{attrs:{href:"https://laravel.com/docs/11.x/localization",target:"_blank",rel:"noopener noreferrer"}},[a._v("here"),e("OutboundLink")],1),a._v(".")]),a._v(" "),e("h2",{attrs:{id:"publishing-the-language-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#publishing-the-language-files"}},[a._v("#")]),a._v(" Publishing the Language Files")]),a._v(" "),e("p",[a._v("By default, the Laravel application skeleton does not include the lang directory. If you would like to customize Laravel's language files or create your own, you should scaffold the lang directory via the lang:publish Artisan command. The lang:publish command will create the lang directory in your application and publish the default set of language files used by Laravel:")]),a._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[a._v("php artisan lang:publish\n")])])]),e("h2",{attrs:{id:"configuring-the-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#configuring-the-locale"}},[a._v("#")]),a._v(" Configuring the Locale")]),a._v(" "),e("p",[a._v("The default language for your application is stored in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file's "),e("code",[a._v("locale")]),a._v(" configuration option, which is typically set using the "),e("code",[a._v("APP_LOCALE")]),a._v(" environment variable. You are free to modify this value to suit the needs of your application.")]),a._v(" "),e("p",[a._v("You may also configure a "),e("code",[a._v('"fallback language"')]),a._v(", which will be used when the default language does not contain a given translation string. Like the default language, the fallback language is also configured in the "),e("code",[a._v("config/app.php")]),a._v(" configuration file, and its value is typically set using the APP_FALLBACK_LOCALE environment variable.")]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[a._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Locale Configuration\n |--------------------------------------------------------------------------\n |\n | The application locale determines the default locale that will be used\n | by the translation service provider. You are free to set this value\n | to any of the locales which will be supported by the application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("env")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'APP_LOCALE'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[a._v("/*\n |--------------------------------------------------------------------------\n | Application Fallback Locale\n |--------------------------------------------------------------------------\n |\n | The fallback locale determines the locale to use when the current one\n | is not available. You may change the value to correspond to any of\n | the language directories that are provided through your application.\n |\n */")]),a._v("\n\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'fallback_locale'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'en'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n")])])]),e("h2",{attrs:{id:"create-a-new-locale"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-locale"}},[a._v("#")]),a._v(" Create a new Locale")]),a._v(" "),e("p",[a._v("To support localization in your package, you need to create language files. Follow the steps below to set up a language file for English translations.")]),a._v(" "),e("h4",{attrs:{id:"create-the-lang-folder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-lang-folder"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("lang")]),a._v(" Folder")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to the "),e("code",[a._v("packages/Webkul/Category/src/Resources")]),a._v(" directory.")]),a._v(" "),e("li",[a._v("Create a directory named "),e("code",[a._v("lang")]),a._v(".")])]),a._v(" "),e("h4",{attrs:{id:"create-language-code-folders"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-language-code-folders"}},[a._v("#")]),a._v(" Create Language Code Folders")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("lang")]),a._v(" directory, create different directories for each language you want to support. For example, you can create directories for English ("),e("code",[a._v("en")]),a._v("), Hindi ("),e("code",[a._v("hi")]),a._v("), etc.")]),a._v(" "),e("li",[a._v("For now, let's create a directory named "),e("code",[a._v("en")]),a._v(" to represent English.")])]),a._v(" "),e("h4",{attrs:{id:"create-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-the-app-php-file"}},[a._v("#")]),a._v(" Create the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Inside the "),e("code",[a._v("en")]),a._v(" directory, create a file named "),e("code",[a._v("app.php")]),a._v(" for language translations.")])]),a._v(" "),e("h3",{attrs:{id:"directory-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[a._v("#")]),a._v(" Directory Structure")]),a._v(" "),e("p",[a._v("The updated directory structure will look like this:")]),a._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[a._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── Resources\n ├── "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v(".\n └── lang\n └── en\n └── app.php\n")])])]),e("h3",{attrs:{id:"writing-a-translation-in-app-php"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#writing-a-translation-in-app-php"}},[a._v("#")]),a._v(" Writing a Translation in "),e("code",[a._v("app.php")])]),a._v(" "),e("p",[a._v("To add translations for your package, you can edit the "),e("code",[a._v("app.php")]),a._v(" file located in the language directory ("),e("code",[a._v("en")]),a._v(" in this case). Below is an example of how you can define translations:")]),a._v(" "),e("h4",{attrs:{id:"open-the-app-php-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#open-the-app-php-file"}},[a._v("#")]),a._v(" Open the "),e("code",[a._v("app.php")]),a._v(" File")]),a._v(" "),e("ul",[e("li",[a._v("Navigate to "),e("code",[a._v("packages/Webkul/Category/src/Resources/lang/en")]),a._v(".")]),a._v(" "),e("li",[a._v("Open the "),e("code",[a._v("app.php")]),a._v(" file.")])]),a._v(" "),e("h4",{attrs:{id:"add-the-translation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#add-the-translation"}},[a._v("#")]),a._v(" Add the Translation")]),a._v(" "),e("ul",[e("li",[a._v("Inside "),e("code",[a._v("app.php")]),a._v(", define your translations as an associative array. For example:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'index'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'title'")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=>")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'Categories'")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])])]),e("h2",{attrs:{id:"load-translation-from-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#load-translation-from-package"}},[a._v("#")]),a._v(" Load Translation from Package")]),a._v(" "),e("p",[a._v("To make translations from your package accessible, you need to register the language file in the service provider and then use them in your Blade templates.")]),a._v(" "),e("h3",{attrs:{id:"update-the-service-provider"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#update-the-service-provider"}},[a._v("#")]),a._v(" Update the Service Provider")]),a._v(" "),e("ul",[e("li",[a._v("Open the "),e("code",[a._v("CategoryServiceProvider.php")]),a._v(" file located in "),e("code",[a._v("packages/Webkul/Category/src/Providers")]),a._v(".")]),a._v(" "),e("li",[a._v("Add the following code to the "),e("code",[a._v("boot")]),a._v(" method:")])]),a._v(" "),e("div",{staticClass:"language-php extra-class"},[e("pre",{pre:!0,attrs:{class:"language-php"}},[e("code",[e("span",{pre:!0,attrs:{class:"token php language-php"}},[e("span",{pre:!0,attrs:{class:"token delimiter important"}},[a._v("")]),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("loadTranslationsFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token constant"}},[a._v("__DIR__")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[a._v(".")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'/../Resources/lang'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[a._v("'category'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])])]),e("h4",{attrs:{id:"explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("This code uses "),e("code",[a._v("$this->loadTranslationsFrom")]),a._v(" to register translations from the lang directory of your package ("),e("code",[a._v("packages/ Webkul/Category/src/Resources/lang")]),a._v(") under the namespace "),e("code",[a._v("'category'")]),a._v(".")])]),a._v(" "),e("li",[e("p",[a._v("The "),e("code",[a._v("loadTranslationsFrom")]),a._v(" method registers translations for the "),e("code",[a._v("'category'")]),a._v(" namespace from the specified path ("),e("code",[a._v("__DIR__ . '/../Resources/lang'")]),a._v(").")])]),a._v(" "),e("li",[e("p",[a._v("This makes translations accessible throughout your Laravel application using the "),e("code",[a._v("'category'")]),a._v(" namespace prefix.")])])]),a._v(" "),e("h3",{attrs:{id:"use-translations-in-blade-files"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-translations-in-blade-files"}},[a._v("#")]),a._v(" Use Translations in Blade Files")]),a._v(" "),e("p",[a._v("In your Blade templates ("),e("code",[a._v(".blade.php")]),a._v(" files), you can use the "),e("code",[a._v("@lang")]),a._v(" helper function to retrieve translations. Use the namespace 'category' followed by the translation key. For example:")]),a._v(" "),e("div",{staticClass:"language-html extra-class"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[a._v("@lang('category::categories.index.title')\n")])])]),e("h4",{attrs:{id:"explanation-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[a._v("#")]),a._v(" Explanation")]),a._v(" "),e("ul",[e("li",[e("p",[a._v("The "),e("code",[a._v("@lang('category::categories.index.title')")]),a._v(" syntax fetches the translation for for "),e("code",[a._v("categories")]),a._v(" > "),e("code",[a._v("index")]),a._v(" > "),e("code",[a._v("title")])])]),a._v(" "),e("li",[e("p",[a._v("Replace "),e("code",[a._v("'categories.index.title'")]),a._v(" with your actual translation keys to use different translations as needed in your application.")])])]),a._v(" "),e("p",[a._v("By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/90.da3b29cf.js b/assets/js/90.5199bce8.js similarity index 99% rename from assets/js/90.da3b29cf.js rename to assets/js/90.5199bce8.js index b9b39c9..4769061 100644 --- a/assets/js/90.da3b29cf.js +++ b/assets/js/90.5199bce8.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{387:function(t,s,a){"use strict";a.r(s);var e=a(10),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"routes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#routes"}},[t._v("#")]),t._v(" Routes")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#create-a-new-route"}},[t._v("Create a new Route")]),s("ul",[s("li",[s("a",{attrs:{href:"#routes"}},[t._v("Routes")])])])]),s("li",[s("a",{attrs:{href:"#loading-routes"}},[t._v("Loading Routes")]),s("ul",[s("li",[s("a",{attrs:{href:"#register-routes-in-serviceprovider"}},[t._v("Register Routes in ServiceProvider")])])])]),s("li",[s("a",{attrs:{href:"#available-http-methods"}},[t._v("Available HTTP methods")]),s("ul",[s("li",[s("a",{attrs:{href:"#get"}},[t._v("GET")])]),s("li",[s("a",{attrs:{href:"#post"}},[t._v("POST")])]),s("li",[s("a",{attrs:{href:"#put"}},[t._v("PUT")])]),s("li",[s("a",{attrs:{href:"#delete"}},[t._v("DELETE")])]),s("li",[s("a",{attrs:{href:"#patch"}},[t._v("PATCH")])])])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("Routes in Laravel define the entry points of your application, mapping HTTP requests to specific controllers or closures. They play a crucial role in defining how users interact with your web application's endpoints.")]),t._v(" "),s("p",[t._v("Routes can be defined to handle various HTTP methods (GET, Category, PUT, DELETE, etc.) and can include parameters and route parameters to capture dynamic values from the URL. Laravel's routing system is powerful and flexible, allowing for easy RESTful routing and middleware application to routes.")]),t._v(" "),s("p",[t._v("For detailed information on Laravel routes, including how to define routes, use route parameters, and apply middleware, refer to the "),s("a",{attrs:{href:"https://laravel.com/docs/11.x/routing",target:"_blank",rel:"noopener noreferrer"}},[t._v("Laravel Documentation on Routing"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"create-a-new-route"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-route"}},[t._v("#")]),t._v(" Create a new Route")]),t._v(" "),s("p",[t._v('Let\'s start by creating a route to display the categories. We will assume that the package name is "Category".')]),t._v(" "),s("p",[t._v("Start by creating a "),s("code",[t._v("Routes")]),t._v(" directory inside "),s("code",[t._v("packages/Webkul/Category/src")]),t._v(".")]),t._v(" "),s("p",[t._v("Inside the "),s("code",[t._v("Routes")]),t._v(" directory, create file named "),s("code",[t._v("routes.php")]),t._v(".")]),t._v(" "),s("p",[t._v("The updated directory structure will look like this:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("packages\n└── Webkul\n └── Category\n └── src\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Routes\n └── routes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),s("h3",{attrs:{id:"routes-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#routes-2"}},[t._v("#")]),t._v(" Routes")]),t._v(" "),s("p",[s("code",[t._v("routes.php")]),t._v(" This file is for Routes. Add the following code to this file:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'web'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin_locale'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'prefix'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'app.admin_path'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),s("h4",{attrs:{id:"explanation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("Routes inside "),s("code",[t._v("routes.php")]),t._v(" are prefixed with the admin URL ("),s("code",[t._v("config('app.admin_path')")]),t._v(") and apply the "),s("code",[t._v("web")]),t._v(" and "),s("code",[t._v("admin_locale")]),t._v(" middleware groups. Adjust the middleware and URL prefix according to your application's configuration.")]),t._v(" "),s("h2",{attrs:{id:"loading-routes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#loading-routes"}},[t._v("#")]),t._v(" Loading Routes")]),t._v(" "),s("h3",{attrs:{id:"register-routes-in-serviceprovider"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#register-routes-in-serviceprovider"}},[t._v("#")]),t._v(" Register Routes in ServiceProvider")]),t._v(" "),s("p",[t._v("In the CategoryServiceProvider.php` class, load the routes using the loadRoutesFrom method inside the boot method.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("loadRoutesFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/../Routes/routes.php'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register services.\n * \n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("register")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),s("h4",{attrs:{id:"explanation-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("loadRoutesFrom")]),t._v(" method registers the routes defined in "),s("code",[t._v("routes.php")]),t._v(", within the Laravel application, integrating them into the routing system.")]),t._v(" "),s("h2",{attrs:{id:"available-http-methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#available-http-methods"}},[t._v("#")]),t._v(" Available HTTP methods")]),t._v(" "),s("p",[t._v("Basic routes are the most common type of routes in Laravel. They respond to HTTP requests like "),s("code",[t._v("GET")]),t._v(", "),s("code",[t._v("POST")]),t._v(", "),s("code",[t._v("PUT")]),t._v(", "),s("code",[t._v("DELETE")]),t._v(", etc., and map the URL to a specific controller method or closure function. For example:")]),t._v(" "),s("h3",{attrs:{id:"get"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get"}},[t._v("#")]),t._v(" GET")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("GET")]),t._v(" method is used to retrieve data from the server. It is typically used to display pages or retrieve information.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a GET request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"post"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#post"}},[t._v("#")]),t._v(" POST")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("POST")]),t._v(" method is used to submit data to the server. It is commonly used for form submissions.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a Category request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("post")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'store'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"put"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#put"}},[t._v("#")]),t._v(" PUT")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("PUT")]),t._v(" method is used to update existing data on the server. It is usually used for updating resources.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a PUT request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'update'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"delete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#delete"}},[t._v("#")]),t._v(" DELETE")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DELETE")]),t._v(" method is used to delete data from the server. It is used to remove resources.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a DELETE request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("delete")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'destroy'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"patch"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#patch"}},[t._v("#")]),t._v(" PATCH")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("PATCH")]),t._v(" method is similar to "),s("code",[t._v("PUT")]),t._v(", but it is used to make partial updates to data on the server.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a PATCH request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("patch")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'partialUpdate'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{388:function(t,s,a){"use strict";a.r(s);var e=a(10),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"routes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#routes"}},[t._v("#")]),t._v(" Routes")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#introduction"}},[t._v("Introduction")])]),s("li",[s("a",{attrs:{href:"#create-a-new-route"}},[t._v("Create a new Route")]),s("ul",[s("li",[s("a",{attrs:{href:"#routes"}},[t._v("Routes")])])])]),s("li",[s("a",{attrs:{href:"#loading-routes"}},[t._v("Loading Routes")]),s("ul",[s("li",[s("a",{attrs:{href:"#register-routes-in-serviceprovider"}},[t._v("Register Routes in ServiceProvider")])])])]),s("li",[s("a",{attrs:{href:"#available-http-methods"}},[t._v("Available HTTP methods")]),s("ul",[s("li",[s("a",{attrs:{href:"#get"}},[t._v("GET")])]),s("li",[s("a",{attrs:{href:"#post"}},[t._v("POST")])]),s("li",[s("a",{attrs:{href:"#put"}},[t._v("PUT")])]),s("li",[s("a",{attrs:{href:"#delete"}},[t._v("DELETE")])]),s("li",[s("a",{attrs:{href:"#patch"}},[t._v("PATCH")])])])])])]),s("p"),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("Routes in Laravel define the entry points of your application, mapping HTTP requests to specific controllers or closures. They play a crucial role in defining how users interact with your web application's endpoints.")]),t._v(" "),s("p",[t._v("Routes can be defined to handle various HTTP methods (GET, Category, PUT, DELETE, etc.) and can include parameters and route parameters to capture dynamic values from the URL. Laravel's routing system is powerful and flexible, allowing for easy RESTful routing and middleware application to routes.")]),t._v(" "),s("p",[t._v("For detailed information on Laravel routes, including how to define routes, use route parameters, and apply middleware, refer to the "),s("a",{attrs:{href:"https://laravel.com/docs/11.x/routing",target:"_blank",rel:"noopener noreferrer"}},[t._v("Laravel Documentation on Routing"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"create-a-new-route"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-route"}},[t._v("#")]),t._v(" Create a new Route")]),t._v(" "),s("p",[t._v('Let\'s start by creating a route to display the categories. We will assume that the package name is "Category".')]),t._v(" "),s("p",[t._v("Start by creating a "),s("code",[t._v("Routes")]),t._v(" directory inside "),s("code",[t._v("packages/Webkul/Category/src")]),t._v(".")]),t._v(" "),s("p",[t._v("Inside the "),s("code",[t._v("Routes")]),t._v(" directory, create file named "),s("code",[t._v("routes.php")]),t._v(".")]),t._v(" "),s("p",[t._v("The updated directory structure will look like this:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[t._v("packages\n└── Webkul\n └── Category\n └── src\n ├── "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n └── Routes\n └── routes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("php\n")])])]),s("h3",{attrs:{id:"routes-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#routes-2"}},[t._v("#")]),t._v(" Routes")]),t._v(" "),s("p",[s("code",[t._v("routes.php")]),t._v(" This file is for Routes. Add the following code to this file:")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'web'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'admin_locale'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'prefix'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'app.admin_path'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),s("h4",{attrs:{id:"explanation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("Routes inside "),s("code",[t._v("routes.php")]),t._v(" are prefixed with the admin URL ("),s("code",[t._v("config('app.admin_path')")]),t._v(") and apply the "),s("code",[t._v("web")]),t._v(" and "),s("code",[t._v("admin_locale")]),t._v(" middleware groups. Adjust the middleware and URL prefix according to your application's configuration.")]),t._v(" "),s("h2",{attrs:{id:"loading-routes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#loading-routes"}},[t._v("#")]),t._v(" Loading Routes")]),t._v(" "),s("h3",{attrs:{id:"register-routes-in-serviceprovider"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#register-routes-in-serviceprovider"}},[t._v("#")]),t._v(" Register Routes in ServiceProvider")]),t._v(" "),s("p",[t._v("In the CategoryServiceProvider.php` class, load the routes using the loadRoutesFrom method inside the boot method.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token php language-php"}},[s("span",{pre:!0,attrs:{class:"token delimiter important"}},[t._v("")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("loadRoutesFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("__DIR__")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'/../Routes/routes.php'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Register services.\n * \n * @return void\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("register")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),s("h4",{attrs:{id:"explanation-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("loadRoutesFrom")]),t._v(" method registers the routes defined in "),s("code",[t._v("routes.php")]),t._v(", within the Laravel application, integrating them into the routing system.")]),t._v(" "),s("h2",{attrs:{id:"available-http-methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#available-http-methods"}},[t._v("#")]),t._v(" Available HTTP methods")]),t._v(" "),s("p",[t._v("Basic routes are the most common type of routes in Laravel. They respond to HTTP requests like "),s("code",[t._v("GET")]),t._v(", "),s("code",[t._v("POST")]),t._v(", "),s("code",[t._v("PUT")]),t._v(", "),s("code",[t._v("DELETE")]),t._v(", etc., and map the URL to a specific controller method or closure function. For example:")]),t._v(" "),s("h3",{attrs:{id:"get"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get"}},[t._v("#")]),t._v(" GET")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("GET")]),t._v(" method is used to retrieve data from the server. It is typically used to display pages or retrieve information.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a GET request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'index'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"post"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#post"}},[t._v("#")]),t._v(" POST")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("POST")]),t._v(" method is used to submit data to the server. It is commonly used for form submissions.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a Category request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("post")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'store'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"put"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#put"}},[t._v("#")]),t._v(" PUT")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("PUT")]),t._v(" method is used to update existing data on the server. It is usually used for updating resources.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a PUT request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'update'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"delete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#delete"}},[t._v("#")]),t._v(" DELETE")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DELETE")]),t._v(" method is used to delete data from the server. It is used to remove resources.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a DELETE request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("delete")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'destroy'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"patch"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#patch"}},[t._v("#")]),t._v(" PATCH")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("PATCH")]),t._v(" method is similar to "),s("code",[t._v("PUT")]),t._v(", but it is used to make partial updates to data on the server.")]),t._v(" "),s("div",{staticClass:"language-php extra-class"},[s("pre",{pre:!0,attrs:{class:"language-php"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Define a route that responds to a PATCH request")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("Route")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("patch")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'categories/{id}'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token class-name static-context"}},[t._v("CategoryController")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[t._v("'partialUpdate'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/93.e70b4764.js b/assets/js/93.f9bd3968.js similarity index 99% rename from assets/js/93.e70b4764.js rename to assets/js/93.f9bd3968.js index 5a7bae0..cb10b34 100644 --- a/assets/js/93.e70b4764.js +++ b/assets/js/93.f9bd3968.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[93],{391:function(e,t,a){"use strict";a.r(t);var s=a(10),r=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"views"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#views"}},[e._v("#")]),e._v(" Views")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#directory-structure"}},[e._v("Directory Structure")]),t("ul",[t("li",[t("a",{attrs:{href:"#adding-html-content"}},[e._v("Adding HTML Content")])])])]),t("li",[t("a",{attrs:{href:"#load-views-from-package"}},[e._v("Load Views from Package")])]),t("li",[t("a",{attrs:{href:"#rendering-views"}},[e._v("Rendering Views")])]),t("li",[t("a",{attrs:{href:"#blade-file-naming-convention"}},[e._v("Blade File Naming Convention")]),t("ul",[t("li",[t("a",{attrs:{href:"#listing-index-blade"}},[e._v("Listing (Index Blade):")])]),t("li",[t("a",{attrs:{href:"#creation-create-blade"}},[e._v("Creation (Create Blade):")])]),t("li",[t("a",{attrs:{href:"#updating-edit-blade"}},[e._v("Updating (Edit Blade):")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Views in Laravel are responsible for separating the application's logic from the presentation layer. They provide a clean way to manage and organize the HTML content of your application. Views are typically stored in the "),t("code",[e._v("resources/views")]),e._v(" directory and are rendered using the Blade templating engine, which offers a simple and powerful way to create dynamic content.")]),e._v(" "),t("p",[e._v("By using views, you can create reusable templates and components, making your code more maintainable and easier to understand. Blade templates allow you to use control structures like loops and conditionals, as well as to include other templates, which helps to keep your views organized and modular.")]),e._v(" "),t("p",[e._v("To learn in detail about Views, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/views",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Here's a basic example of a Blade template:")]),e._v(" "),t("h2",{attrs:{id:"directory-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[e._v("#")]),e._v(" Directory Structure")]),e._v(" "),t("p",[e._v("To organize the views for our "),t("code",[e._v("Category")]),e._v(" package, we need to set up a specific directory structure. Follow the steps below to create the necessary directories.")]),e._v(" "),t("h4",{attrs:{id:"create-the-resources-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-resources-directory"}},[e._v("#")]),e._v(" Create the "),t("code",[e._v("Resources")]),e._v(" Directory")]),e._v(" "),t("ul",[t("li",[e._v("Navigate to the "),t("code",[e._v("packages/Webkul/Category/src")]),e._v(" directory.")]),e._v(" "),t("li",[e._v("Create a directory named "),t("code",[e._v("Resources")]),e._v(".")])]),e._v(" "),t("h4",{attrs:{id:"create-the-views-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-views-directory"}},[e._v("#")]),e._v(" Create the "),t("code",[e._v("views")]),e._v(" Directory")]),e._v(" "),t("ul",[t("li",[e._v("Inside the "),t("code",[e._v("Resources")]),e._v(" directory, create another directory named "),t("code",[e._v("views")]),e._v(" and inside the views directory create category directory.")]),e._v(" "),t("li",[e._v("Inside the "),t("code",[e._v("views/category")]),e._v(" directory, create a file named "),t("code",[e._v("index.blade.php")]),e._v(", "),t("code",[e._v("create.blade.php")]),e._v(", "),t("code",[e._v("edit.blade.php")]),e._v(" .")])]),e._v(" "),t("p",[e._v("The updated directory structure will look like this:")]),e._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[e._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("..")]),e._v(".\n └── Resources\n └── views\n └── category\n ├── create.blade.php\n ├── edit.blade.php\n └── index.blade.php\n")])])]),t("h3",{attrs:{id:"adding-html-content"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#adding-html-content"}},[e._v("#")]),e._v(" Adding HTML Content")]),e._v(" "),t("p",[e._v("Below is an example of basic HTML content that you can add to each "),t("code",[e._v("index.blade.php")]),e._v(" file.")]),e._v(" "),t("h4",{attrs:{id:"index-blade-php-in-the-category-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#index-blade-php-in-the-category-directory"}},[e._v("#")]),e._v(" "),t("code",[e._v("index.blade.php")]),e._v(" in the "),t("code",[e._v("category")]),e._v(" Directory")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("admin")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("layouts")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("-")]),e._v("slot"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v("title"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n @"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("lang")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category::app.categories.index.title'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("/")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("-")]),e._v("slot"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("!")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("--")]),e._v(" Content "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("--")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),e._v("div "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[e._v('"flex gap-4"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("/")]),e._v("div"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("/")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("admin")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("layouts")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n")])])]),t("h2",{attrs:{id:"load-views-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#load-views-from-package"}},[e._v("#")]),e._v(" Load Views from Package")]),e._v(" "),t("p",[e._v("To make the views in our package accessible, we need to register them in the service provider's "),t("code",[e._v("boot")]),e._v(" method. This involves updating the "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(" file to include the view loading logic. Follow the steps below:")]),e._v(" "),t("h4",{attrs:{id:"open-the-service-provider-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#open-the-service-provider-file"}},[e._v("#")]),e._v(" Open the Service Provider File")]),e._v(" "),t("ul",[t("li",[e._v("Navigate to the "),t("code",[e._v("packages/Webkul/Category/src/Providers")]),e._v(" directory.")]),e._v(" "),t("li",[e._v("Open the "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(" file.")])]),e._v(" "),t("h4",{attrs:{id:"update-the-boot-method"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#update-the-boot-method"}},[e._v("#")]),e._v(" Update the "),t("code",[e._v("boot")]),e._v(" Method")]),e._v(" "),t("ul",[t("li",[e._v("Inside the "),t("code",[e._v("boot")]),e._v(" method of the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class, add the logic to load views from the package.")])]),e._v(" "),t("h4",{attrs:{id:"updated-categoryserviceprovider-php"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updated-categoryserviceprovider-php"}},[e._v("#")]),e._v(" Updated "),t("code",[e._v("CategoryServiceProvider.php")])]),e._v(" "),t("p",[e._v("Here is the updated code for "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("loadViewsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("__DIR__")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(".")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'/../Resources/views'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("h4",{attrs:{id:"explanation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("namespace")]),e._v(" keyword defines the namespace for the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class, which is "),t("code",[e._v("Webkul\\Category\\Providers")]),e._v(".")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class extends Laravel's base "),t("code",[e._v("ServiceProvider")]),e._v(" class.")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("boot")]),e._v(" method is used to bootstrap any application services.")])]),e._v(" "),t("li",[t("p",[e._v("Inside the "),t("code",[e._v("boot")]),e._v(" method, we use the "),t("code",[e._v("$this->loadViewsFrom")]),e._v(" method to register the views from the package.")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("loadViewsFrom")]),e._v(" method takes two arguments:")]),e._v(" "),t("ul",[t("li",[e._v("The path to the views directory within the package: "),t("code",[e._v("__DIR__ . '/../Resources/views'")]),e._v(".")]),e._v(" "),t("li",[e._v("A namespace for the views: "),t("code",[e._v("'category'")]),e._v(".")])])])]),e._v(" "),t("h2",{attrs:{id:"rendering-views"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rendering-views"}},[e._v("#")]),e._v(" Rendering Views")]),e._v(" "),t("p",[e._v("In Laravel applications, views are typically rendered from controller methods using the "),t("code",[e._v("view")]),e._v(" helper function. This section describes how views are invoked and passed data from a controller.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("categoryRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("with")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'author'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("view")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category::category.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("compact")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("h4",{attrs:{id:"explanation-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("view")]),e._v(" helper function in Laravel is used within the "),t("code",[e._v("index")]),e._v(" method of the "),t("code",[e._v("CategoryController")]),e._v(" to render the "),t("code",[e._v("category::category.index")]),e._v(" view.")])]),e._v(" "),t("li",[t("p",[e._v("It accepts two parameters the name of the view ("),t("code",[e._v("category::category.index")]),e._v(") and an array of data ("),t("code",[e._v("compact('categories')")]),e._v(") to pass to the "),t("code",[e._v("view")]),e._v(".")])])]),e._v(" "),t("h2",{attrs:{id:"blade-file-naming-convention"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#blade-file-naming-convention"}},[e._v("#")]),e._v(" Blade File Naming Convention")]),e._v(" "),t("p",[e._v("Krayin utilizes Blade templates to handle "),t("code",[e._v("listing")]),e._v(", "),t("code",[e._v("creation")]),e._v(", and "),t("code",[e._v("updating")]),e._v(" operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.")]),e._v(" "),t("h3",{attrs:{id:"listing-index-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-index-blade"}},[e._v("#")]),e._v(" Listing (Index Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("index.blade.php")]),e._v(" template is used to display a list of all records (categories).")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("index")]),e._v(" method fetches all categories and passes them to the view.")])])]),e._v(" "),t("h3",{attrs:{id:"creation-create-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creation-create-blade"}},[e._v("#")]),e._v(" Creation (Create Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("create.blade.php")]),e._v(" template contains a form for creating new records.")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("create")]),e._v(" method renders this view.")])])]),e._v(" "),t("h3",{attrs:{id:"updating-edit-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updating-edit-blade"}},[e._v("#")]),e._v(" Updating (Edit Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("edit.blade.php")]),e._v(" template contains a form for editing existing records.")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("edit")]),e._v(" method fetches the specific categories and passes it to the view.")])])]),e._v(" "),t("p",[e._v("By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[93],{392:function(e,t,a){"use strict";a.r(t);var s=a(10),r=Object(s.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"views"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#views"}},[e._v("#")]),e._v(" Views")]),e._v(" "),t("p"),t("div",{staticClass:"table-of-contents"},[t("ul",[t("li",[t("a",{attrs:{href:"#introduction"}},[e._v("Introduction")])]),t("li",[t("a",{attrs:{href:"#directory-structure"}},[e._v("Directory Structure")]),t("ul",[t("li",[t("a",{attrs:{href:"#adding-html-content"}},[e._v("Adding HTML Content")])])])]),t("li",[t("a",{attrs:{href:"#load-views-from-package"}},[e._v("Load Views from Package")])]),t("li",[t("a",{attrs:{href:"#rendering-views"}},[e._v("Rendering Views")])]),t("li",[t("a",{attrs:{href:"#blade-file-naming-convention"}},[e._v("Blade File Naming Convention")]),t("ul",[t("li",[t("a",{attrs:{href:"#listing-index-blade"}},[e._v("Listing (Index Blade):")])]),t("li",[t("a",{attrs:{href:"#creation-create-blade"}},[e._v("Creation (Create Blade):")])]),t("li",[t("a",{attrs:{href:"#updating-edit-blade"}},[e._v("Updating (Edit Blade):")])])])])])]),t("p"),e._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Views in Laravel are responsible for separating the application's logic from the presentation layer. They provide a clean way to manage and organize the HTML content of your application. Views are typically stored in the "),t("code",[e._v("resources/views")]),e._v(" directory and are rendered using the Blade templating engine, which offers a simple and powerful way to create dynamic content.")]),e._v(" "),t("p",[e._v("By using views, you can create reusable templates and components, making your code more maintainable and easier to understand. Blade templates allow you to use control structures like loops and conditionals, as well as to include other templates, which helps to keep your views organized and modular.")]),e._v(" "),t("p",[e._v("To learn in detail about Views, you can visit the Laravel documentation "),t("a",{attrs:{href:"https://laravel.com/docs/11.x/views",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Here's a basic example of a Blade template:")]),e._v(" "),t("h2",{attrs:{id:"directory-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#directory-structure"}},[e._v("#")]),e._v(" Directory Structure")]),e._v(" "),t("p",[e._v("To organize the views for our "),t("code",[e._v("Category")]),e._v(" package, we need to set up a specific directory structure. Follow the steps below to create the necessary directories.")]),e._v(" "),t("h4",{attrs:{id:"create-the-resources-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-resources-directory"}},[e._v("#")]),e._v(" Create the "),t("code",[e._v("Resources")]),e._v(" Directory")]),e._v(" "),t("ul",[t("li",[e._v("Navigate to the "),t("code",[e._v("packages/Webkul/Category/src")]),e._v(" directory.")]),e._v(" "),t("li",[e._v("Create a directory named "),t("code",[e._v("Resources")]),e._v(".")])]),e._v(" "),t("h4",{attrs:{id:"create-the-views-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-the-views-directory"}},[e._v("#")]),e._v(" Create the "),t("code",[e._v("views")]),e._v(" Directory")]),e._v(" "),t("ul",[t("li",[e._v("Inside the "),t("code",[e._v("Resources")]),e._v(" directory, create another directory named "),t("code",[e._v("views")]),e._v(" and inside the views directory create category directory.")]),e._v(" "),t("li",[e._v("Inside the "),t("code",[e._v("views/category")]),e._v(" directory, create a file named "),t("code",[e._v("index.blade.php")]),e._v(", "),t("code",[e._v("create.blade.php")]),e._v(", "),t("code",[e._v("edit.blade.php")]),e._v(" .")])]),e._v(" "),t("p",[e._v("The updated directory structure will look like this:")]),e._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[e._v(" └── packages\n └── Webkul\n └── Category\n └── src\n ├── "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("..")]),e._v(".\n └── Resources\n └── views\n └── category\n ├── create.blade.php\n ├── edit.blade.php\n └── index.blade.php\n")])])]),t("h3",{attrs:{id:"adding-html-content"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#adding-html-content"}},[e._v("#")]),e._v(" Adding HTML Content")]),e._v(" "),t("p",[e._v("Below is an example of basic HTML content that you can add to each "),t("code",[e._v("index.blade.php")]),e._v(" file.")]),e._v(" "),t("h4",{attrs:{id:"index-blade-php-in-the-category-directory"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#index-blade-php-in-the-category-directory"}},[e._v("#")]),e._v(" "),t("code",[e._v("index.blade.php")]),e._v(" in the "),t("code",[e._v("category")]),e._v(" Directory")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("admin")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("layouts")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("-")]),e._v("slot"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(":")]),e._v("title"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n @"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("lang")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category::app.categories.index.title'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("/")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("-")]),e._v("slot"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("!")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("--")]),e._v(" Content "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("--")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),e._v("div "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("class")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),t("span",{pre:!0,attrs:{class:"token string double-quoted-string"}},[e._v('"flex gap-4"')]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("/")]),e._v("div"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("<")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("/")]),e._v("x"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("-")]),t("span",{pre:!0,attrs:{class:"token class-name static-context"}},[e._v("admin")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("::")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("layouts")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v("\n")])])]),t("h2",{attrs:{id:"load-views-from-package"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#load-views-from-package"}},[e._v("#")]),e._v(" Load Views from Package")]),e._v(" "),t("p",[e._v("To make the views in our package accessible, we need to register them in the service provider's "),t("code",[e._v("boot")]),e._v(" method. This involves updating the "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(" file to include the view loading logic. Follow the steps below:")]),e._v(" "),t("h4",{attrs:{id:"open-the-service-provider-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#open-the-service-provider-file"}},[e._v("#")]),e._v(" Open the Service Provider File")]),e._v(" "),t("ul",[t("li",[e._v("Navigate to the "),t("code",[e._v("packages/Webkul/Category/src/Providers")]),e._v(" directory.")]),e._v(" "),t("li",[e._v("Open the "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(" file.")])]),e._v(" "),t("h4",{attrs:{id:"update-the-boot-method"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#update-the-boot-method"}},[e._v("#")]),e._v(" Update the "),t("code",[e._v("boot")]),e._v(" Method")]),e._v(" "),t("ul",[t("li",[e._v("Inside the "),t("code",[e._v("boot")]),e._v(" method of the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class, add the logic to load views from the package.")])]),e._v(" "),t("h4",{attrs:{id:"updated-categoryserviceprovider-php"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updated-categoryserviceprovider-php"}},[e._v("#")]),e._v(" Updated "),t("code",[e._v("CategoryServiceProvider.php")])]),e._v(" "),t("p",[e._v("Here is the updated code for "),t("code",[e._v("CategoryServiceProvider.php")]),e._v(":")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("loadViewsFrom")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token constant"}},[e._v("__DIR__")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(".")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'/../Resources/views'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("h4",{attrs:{id:"explanation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("namespace")]),e._v(" keyword defines the namespace for the "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class, which is "),t("code",[e._v("Webkul\\Category\\Providers")]),e._v(".")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("CategoryServiceProvider")]),e._v(" class extends Laravel's base "),t("code",[e._v("ServiceProvider")]),e._v(" class.")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("boot")]),e._v(" method is used to bootstrap any application services.")])]),e._v(" "),t("li",[t("p",[e._v("Inside the "),t("code",[e._v("boot")]),e._v(" method, we use the "),t("code",[e._v("$this->loadViewsFrom")]),e._v(" method to register the views from the package.")])]),e._v(" "),t("li",[t("p",[e._v("The "),t("code",[e._v("loadViewsFrom")]),e._v(" method takes two arguments:")]),e._v(" "),t("ul",[t("li",[e._v("The path to the views directory within the package: "),t("code",[e._v("__DIR__ . '/../Resources/views'")]),e._v(".")]),e._v(" "),t("li",[e._v("A namespace for the views: "),t("code",[e._v("'category'")]),e._v(".")])])])]),e._v(" "),t("h2",{attrs:{id:"rendering-views"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rendering-views"}},[e._v("#")]),e._v(" Rendering Views")]),e._v(" "),t("p",[e._v("In Laravel applications, views are typically rendered from controller methods using the "),t("code",[e._v("view")]),e._v(" helper function. This section describes how views are invoked and passed data from a controller.")]),e._v(" "),t("div",{staticClass:"language-php extra-class"},[t("pre",{pre:!0,attrs:{class:"language-php"}},[t("code",[t("span",{pre:!0,attrs:{class:"token php language-php"}},[t("span",{pre:!0,attrs:{class:"token delimiter important"}},[e._v("")]),t("span",{pre:!0,attrs:{class:"token property"}},[e._v("categoryRepository")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("with")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'author'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("->")]),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("all")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("return")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("view")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'category::category.index'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("compact")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),t("span",{pre:!0,attrs:{class:"token string single-quoted-string"}},[e._v("'categories'")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])]),t("h4",{attrs:{id:"explanation-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#explanation-2"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("view")]),e._v(" helper function in Laravel is used within the "),t("code",[e._v("index")]),e._v(" method of the "),t("code",[e._v("CategoryController")]),e._v(" to render the "),t("code",[e._v("category::category.index")]),e._v(" view.")])]),e._v(" "),t("li",[t("p",[e._v("It accepts two parameters the name of the view ("),t("code",[e._v("category::category.index")]),e._v(") and an array of data ("),t("code",[e._v("compact('categories')")]),e._v(") to pass to the "),t("code",[e._v("view")]),e._v(".")])])]),e._v(" "),t("h2",{attrs:{id:"blade-file-naming-convention"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#blade-file-naming-convention"}},[e._v("#")]),e._v(" Blade File Naming Convention")]),e._v(" "),t("p",[e._v("Krayin utilizes Blade templates to handle "),t("code",[e._v("listing")]),e._v(", "),t("code",[e._v("creation")]),e._v(", and "),t("code",[e._v("updating")]),e._v(" operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.")]),e._v(" "),t("h3",{attrs:{id:"listing-index-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#listing-index-blade"}},[e._v("#")]),e._v(" Listing (Index Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("index.blade.php")]),e._v(" template is used to display a list of all records (categories).")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("index")]),e._v(" method fetches all categories and passes them to the view.")])])]),e._v(" "),t("h3",{attrs:{id:"creation-create-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creation-create-blade"}},[e._v("#")]),e._v(" Creation (Create Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("create.blade.php")]),e._v(" template contains a form for creating new records.")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("create")]),e._v(" method renders this view.")])])]),e._v(" "),t("h3",{attrs:{id:"updating-edit-blade"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updating-edit-blade"}},[e._v("#")]),e._v(" Updating (Edit Blade):")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("The "),t("code",[e._v("edit.blade.php")]),e._v(" template contains a form for editing existing records.")])]),e._v(" "),t("li",[t("p",[e._v("The controller's "),t("code",[e._v("edit")]),e._v(" method fetches the specific categories and passes it to the view.")])])]),e._v(" "),t("p",[e._v("By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/94.711741af.js b/assets/js/94.3ca207f4.js similarity index 99% rename from assets/js/94.711741af.js rename to assets/js/94.3ca207f4.js index a8cdb31..90a4b5f 100644 --- a/assets/js/94.711741af.js +++ b/assets/js/94.3ca207f4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{392:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"prologue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#prologue"}},[e._v("#")]),e._v(" Prologue")]),e._v(" "),t("h2",{attrs:{id:"introduction-to-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction-to-krayin"}},[e._v("#")]),e._v(" Introduction to Krayin")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" CRM is a hand tailored CRM framework built on some of the hottest opensource technologies such as "),t("a",{attrs:{href:"https://laravel.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Laravel"),t("OutboundLink")],1),e._v(" (a PHP framework), "),t("a",{attrs:{href:"https://tailwindcss.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Tailwind Css"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Vue.js"),t("OutboundLink")],1),e._v(" a progressive Javascript framework.")]),e._v(" "),t("p",[e._v("Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.")]),e._v(" "),t("p",[e._v("We also have a forum for any type of concerns, feature requests, or discussions. Try our "),t("a",{attrs:{href:"https://demo.krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("demo"),t("OutboundLink")],1),e._v(" or you can visit: "),t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"key-features-of-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features-of-krayin"}},[e._v("#")]),e._v(" Key Features of Krayin")]),e._v(" "),t("p",[e._v("Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.")]),e._v(" "),t("h3",{attrs:{id:"crm-dashboard"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#crm-dashboard"}},[e._v("#")]),e._v(" CRM Dashboard")]),e._v(" "),t("p",[e._v("Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.")]),e._v(" "),t("h3",{attrs:{id:"convert-opportunities-into-revenue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#convert-opportunities-into-revenue"}},[e._v("#")]),e._v(" Convert Opportunities into Revenue")]),e._v(" "),t("p",[e._v("Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.")]),e._v(" "),t("h3",{attrs:{id:"manage-interaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manage-interaction"}},[e._v("#")]),e._v(" Manage Interaction")]),e._v(" "),t("p",[e._v("Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.")]),e._v(" "),t("h3",{attrs:{id:"access-control-list-acl"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-control-list-acl"}},[e._v("#")]),e._v(" Access Control List (ACL)")]),e._v(" "),t("p",[e._v("Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.")]),e._v(" "),t("h3",{attrs:{id:"activities-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#activities-management"}},[e._v("#")]),e._v(" Activities Management")]),e._v(" "),t("p",[e._v("Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.")]),e._v(" "),t("h3",{attrs:{id:"kanban-visual-leads"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#kanban-visual-leads"}},[e._v("#")]),e._v(" Kanban Visual Leads")]),e._v(" "),t("p",[e._v("The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.")]),e._v(" "),t("h3",{attrs:{id:"unlimited-custom-fields"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#unlimited-custom-fields"}},[e._v("#")]),e._v(" Unlimited Custom Fields")]),e._v(" "),t("p",[e._v("Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.")]),e._v(" "),t("h3",{attrs:{id:"product-creation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#product-creation"}},[e._v("#")]),e._v(" Product Creation")]),e._v(" "),t("p",[e._v("Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.")]),e._v(" "),t("h3",{attrs:{id:"contact-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#contact-management"}},[e._v("#")]),e._v(" Contact Management")]),e._v(" "),t("p",[e._v("Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.")]),e._v(" "),t("h3",{attrs:{id:"modular-design"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#modular-design"}},[e._v("#")]),e._v(" Modular Design")]),e._v(" "),t("p",[e._v("Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.")]),e._v(" "),t("h2",{attrs:{id:"community-and-support"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-and-support"}},[e._v("#")]),e._v(" Community and Support")]),e._v(" "),t("p",[e._v("Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Explore Krayin")]),e._v(": Visit our website at "),t("a",{attrs:{href:"https://krayincrm.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" to discover more about Krayin's features and experience a demo.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("GitHub Repository")]),e._v(": Access the Krayin repository on "),t("a",{attrs:{href:"https://github.com/krayin/laravel-crm",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub"),t("OutboundLink")],1),e._v(" with over 8.8K+ stars, reflecting its popularity and community support.")])])]),e._v(" "),t("p",[e._v("Join the Krayin community today and manage your customer relationships with ease.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{391:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"prologue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#prologue"}},[e._v("#")]),e._v(" Prologue")]),e._v(" "),t("h2",{attrs:{id:"introduction-to-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction-to-krayin"}},[e._v("#")]),e._v(" Introduction to Krayin")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" CRM is a hand tailored CRM framework built on some of the hottest opensource technologies such as "),t("a",{attrs:{href:"https://laravel.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Laravel"),t("OutboundLink")],1),e._v(" (a PHP framework), "),t("a",{attrs:{href:"https://tailwindcss.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Tailwind Css"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Vue.js"),t("OutboundLink")],1),e._v(" a progressive Javascript framework.")]),e._v(" "),t("p",[e._v("Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.")]),e._v(" "),t("p",[e._v("We also have a forum for any type of concerns, feature requests, or discussions. Try our "),t("a",{attrs:{href:"https://demo.krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("demo"),t("OutboundLink")],1),e._v(" or you can visit: "),t("a",{attrs:{href:"https://krayincrm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"key-features-of-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features-of-krayin"}},[e._v("#")]),e._v(" Key Features of Krayin")]),e._v(" "),t("p",[e._v("Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.")]),e._v(" "),t("h3",{attrs:{id:"crm-dashboard"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#crm-dashboard"}},[e._v("#")]),e._v(" CRM Dashboard")]),e._v(" "),t("p",[e._v("Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.")]),e._v(" "),t("h3",{attrs:{id:"convert-opportunities-into-revenue"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#convert-opportunities-into-revenue"}},[e._v("#")]),e._v(" Convert Opportunities into Revenue")]),e._v(" "),t("p",[e._v("Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.")]),e._v(" "),t("h3",{attrs:{id:"manage-interaction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#manage-interaction"}},[e._v("#")]),e._v(" Manage Interaction")]),e._v(" "),t("p",[e._v("Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.")]),e._v(" "),t("h3",{attrs:{id:"access-control-list-acl"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#access-control-list-acl"}},[e._v("#")]),e._v(" Access Control List (ACL)")]),e._v(" "),t("p",[e._v("Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.")]),e._v(" "),t("h3",{attrs:{id:"activities-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#activities-management"}},[e._v("#")]),e._v(" Activities Management")]),e._v(" "),t("p",[e._v("Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.")]),e._v(" "),t("h3",{attrs:{id:"kanban-visual-leads"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#kanban-visual-leads"}},[e._v("#")]),e._v(" Kanban Visual Leads")]),e._v(" "),t("p",[e._v("The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.")]),e._v(" "),t("h3",{attrs:{id:"unlimited-custom-fields"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#unlimited-custom-fields"}},[e._v("#")]),e._v(" Unlimited Custom Fields")]),e._v(" "),t("p",[e._v("Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.")]),e._v(" "),t("h3",{attrs:{id:"product-creation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#product-creation"}},[e._v("#")]),e._v(" Product Creation")]),e._v(" "),t("p",[e._v("Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.")]),e._v(" "),t("h3",{attrs:{id:"contact-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#contact-management"}},[e._v("#")]),e._v(" Contact Management")]),e._v(" "),t("p",[e._v("Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.")]),e._v(" "),t("h3",{attrs:{id:"modular-design"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#modular-design"}},[e._v("#")]),e._v(" Modular Design")]),e._v(" "),t("p",[e._v("Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.")]),e._v(" "),t("h2",{attrs:{id:"community-and-support"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-and-support"}},[e._v("#")]),e._v(" Community and Support")]),e._v(" "),t("p",[e._v("Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Explore Krayin")]),e._v(": Visit our website at "),t("a",{attrs:{href:"https://krayincrm.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin"),t("OutboundLink")],1),e._v(" to discover more about Krayin's features and experience a demo.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("GitHub Repository")]),e._v(": Access the Krayin repository on "),t("a",{attrs:{href:"https://github.com/krayin/laravel-crm",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub"),t("OutboundLink")],1),e._v(" with over 8.8K+ stars, reflecting its popularity and community support.")])])]),e._v(" "),t("p",[e._v("Join the Krayin community today and manage your customer relationships with ease.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/app.630c4e21.js b/assets/js/app.3c95b0aa.js similarity index 58% rename from assets/js/app.630c4e21.js rename to assets/js/app.3c95b0aa.js index ea8ae66..7785abd 100644 --- a/assets/js/app.630c4e21.js +++ b/assets/js/app.3c95b0aa.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(e){function t(t){for(var r,o,l=t[0],s=t[1],c=t[2],d=0,p=[];d=t||n<0||g&&e-c>=i}function x(){var e=f();if(k(e))return _(e);l=setTimeout(x,function(e){var n=t-(e-s);return g?p(n,i-(e-c)):n}(e))}function _(e){return l=void 0,m&&r?y(e):(r=a=void 0,o)}function w(){var e=f(),n=k(e);if(r=arguments,a=this,s=e,n){if(void 0===l)return b(s);if(g)return l=setTimeout(x,t),y(s)}return void 0===l&&(l=setTimeout(x,t)),o}return t=h(t)||0,v(n)&&(u=!!n.leading,i=(g="maxWait"in n)?d(h(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m),w.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=a=l=void 0},w.flush=function(){return void 0===l?o:_(f())},w}},function(e,t,n){var r,a; +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(e){function t(t){for(var r,o,l=t[0],s=t[1],c=t[2],d=0,p=[];d=t||n<0||g&&e-c>=i}function x(){var e=f();if(k(e))return _(e);l=setTimeout(x,function(e){var n=t-(e-s);return g?p(n,i-(e-c)):n}(e))}function _(e){return l=void 0,m&&r?y(e):(r=a=void 0,o)}function w(){var e=f(),n=k(e);if(r=arguments,a=this,s=e,n){if(void 0===l)return b(s);if(g)return l=setTimeout(x,t),y(s)}return void 0===l&&(l=setTimeout(x,t)),o}return t=h(t)||0,v(n)&&(u=!!n.leading,i=(g="maxWait"in n)?d(h(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m),w.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=a=l=void 0},w.flush=function(){return void 0===l?o:_(f())},w}},function(e,t,n){var r,a; /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */void 0===(a="function"==typeof(r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
    '};function a(e,t,n){return en?n:e}function i(e){return 100*(-1+e)}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var s=n.render(!t),c=s.querySelector(r.barSelector),u=r.speed,d=r.easing;return s.offsetWidth,o((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),l(c,function(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+i(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+i(e)+"%,0)"}:{"margin-left":i(e)+"%"}).transition="all "+t+"ms "+n,a}(e,u,d)),1===e?(l(s,{transition:"none",opacity:1}),s.offsetWidth,setTimeout((function(){l(s,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,o=t.querySelector(r.barSelector),s=e?"-100":i(n.status||0),u=document.querySelector(r.parent);return l(o,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),u!=document.body&&c(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var o=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),l=function(){var e=["Webkit","O","Moz","ms"],t={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()})),t[n]||(t[n]=function(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,i=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+i)in n)return r;return t}(n))}function r(e,t,r){t=n(t),e.style[t]=r}return function(e,t){var n,a,i=arguments;if(2==i.length)for(n in t)void 0!==(a=t[n])&&t.hasOwnProperty(n)&&r(e,n,a);else r(e,i[1],i[2])}}();function s(e,t){return("string"==typeof e?e:d(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=d(e),r=n+t;s(n,t)||(e.className=r.substring(1))}function u(e,t){var n,r=d(e);s(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function d(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n})?r.call(t,n,t,e):r)||(e.exports=a)},function(e,t,n){"use strict";var r=n(0),a=n(46).f,i=n(13),o=n(94),l=n(34),s=n(62),c=n(121);e.exports=function(e,t){var n,u,d,p,f,v=e.target,h=e.global,g=e.stat;if(n=h?r:g?r[v]||l(v,{}):r[v]&&r[v].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(f=a(n,u))&&f.value:n[u],!c(h?u:v+(g?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;s(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),o(n,u,p,e)}}},function(e,t,n){"use strict";var r=n(26),a=Function.prototype.call;e.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},function(e,t,n){"use strict";var r=n(3);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},function(e,t,n){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";var r=n(47),a=n(29);e.exports=function(e){return r(a(e))}},function(e,t,n){"use strict";var r=n(48),a=TypeError;e.exports=function(e){if(r(e))throw new a("Can't call method on "+e);return e}},function(e,t,n){"use strict";var r=n(0),a=n(1),i=function(e){return a(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e]):r[e]&&r[e][t]}},function(e,t,n){"use strict";var r=n(1),a=n(103),i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(a(e)+" is not a function")}},function(e,t,n){"use strict";var r=n(0),a=n(56),i=n(8),o=n(58),l=n(53),s=n(52),c=r.Symbol,u=a("wks"),d=s?c.for||c:c&&c.withoutSetter||o;e.exports=function(e){return i(u,e)||(u[e]=l&&i(c,e)?c[e]:d("Symbol."+e)),u[e]}},function(e,t,n){"use strict";var r=n(57),a=n(0),i=n(34),o=e.exports=a["__core-js_shared__"]||i("__core-js_shared__",{});(o.versions||(o.versions=[])).push({version:"3.38.1",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})},function(e,t,n){"use strict";var r=n(0),a=Object.defineProperty;e.exports=function(e,t){try{a(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},function(e,t,n){"use strict";var r=n(29),a=Object;e.exports=function(e){return a(r(e))}},function(e,t,n){"use strict";var r=n(118);e.exports=function(e){return r(e.length)}},function(e,t,n){var r=n(146),a=n(11),i=Object.prototype,o=i.hasOwnProperty,l=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return a(e)&&o.call(e,"callee")&&!l.call(e,"callee")};e.exports=s},function(e,t,n){var r=n(9)(n(7),"Map");e.exports=r},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(166),a=n(173),i=n(175),o=n(176),l=n(177);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(4),a=n(44),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!a(e))||(o.test(e)||!i.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(12),a=n(11);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==r(e)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r=n(5),a=n(25),i=n(100),o=n(27),l=n(28),s=n(49),c=n(8),u=n(59),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=l(e),t=s(t),u)try{return d(e,t)}catch(e){}if(c(e,t))return o(!a(i.f,e,t),e[t])}},function(e,t,n){"use strict";var r=n(2),a=n(3),i=n(16),o=Object,l=r("".split);e.exports=a((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?l(e,""):o(e)}:o},function(e,t,n){"use strict";e.exports=function(e){return null==e}},function(e,t,n){"use strict";var r=n(101),a=n(50);e.exports=function(e){var t=r(e,"string");return a(t)?t:t+""}},function(e,t,n){"use strict";var r=n(30),a=n(1),i=n(51),o=n(52),l=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return a(t)&&i(t.prototype,l(e))}},function(e,t,n){"use strict";var r=n(2);e.exports=r({}.isPrototypeOf)},function(e,t,n){"use strict";var r=n(53);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){"use strict";var r=n(54),a=n(3),i=n(0).String;e.exports=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},function(e,t,n){"use strict";var r,a,i=n(0),o=n(55),l=i.process,s=i.Deno,c=l&&l.versions||s&&s.version,u=c&&c.v8;u&&(a=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!a&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(a=+r[1]),e.exports=a},function(e,t,n){"use strict";var r=n(0).navigator,a=r&&r.userAgent;e.exports=a?String(a):""},function(e,t,n){"use strict";var r=n(33);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},function(e,t,n){"use strict";e.exports=!1},function(e,t,n){"use strict";var r=n(2),a=0,i=Math.random(),o=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++a+i,36)}},function(e,t,n){"use strict";var r=n(5),a=n(3),i=n(105);e.exports=!r&&!a((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){"use strict";var r=n(6),a=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(a(e)+" is not an object")}},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(8),a=n(112),i=n(46),o=n(15);e.exports=function(e,t,n){for(var l=a(t),s=o.f,c=i.f,u=0;uu))return!1;var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var v=-1,h=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++v-1&&e%1==0&&e=0&&Math.floor(t)===t&&isFinite(e)}function h(e){return o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function g(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===d?JSON.stringify(e,m,2):String(e)}function m(e,t){return t&&t.__v_isRef?t.value:t}function y(e){var t=parseFloat(e);return isNaN(t)?e:t}function b(e,t){for(var n=Object.create(null),r=e.split(","),a=0;a-1)return e.splice(r,1)}}var _=Object.prototype.hasOwnProperty;function w(e,t){return _.call(e,t)}function P(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var C=/-(\w)/g,E=P((function(e){return e.replace(C,(function(e,t){return t?t.toUpperCase():""}))})),S=P((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),A=/\B([A-Z])/g,T=P((function(e){return e.replace(A,"-$1").toLowerCase()}));var M=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function O(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function U(e,t){for(var n in t)e[n]=t[n];return e}function L(e){for(var t={},n=0;n0,Z=Y&&Y.indexOf("edge/")>0;Y&&Y.indexOf("android");var ee=Y&&/iphone|ipad|ipod|ios/.test(Y);Y&&/chrome\/\d+/.test(Y),Y&&/phantomjs/.test(Y);var te,ne=Y&&Y.match(/firefox\/(\d+)/),re={}.watch,ae=!1;if(X)try{var ie={};Object.defineProperty(ie,"passive",{get:function(){ae=!0}}),window.addEventListener("test-passive",null,ie)}catch(e){}var oe=function(){return void 0===te&&(te=!X&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),te},le=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(e){return"function"==typeof e&&/native code/.test(e.toString())}var ce,ue="undefined"!=typeof Symbol&&se(Symbol)&&"undefined"!=typeof Reflect&&se(Reflect.ownKeys);ce="undefined"!=typeof Set&&se(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var de=null;function pe(e){void 0===e&&(e=null),e||de&&de._scope.off(),de=e,e&&e._scope.on()}var fe=function(){function e(e,t,n,r,a,i,o,l){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=a,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=o,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=l,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),ve=function(e){void 0===e&&(e="");var t=new fe;return t.text=e,t.isComment=!0,t};function he(e){return new fe(void 0,void 0,void 0,String(e))}function ge(e){var t=new fe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}"function"==typeof SuppressedError&&SuppressedError;var me=0,ye=[],be=function(){function e(){this._pending=!1,this.id=me++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,ye.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){var t=this.subs.filter((function(e){return e}));for(var n=0,r=t.length;n0&&(Ye((c=e(c,"".concat(n||"","_").concat(r)))[0])&&Ye(d)&&(p[u]=he(d.text+c[0].text),c.shift()),p.push.apply(p,c)):s(c)?Ye(d)?p[u]=he(d.text+c):""!==c&&p.push(he(c)):Ye(c)&&Ye(d)?p[u]=he(d.text+c.text):(l(t._isVList)&&o(c.tag)&&i(c.key)&&o(n)&&(c.key="__vlist".concat(n,"_").concat(r,"__")),p.push(c)));return p}(e):void 0}function Ye(e){return o(e)&&o(e.text)&&!1===e.isComment}function Je(e,t){var n,r,i,l,s=null;if(a(e)||"string"==typeof e)for(s=new Array(e.length),n=0,r=e.length;n0,l=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(l&&a&&a!==r&&s===a.$key&&!o&&!a.$hasNormal)return a;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=gt(e,n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=mt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),K(i,"$stable",l),K(i,"$key",s),K(i,"$hasNormal",o),i}function gt(e,t,n,r){var i=function(){var t=de;pe(e);var n=arguments.length?r.apply(null,arguments):r({}),i=(n=n&&"object"==typeof n&&!a(n)?[n]:Xe(n))&&n[0];return pe(t),n&&(!i||1===n.length&&i.isComment&&!vt(i))?void 0:n};return r.proxy&&Object.defineProperty(t,n,{get:i,enumerable:!0,configurable:!0}),i}function mt(e,t){return function(){return e[t]}}function yt(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};K(t,"_v_attr_proxy",!0),bt(t,e.$attrs,r,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||bt(e._listenersProxy={},e.$listeners,r,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||xt(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:M(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return Be(e,t,n)}))}}}function bt(e,t,n,r,a){var i=!1;for(var o in t)o in e?t[o]!==n[o]&&(i=!0):(i=!0,kt(e,o,r,a));for(var o in e)o in t||(i=!0,delete e[o]);return i}function kt(e,t,n,r){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return n[r][t]}})}function xt(e,t){for(var n in t)e[n]=t[n];for(var n in e)n in t||delete e[n]}var _t=null;function wt(e,t){return(e.__esModule||ue&&"Module"===e[Symbol.toStringTag])&&(e=e.default),u(e)?t.extend(e):e}function Pt(e){if(a(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(cn=function(){return un.now()})}var dn=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function pn(){var e,t;for(sn=cn(),on=!0,tn.sort(dn),ln=0;lnln&&tn[n].id>e.id;)n--;tn.splice(n+1,0,e)}else tn.push(e);an||(an=!0,Ft(pn))}}function vn(e,t){if(e){for(var n=Object.create(null),r=ue?Reflect.ownKeys(e):Object.keys(e),a=0;a-1)if(i&&!w(a,"default"))o=!1;else if(""===o||o===T(e)){var s=Rn(String,a.type);(s<0||l-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function Jn(e,t){var n=e.cache,r=e.keys,a=e._vnode,i=e.$vnode;for(var o in n){var l=n[o];if(l){var s=l.name;s&&!t(s)&&Qn(n,o,r,a)}}i.componentOptions.children=void 0}function Qn(e,t,n,r){var a=e[t];!a||r&&a.tag===r.tag||a.componentInstance.$destroy(),e[t]=null,x(n,t)}qn.prototype._init=function(e){var t=this;t._uid=Gn++,t._isVue=!0,t.__v_skip=!0,t._scope=new He(!0),t._scope.parent=void 0,t._scope._vm=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var a=r.componentOptions;n.propsData=a.propsData,n._parentListeners=a.listeners,n._renderChildren=a.children,n._componentTag=a.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Mn(Kn(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._provided=n?n._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Xt(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,a=n&&n.context;e.$slots=pt(t._renderChildren,a),e.$scopedSlots=n?ht(e.$parent,n.data.scopedSlots,e.$slots):r,e._c=function(t,n,r,a){return Ct(e,t,n,r,a,!1)},e.$createElement=function(t,n,r,a){return Ct(e,t,n,r,a,!0)};var i=n&&n.data;Ue(e,"$attrs",i&&i.attrs||r,null,!0),Ue(e,"$listeners",t._parentListeners||r,null,!0)}(t),en(t,"beforeCreate",void 0,!1),function(e){var t=vn(e.$options.inject,e);t&&(Ae(!1),Object.keys(t).forEach((function(n){Ue(e,n,t[n])})),Ae(!0))}(t),Fn(t),function(e){var t=e.$options.provide;if(t){var n=c(t)?t.call(e):t;if(!u(n))return;for(var r=Ve(e),a=ue?Reflect.ownKeys(n):Object.keys(n),i=0;i1?O(n):n;for(var r=O(arguments,1),a='event handler for "'.concat(e,'"'),i=0,o=n.length;iparseInt(this.max)&&Qn(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Qn(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){Jn(e,(function(e){return Yn(t,e)}))})),this.$watch("exclude",(function(t){Jn(e,(function(e){return!Yn(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Pt(e),n=t&&t.componentOptions;if(n){var r=Xn(n),a=this.include,i=this.exclude;if(a&&(!r||!Yn(a,r))||i&&r&&Yn(i,r))return t;var o=this.cache,l=this.keys,s=null==t.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):t.key;o[s]?(t.componentInstance=o[s].componentInstance,x(l,s),l.push(s)):(this.vnodeToCache=t,this.keyToCache=s),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return V}};Object.defineProperty(e,"config",t),e.util={warn:wn,extend:U,mergeOptions:Mn,defineReactive:Ue},e.set=Le,e.delete=je,e.nextTick=Ft,e.observable=function(e){return Oe(e),e},e.options=Object.create(null),N.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,U(e.options.components,er),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=O(arguments,1);return n.unshift(this),c(e.install)?e.install.apply(e,n):c(e)&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Mn(this.options,e),this}}(e),Wn(e),function(e){N.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&p(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&c(n)&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(qn),Object.defineProperty(qn.prototype,"$isServer",{get:oe}),Object.defineProperty(qn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(qn,"FunctionalRenderContext",{value:hn}),qn.version="2.7.16";var tr=b("style,class"),nr=b("input,textarea,option,select,progress"),rr=b("contenteditable,draggable,spellcheck"),ar=b("events,caret,typing,plaintext-only"),ir=b("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),or="http://www.w3.org/1999/xlink",lr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},sr=function(e){return lr(e)?e.slice(6,e.length):""},cr=function(e){return null==e||!1===e};function ur(e){for(var t=e.data,n=e,r=e;o(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=dr(r.data,t));for(;o(n=n.parent);)n&&n.data&&(t=dr(t,n.data));return function(e,t){if(o(e)||o(t))return pr(e,fr(t));return""}(t.staticClass,t.class)}function dr(e,t){return{staticClass:pr(e.staticClass,t.staticClass),class:o(e.class)?[e.class,t.class]:t.class}}function pr(e,t){return e?t?e+" "+t:e:t||""}function fr(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,a=e.length;r-1?Ir(e,t,n):ir(t)?cr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):rr(t)?e.setAttribute(t,function(e,t){return cr(t)||"false"===t?"false":"contenteditable"===e&&ar(t)?t:"true"}(t,n)):lr(t)?cr(n)?e.removeAttributeNS(or,sr(t)):e.setAttributeNS(or,t,n):Ir(e,t,n)}function Ir(e,t,n){if(cr(n))e.removeAttribute(t);else{if(J&&!Q&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Dr={create:$r,update:$r};function Fr(e,t){var n=t.elm,r=t.data,a=e.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var l=ur(t),s=n._transitionClasses;o(s)&&(l=pr(l,fr(s))),l!==n._prevClass&&(n.setAttribute("class",l),n._prevClass=l)}}var Br,Nr={create:Fr,update:Fr};function Hr(e,t,n){var r=Br;return function a(){var i=t.apply(null,arguments);null!==i&&Gr(e,a,n,r)}}var Vr=Ot&&!(ne&&Number(ne[1])<=53);function zr(e,t,n,r){if(Vr){var a=sn,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=a||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Br.addEventListener(e,t,ae?{capture:n,passive:r}:n)}function Gr(e,t,n,r){(r||Br).removeEventListener(e,t._wrapper||t,n)}function Kr(e,t){if(!i(e.data.on)||!i(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Br=t.elm||e.elm,function(e){if(o(e.__r)){var t=J?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}o(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),Ke(n,r,zr,Gr,Hr,t.context),Br=void 0}}var qr,Wr={create:Kr,update:Kr,destroy:function(e){return Kr(e,Pr)}};function Xr(e,t){if(!i(e.data.domProps)||!i(t.data.domProps)){var n,r,a=t.elm,s=e.data.domProps||{},c=t.data.domProps||{};for(n in(o(c.__ob__)||l(c._v_attr_proxy))&&(c=t.data.domProps=U({},c)),s)n in c||(a[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var u=i(r)?"":String(r);Yr(a,u)&&(a.value=u)}else if("innerHTML"===n&&gr(a.tagName)&&i(a.innerHTML)){(qr=qr||document.createElement("div")).innerHTML="".concat(r,"");for(var d=qr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;d.firstChild;)a.appendChild(d.firstChild)}else if(r!==s[n])try{a[n]=r}catch(e){}}}}function Yr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(o(r)){if(r.number)return y(n)!==y(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var Jr={create:Xr,update:Xr},Qr=P((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function Zr(e){var t=ea(e.style);return e.staticStyle?U(e.staticStyle,t):t}function ea(e){return Array.isArray(e)?L(e):"string"==typeof e?Qr(e):e}var ta,na=/^--/,ra=/\s*!important$/,aa=function(e,t,n){if(na.test(t))e.style.setProperty(t,n);else if(ra.test(n))e.style.setProperty(T(t),n.replace(ra,""),"important");else{var r=oa(t);if(Array.isArray(n))for(var a=0,i=n.length;a-1?t.split(ca).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" ".concat(e.getAttribute("class")||""," ");n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function da(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(ca).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" ".concat(e.getAttribute("class")||""," "),r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function pa(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&U(t,fa(e.name||"v")),U(t,e),t}return"string"==typeof e?fa(e):void 0}}var fa=P((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),va=X&&!Q,ha="transition",ma="transitionend",ya="animation",ba="animationend";va&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ha="WebkitTransition",ma="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ya="WebkitAnimation",ba="webkitAnimationEnd"));var ka=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function xa(e){ka((function(){ka(e)}))}function _a(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ua(e,t))}function wa(e,t){e._transitionClasses&&x(e._transitionClasses,t),da(e,t)}function Pa(e,t,n){var r=Ea(e,t),a=r.type,i=r.timeout,o=r.propCount;if(!a)return n();var l="transition"===a?ma:ba,s=0,c=function(){e.removeEventListener(l,u),n()},u=function(t){t.target===e&&++s>=o&&c()};setTimeout((function(){s0&&(n="transition",u=o,d=i.length):"animation"===t?c>0&&(n="animation",u=c,d=s.length):d=(n=(u=Math.max(o,c))>0?o>c?"transition":"animation":null)?"transition"===n?i.length:s.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&Ca.test(r[ha+"Property"])}}function Sa(e,t){for(;e.length1}function La(e,t){!0!==t.data.show&&Ta(t)}var ja=function(e){var t,n,r={},c=e.modules,u=e.nodeOps;for(t=0;tv?k(e,i(n[m+1])?null:n[m+1].elm,n,f,m,r):f>m&&_(t,d,v)}(d,h,m,n,c):o(m)?(o(e.text)&&u.setTextContent(d,""),k(d,null,m,0,m.length-1,n)):o(h)?_(h,0,h.length-1):o(e.text)&&u.setTextContent(d,""):e.text!==t.text&&u.setTextContent(d,t.text),o(v)&&o(f=v.hook)&&o(f=f.postpatch)&&f(e,t)}}}function E(e,t,n){if(l(n)&&o(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r-1,o.selected!==i&&(o.selected=i);else if(I(Fa(o),r))return void(e.selectedIndex!==l&&(e.selectedIndex=l));a||(e.selectedIndex=-1)}}function Da(e,t){return t.every((function(t){return!I(t,e)}))}function Fa(e){return"_value"in e?e._value:e.value}function Ba(e){e.target.composing=!0}function Na(e){e.target.composing&&(e.target.composing=!1,Ha(e.target,"input"))}function Ha(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Va(e){return!e.componentInstance||e.data&&e.data.transition?e:Va(e.componentInstance._vnode)}var za={model:$a,show:{bind:function(e,t,n){var r=t.value,a=(n=Va(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&a?(n.data.show=!0,Ta(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Va(n)).data&&n.data.transition?(n.data.show=!0,r?Ta(n,(function(){e.style.display=e.__vOriginalDisplay})):Ma(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,a){a||(e.style.display=e.__vOriginalDisplay)}}},Ga={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ka(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ka(Pt(t.children)):e}function qa(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var a=n._parentListeners;for(var r in a)t[E(r)]=a[r];return t}function Wa(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Xa=function(e){return e.tag||vt(e)},Ya=function(e){return"show"===e.name},Ja={name:"transition",props:Ga,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Xa)).length){0;var r=this.mode;0;var a=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return a;var i=Ka(a);if(!i)return a;if(this._leaving)return Wa(e,a);var o="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?o+"comment":o+i.tag:s(i.key)?0===String(i.key).indexOf(o)?i.key:o+i.key:i.key;var l=(i.data||(i.data={})).transition=qa(this),c=this._vnode,u=Ka(c);if(i.data.directives&&i.data.directives.some(Ya)&&(i.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,u)&&!vt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=U({},l);if("out-in"===r)return this._leaving=!0,qe(d,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Wa(e,a);if("in-out"===r){if(vt(i))return c;var p,f=function(){p()};qe(l,"afterEnter",f),qe(l,"enterCancelled",f),qe(d,"delayLeave",(function(e){p=e}))}}return a}}},Qa=U({tag:String,moveClass:String},Ga);function Za(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function ei(e){e.data.newPos=e.elm.getBoundingClientRect()}function ti(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,a=t.top-n.top;if(r||a){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(a,"px)"),i.transitionDuration="0s"}}delete Qa.mode;var ni={Transition:Ja,TransitionGroup:{props:Qa,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var a=Jt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,a(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,a=this.$slots.default||[],i=this.children=[],o=qa(this),l=0;l-1?yr[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:yr[e]=/HTMLUnknownElement/.test(t.toString())},U(qn.options.directives,za),U(qn.options.components,ni),qn.prototype.__patch__=X?ja:j,qn.prototype.$mount=function(e,t){return function(e,t,n){var r;e.$el=t,e.$options.render||(e.$options.render=ve),en(e,"beforeMount"),r=function(){e._update(e._render(),n)},new Gt(e,r,j,{before:function(){e._isMounted&&!e._isDestroyed&&en(e,"beforeUpdate")}},!0),n=!1;var a=e._preWatchers;if(a)for(var i=0;i=0&&(t=e.slice(r),e=e.slice(0,r));var a=e.indexOf("?");return a>=0&&(n=e.slice(a+1),e=e.slice(0,a)),{path:e,query:n,hash:t}}(a.path||""),c=t&&t.path||"/",u=s.path?wi(s.path,c,n||a.append):c,d=function(e,t,n){void 0===t&&(t={});var r,a=n||ui;try{r=a(e||"")}catch(e){r={}}for(var i in t){var o=t[i];r[i]=Array.isArray(o)?o.map(ci):ci(o)}return r}(s.query,a.query,r&&r.options.parseQuery),p=a.hash||s.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:u,query:d,hash:p}}var zi,Gi=function(){},Ki={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var t=this,n=this.$router,r=this.$route,a=n.resolve(this.to,r,this.append),i=a.location,o=a.route,l=a.href,s={},c=n.options.linkActiveClass,u=n.options.linkExactActiveClass,d=null==c?"router-link-active":c,p=null==u?"router-link-exact-active":u,f=null==this.activeClass?d:this.activeClass,v=null==this.exactActiveClass?p:this.exactActiveClass,h=o.redirectedFrom?fi(null,Vi(o.redirectedFrom),null,n):o;s[v]=yi(r,h,this.exactPath),s[f]=this.exact||this.exactPath?s[v]:function(e,t){return 0===e.path.replace(pi,"/").indexOf(t.path.replace(pi,"/"))&&(!t.hash||e.hash===t.hash)&&function(e,t){for(var n in t)if(!(n in e))return!1;return!0}(e.query,t.query)}(r,h);var g=s[v]?this.ariaCurrentValue:null,m=function(e){qi(e)&&(t.replace?n.replace(i,Gi):n.push(i,Gi))},y={click:qi};Array.isArray(this.event)?this.event.forEach((function(e){y[e]=m})):y[this.event]=m;var b={class:s},k=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:l,route:o,navigate:m,isActive:s[f],isExactActive:s[v]});if(k){if(1===k.length)return k[0];if(k.length>1||!k.length)return 0===k.length?e():e("span",{},k)}if("a"===this.tag)b.on=y,b.attrs={href:l,"aria-current":g};else{var x=function e(t){var n;if(t)for(var r=0;r-1&&(l.params[p]=n.params[p]);return l.path=Hi(u.path,l.params),s(u,l,o)}if(l.path){l.params={};for(var f=0;f-1}function Co(e,t){return Po(e)&&e._isRouter&&(null==t||e.type===t)}function Eo(e,t,n){var r=function(a){a>=e.length?n():e[a]?t(e[a],(function(){r(a+1)})):r(a+1)};r(0)}function So(e){return function(t,n,r){var a=!1,i=0,o=null;Ao(e,(function(e,t,n,l){if("function"==typeof e&&void 0===e.cid){a=!0,i++;var s,c=Oo((function(t){var a;((a=t).__esModule||Mo&&"Module"===a[Symbol.toStringTag])&&(t=t.default),e.resolved="function"==typeof t?t:zi.extend(t),n.components[l]=t,--i<=0&&r()})),u=Oo((function(e){var t="Failed to resolve async component "+l+": "+e;o||(o=Po(e)?e:new Error(t),r(o))}));try{s=e(c,u)}catch(e){u(e)}if(s)if("function"==typeof s.then)s.then(c,u);else{var d=s.component;d&&"function"==typeof d.then&&d.then(c,u)}}})),a||r()}}function Ao(e,t){return To(e.map((function(e){return Object.keys(e.components).map((function(n){return t(e.components[n],e.instances[n],e,n)}))})))}function To(e){return Array.prototype.concat.apply([],e)}var Mo="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Oo(e){var t=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!t)return t=!0,e.apply(this,n)}}var Uo=function(e,t){this.router=e,this.base=function(e){if(!e)if(Wi){var t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else e="/";"/"!==e.charAt(0)&&(e="/"+e);return e.replace(/\/$/,"")}(t),this.current=hi,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Lo(e,t,n,r){var a=Ao(e,(function(e,r,a,i){var o=function(e,t){"function"!=typeof e&&(e=zi.extend(e));return e.options[t]}(e,t);if(o)return Array.isArray(o)?o.map((function(e){return n(e,r,a,i)})):n(o,r,a,i)}));return To(r?a.reverse():a)}function jo(e,t){if(t)return function(){return e.apply(t,arguments)}}Uo.prototype.listen=function(e){this.cb=e},Uo.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))},Uo.prototype.onError=function(e){this.errorCbs.push(e)},Uo.prototype.transitionTo=function(e,t,n){var r,a=this;try{r=this.router.match(e,this.current)}catch(e){throw this.errorCbs.forEach((function(t){t(e)})),e}var i=this.current;this.confirmTransition(r,(function(){a.updateRoute(r),t&&t(r),a.ensureURL(),a.router.afterHooks.forEach((function(e){e&&e(r,i)})),a.ready||(a.ready=!0,a.readyCbs.forEach((function(e){e(r)})))}),(function(e){n&&n(e),e&&!a.ready&&(Co(e,bo.redirected)&&i===hi||(a.ready=!0,a.readyErrorCbs.forEach((function(t){t(e)}))))}))},Uo.prototype.confirmTransition=function(e,t,n){var r=this,a=this.current;this.pending=e;var i,o,l=function(e){!Co(e)&&Po(e)&&(r.errorCbs.length?r.errorCbs.forEach((function(t){t(e)})):console.error(e)),n&&n(e)},s=e.matched.length-1,c=a.matched.length-1;if(yi(e,a)&&s===c&&e.matched[s]===a.matched[c])return this.ensureURL(),e.hash&&oo(this.router,a,e,!1),l(((o=_o(i=a,e,bo.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",o));var u=function(e,t){var n,r=Math.max(e.length,t.length);for(n=0;n0)){var t=this.router,n=t.options.scrollBehavior,r=go&&n;r&&this.listeners.push(io());var a=function(){var n=e.current,a=Ro(e.base);e.current===hi&&a===e._startLocation||e.transitionTo(a,(function(e){r&&oo(t,e,n,!0)}))};window.addEventListener("popstate",a),this.listeners.push((function(){window.removeEventListener("popstate",a)}))}},t.prototype.go=function(e){window.history.go(e)},t.prototype.push=function(e,t,n){var r=this,a=this.current;this.transitionTo(e,(function(e){mo(Pi(r.base+e.fullPath)),oo(r.router,e,a,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this,a=this.current;this.transitionTo(e,(function(e){yo(Pi(r.base+e.fullPath)),oo(r.router,e,a,!1),t&&t(e)}),n)},t.prototype.ensureURL=function(e){if(Ro(this.base)!==this.current.fullPath){var t=Pi(this.base+this.current.fullPath);e?mo(t):yo(t)}},t.prototype.getCurrentLocation=function(){return Ro(this.base)},t}(Uo);function Ro(e){var t=window.location.pathname,n=t.toLowerCase(),r=e.toLowerCase();return!e||n!==r&&0!==n.indexOf(Pi(r+"/"))||(t=t.slice(e.length)),(t||"/")+window.location.search+window.location.hash}var Io=function(e){function t(t,n,r){e.call(this,t,n),r&&function(e){var t=Ro(e);if(!/^\/#/.test(t))return window.location.replace(Pi(e+"/#"+t)),!0}(this.base)||Do()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setupListeners=function(){var e=this;if(!(this.listeners.length>0)){var t=this.router.options.scrollBehavior,n=go&&t;n&&this.listeners.push(io());var r=function(){var t=e.current;Do()&&e.transitionTo(Fo(),(function(r){n&&oo(e.router,r,t,!0),go||Ho(r.fullPath)}))},a=go?"popstate":"hashchange";window.addEventListener(a,r),this.listeners.push((function(){window.removeEventListener(a,r)}))}},t.prototype.push=function(e,t,n){var r=this,a=this.current;this.transitionTo(e,(function(e){No(e.fullPath),oo(r.router,e,a,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this,a=this.current;this.transitionTo(e,(function(e){Ho(e.fullPath),oo(r.router,e,a,!1),t&&t(e)}),n)},t.prototype.go=function(e){window.history.go(e)},t.prototype.ensureURL=function(e){var t=this.current.fullPath;Fo()!==t&&(e?No(t):Ho(t))},t.prototype.getCurrentLocation=function(){return Fo()},t}(Uo);function Do(){var e=Fo();return"/"===e.charAt(0)||(Ho("/"+e),!1)}function Fo(){var e=window.location.href,t=e.indexOf("#");return t<0?"":e=e.slice(t+1)}function Bo(e){var t=window.location.href,n=t.indexOf("#");return(n>=0?t.slice(0,n):t)+"#"+e}function No(e){go?mo(Bo(e)):window.location.hash=e}function Ho(e){go?yo(Bo(e)):window.location.replace(Bo(e))}var Vo=function(e){function t(t,n){e.call(this,t,n),this.stack=[],this.index=-1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.push=function(e,t,n){var r=this;this.transitionTo(e,(function(e){r.stack=r.stack.slice(0,r.index+1).concat(e),r.index++,t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this;this.transitionTo(e,(function(e){r.stack=r.stack.slice(0,r.index).concat(e),t&&t(e)}),n)},t.prototype.go=function(e){var t=this,n=this.index+e;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){var e=t.current;t.index=n,t.updateRoute(r),t.router.afterHooks.forEach((function(t){t&&t(r,e)}))}),(function(e){Co(e,bo.duplicated)&&(t.index=n)}))}},t.prototype.getCurrentLocation=function(){var e=this.stack[this.stack.length-1];return e?e.fullPath:"/"},t.prototype.ensureURL=function(){},t}(Uo),zo=function(e){void 0===e&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Ji(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback="history"===t&&!go&&!1!==e.fallback,this.fallback&&(t="hash"),Wi||(t="abstract"),this.mode=t,t){case"history":this.history=new $o(this,e.base);break;case"hash":this.history=new Io(this,e.base,this.fallback);break;case"abstract":this.history=new Vo(this,e.base);break;default:0}},Go={currentRoute:{configurable:!0}};zo.prototype.match=function(e,t,n){return this.matcher.match(e,t,n)},Go.currentRoute.get=function(){return this.history&&this.history.current},zo.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",(function(){var n=t.apps.indexOf(e);n>-1&&t.apps.splice(n,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()})),!this.app){this.app=e;var n=this.history;if(n instanceof $o||n instanceof Io){var r=function(e){n.setupListeners(),function(e){var r=n.current,a=t.options.scrollBehavior;go&&a&&"fullPath"in e&&oo(t,e,r,!1)}(e)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(e){t.apps.forEach((function(t){t._route=e}))}))}},zo.prototype.beforeEach=function(e){return qo(this.beforeHooks,e)},zo.prototype.beforeResolve=function(e){return qo(this.resolveHooks,e)},zo.prototype.afterEach=function(e){return qo(this.afterHooks,e)},zo.prototype.onReady=function(e,t){this.history.onReady(e,t)},zo.prototype.onError=function(e){this.history.onError(e)},zo.prototype.push=function(e,t,n){var r=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){r.history.push(e,t,n)}));this.history.push(e,t,n)},zo.prototype.replace=function(e,t,n){var r=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){r.history.replace(e,t,n)}));this.history.replace(e,t,n)},zo.prototype.go=function(e){this.history.go(e)},zo.prototype.back=function(){this.go(-1)},zo.prototype.forward=function(){this.go(1)},zo.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map((function(e){return Object.keys(e.components).map((function(t){return e.components[t]}))}))):[]},zo.prototype.resolve=function(e,t,n){var r=Vi(e,t=t||this.history.current,n,this),a=this.match(r,t),i=a.redirectedFrom||a.fullPath;return{location:r,route:a,href:function(e,t,n){var r="hash"===n?"#"+t:t;return e?Pi(e+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:a}},zo.prototype.getRoutes=function(){return this.matcher.getRoutes()},zo.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==hi&&this.history.transitionTo(this.history.getCurrentLocation())},zo.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==hi&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(zo.prototype,Go);var Ko=zo;function qo(e,t){return e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}zo.install=function e(t){if(!e.installed||zi!==t){e.installed=!0,zi=t;var n=function(e){return void 0!==e},r=function(e,t){var r=e.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(e,t)};t.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),t.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed:function(){r(this)}}),Object.defineProperty(t.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(t.prototype,"$route",{get:function(){return this._routerRoot._route}}),t.component("RouterView",xi),t.component("RouterLink",Ki);var a=t.config.optionMergeStrategies;a.beforeRouteEnter=a.beforeRouteLeave=a.beforeRouteUpdate=a.created}},zo.version="3.6.5",zo.isNavigationFailure=Co,zo.NavigationFailureType=bo,zo.START_LOCATION=hi,Wi&&window.Vue&&window.Vue.use(zo);n(99);n(126),n(92);var Wo={"components/AlgoliaSearchBox":()=>Promise.all([n.e(0),n.e(11)]).then(n.bind(null,316)),"components/DropdownLink":()=>Promise.all([n.e(0),n.e(12)]).then(n.bind(null,261)),"components/DropdownTransition":()=>Promise.all([n.e(0),n.e(18)]).then(n.bind(null,249)),"components/Home":()=>Promise.all([n.e(0),n.e(15)]).then(n.bind(null,289)),"components/NavLink":()=>n.e(21).then(n.bind(null,248)),"components/NavLinks":()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,274)),"components/Navbar":()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,312)),"components/Page":()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,290)),"components/PageEdit":()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,276)),"components/PageNav":()=>Promise.all([n.e(0),n.e(13)]).then(n.bind(null,277)),"components/Sidebar":()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,291)),"components/SidebarButton":()=>Promise.all([n.e(0),n.e(19)]).then(n.bind(null,293)),"components/SidebarGroup":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,275)),"components/SidebarLink":()=>Promise.all([n.e(0),n.e(17)]).then(n.bind(null,262)),"components/SidebarLinks":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,260)),"components/TopNav":()=>Promise.all([n.e(0),n.e(20)]).then(n.bind(null,292)),"global-components/Badge":()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,319)),"layouts/404":()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,317)),"layouts/Layout":()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,318)),NotFound:()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,317)),Layout:()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,318))},Xo={"v-628bc8f0":()=>n.e(25).then(n.bind(null,320)),"v-34fe0e46":()=>n.e(26).then(n.bind(null,321)),"v-386691fe":()=>n.e(29).then(n.bind(null,322)),"v-b8b65022":()=>n.e(28).then(n.bind(null,323)),"v-7cb2e029":()=>n.e(22).then(n.bind(null,324)),"v-1cbafd5b":()=>n.e(27).then(n.bind(null,325)),"v-3a964646":()=>n.e(32).then(n.bind(null,326)),"v-0359c01b":()=>n.e(30).then(n.bind(null,327)),"v-b3e2f7dc":()=>n.e(31).then(n.bind(null,328)),"v-0648babb":()=>n.e(34).then(n.bind(null,329)),"v-d80157e0":()=>n.e(33).then(n.bind(null,330)),"v-2d5f850a":()=>n.e(35).then(n.bind(null,331)),"v-f8ff2a8a":()=>n.e(36).then(n.bind(null,332)),"v-1d0a5d05":()=>n.e(37).then(n.bind(null,333)),"v-3d14d060":()=>n.e(38).then(n.bind(null,334)),"v-37d6db67":()=>n.e(39).then(n.bind(null,335)),"v-fb520162":()=>n.e(14).then(n.bind(null,336)),"v-0606cc70":()=>n.e(40).then(n.bind(null,337)),"v-7cda367b":()=>n.e(42).then(n.bind(null,338)),"v-a1dfbd8a":()=>n.e(41).then(n.bind(null,339)),"v-49812bde":()=>n.e(44).then(n.bind(null,340)),"v-97db1d60":()=>n.e(43).then(n.bind(null,341)),"v-81282f8a":()=>n.e(45).then(n.bind(null,342)),"v-9436f116":()=>n.e(46).then(n.bind(null,343)),"v-3d32147b":()=>n.e(47).then(n.bind(null,344)),"v-3098292d":()=>n.e(49).then(n.bind(null,345)),"v-43d3637b":()=>n.e(50).then(n.bind(null,346)),"v-43c25037":()=>n.e(48).then(n.bind(null,347)),"v-67061e4a":()=>n.e(51).then(n.bind(null,348)),"v-87d9c7de":()=>n.e(52).then(n.bind(null,349)),"v-253dcc3b":()=>n.e(53).then(n.bind(null,350)),"v-4e564c1b":()=>n.e(54).then(n.bind(null,351)),"v-5ab843d6":()=>n.e(55).then(n.bind(null,352)),"v-32163c7b":()=>n.e(56).then(n.bind(null,353)),"v-53650bf2":()=>n.e(57).then(n.bind(null,354)),"v-22174a62":()=>n.e(59).then(n.bind(null,355)),"v-3f10e261":()=>n.e(61).then(n.bind(null,356)),"v-3b63817b":()=>n.e(60).then(n.bind(null,357)),"v-97e6ce60":()=>n.e(58).then(n.bind(null,358)),"v-257fce1a":()=>n.e(62).then(n.bind(null,359)),"v-6f60c50a":()=>n.e(63).then(n.bind(null,360)),"v-bc74fe4a":()=>n.e(23).then(n.bind(null,361)),"v-97082ec0":()=>n.e(64).then(n.bind(null,362)),"v-4d68c870":()=>n.e(66).then(n.bind(null,363)),"v-77ed9d62":()=>n.e(65).then(n.bind(null,364)),"v-4dd4215b":()=>n.e(67).then(n.bind(null,365)),"v-48779cdb":()=>n.e(69).then(n.bind(null,366)),"v-a373ca4a":()=>n.e(68).then(n.bind(null,367)),"v-923fce92":()=>n.e(70).then(n.bind(null,368)),"v-2d236119":()=>n.e(72).then(n.bind(null,369)),"v-597357a4":()=>n.e(71).then(n.bind(null,370)),"v-001b8d81":()=>n.e(73).then(n.bind(null,371)),"v-811f7e60":()=>n.e(74).then(n.bind(null,372)),"v-65c09c5b":()=>n.e(75).then(n.bind(null,373)),"v-c6f4abca":()=>n.e(76).then(n.bind(null,374)),"v-6a4fbf5b":()=>n.e(77).then(n.bind(null,375)),"v-00520ac3":()=>n.e(79).then(n.bind(null,376)),"v-05934130":()=>n.e(78).then(n.bind(null,377)),"v-43d7274a":()=>n.e(80).then(n.bind(null,378)),"v-2607b25b":()=>n.e(81).then(n.bind(null,379)),"v-4643c467":()=>n.e(82).then(n.bind(null,380)),"v-19b6241b":()=>n.e(83).then(n.bind(null,381)),"v-a3469142":()=>n.e(85).then(n.bind(null,382)),"v-68d4f0e9":()=>n.e(84).then(n.bind(null,383)),"v-1dedbe9b":()=>n.e(86).then(n.bind(null,384)),"v-52bde2bb":()=>n.e(87).then(n.bind(null,385)),"v-577f2683":()=>n.e(88).then(n.bind(null,386)),"v-6cfed03b":()=>n.e(90).then(n.bind(null,387)),"v-2b98acca":()=>n.e(89).then(n.bind(null,388)),"v-b87050f2":()=>n.e(91).then(n.bind(null,389)),"v-0e9a4c1b":()=>n.e(92).then(n.bind(null,390)),"v-9498b98e":()=>n.e(93).then(n.bind(null,391)),"v-0c08fe70":()=>n.e(94).then(n.bind(null,392)),"v-4b11a99b":()=>n.e(95).then(n.bind(null,393)),"v-2888eb6a":()=>n.e(96).then(n.bind(null,394)),"v-7ea5c780":()=>n.e(98).then(n.bind(null,395)),"v-fb9fdb00":()=>n.e(97).then(n.bind(null,396)),"v-3042924a":()=>n.e(99).then(n.bind(null,397)),"v-761748db":()=>n.e(100).then(n.bind(null,398)),"v-1f119f3b":()=>n.e(102).then(n.bind(null,399)),"v-35006eca":()=>n.e(103).then(n.bind(null,400)),"v-cc8367fe":()=>n.e(104).then(n.bind(null,401)),"v-6c9aa255":()=>n.e(101).then(n.bind(null,402)),"v-a79c52ca":()=>n.e(24).then(n.bind(null,403)),"v-75c7df60":()=>n.e(105).then(n.bind(null,404)),"v-f2f6664a":()=>n.e(106).then(n.bind(null,405)),"v-5b513a44":()=>n.e(107).then(n.bind(null,406)),"v-3d6730e7":()=>n.e(108).then(n.bind(null,407)),"v-50c09862":()=>n.e(109).then(n.bind(null,408)),"v-82f3414a":()=>n.e(111).then(n.bind(null,409)),"v-38093e8f":()=>n.e(110).then(n.bind(null,410)),"v-19fa9c70":()=>n.e(112).then(n.bind(null,411)),"v-3e7871fb":()=>n.e(114).then(n.bind(null,412)),"v-11d2520a":()=>n.e(113).then(n.bind(null,413)),"v-102d7560":()=>n.e(115).then(n.bind(null,414)),"v-29ba2c92":()=>n.e(116).then(n.bind(null,415)),"v-4ad03c83":()=>n.e(117).then(n.bind(null,416)),"v-94b795ac":()=>n.e(119).then(n.bind(null,417)),"v-5516a1ca":()=>n.e(120).then(n.bind(null,418)),"v-49e9b357":()=>n.e(121).then(n.bind(null,419)),"v-7b128352":()=>n.e(118).then(n.bind(null,420)),"v-2d59775b":()=>n.e(123).then(n.bind(null,421)),"v-68450b87":()=>n.e(122).then(n.bind(null,422)),"v-c13ca42a":()=>n.e(124).then(n.bind(null,423)),"v-77bdaafb":()=>n.e(125).then(n.bind(null,424)),"v-f028604a":()=>n.e(126).then(n.bind(null,425)),"v-0b718b3d":()=>n.e(128).then(n.bind(null,426)),"v-066aec9b":()=>n.e(129).then(n.bind(null,427)),"v-03cb4f1a":()=>n.e(127).then(n.bind(null,428)),"v-0142f749":()=>n.e(131).then(n.bind(null,429)),"v-3e3a5dab":()=>n.e(130).then(n.bind(null,430)),"v-4ac4bd6b":()=>n.e(133).then(n.bind(null,431)),"v-24913d76":()=>n.e(135).then(n.bind(null,432)),"v-c1dbb14a":()=>n.e(132).then(n.bind(null,433)),"v-2b0dbf0a":()=>n.e(134).then(n.bind(null,434)),"v-c4ee6cda":()=>n.e(136).then(n.bind(null,435)),"v-71ef02ca":()=>n.e(137).then(n.bind(null,436))};function Yo(e){const t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}const Jo=/-(\w)/g,Qo=Yo(e=>e.replace(Jo,(e,t)=>t?t.toUpperCase():"")),Zo=/\B([A-Z])/g,el=Yo(e=>e.replace(Zo,"-$1").toLowerCase()),tl=Yo(e=>e.charAt(0).toUpperCase()+e.slice(1));function nl(e,t){if(!t)return;if(e(t))return e(t);return t.includes("-")?e(tl(Qo(t))):e(tl(t))||e(el(t))}const rl=Object.assign({},Wo,Xo),al=e=>rl[e],il=e=>Xo[e],ol=e=>Wo[e],ll=e=>qn.component(e);function sl(e){return nl(il,e)}function cl(e){return nl(ol,e)}function ul(e){return nl(al,e)}function dl(e){return nl(ll,e)}function pl(...e){return Promise.all(e.filter(e=>e).map(async e=>{if(!dl(e)&&ul(e)){const t=await ul(e)();qn.component(e,t.default)}}))}function fl(e,t){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[e]=t)}var vl=n(89),hl=n.n(vl),gl=n(90),ml=n.n(gl),yl={created(){if(this.siteMeta=this.$site.headTags.filter(([e])=>"meta"===e).map(([e,t])=>t),this.$ssrContext){const t=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(e=t)?e.map(e=>{let t="{t+=` ${n}="${ml()(e[n])}"`}),t+">"}).join("\n "):"",this.$ssrContext.canonicalLink=kl(this.$canonicalUrl)}var e},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const e=this.getMergedMetaTags();this.currentMetaTags=xl(e,this.currentMetaTags)},getMergedMetaTags(){const e=this.$page.frontmatter.meta||[];return hl()([{name:"description",content:this.$description}],e,this.siteMeta,_l)},updateCanonicalLink(){bl(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",kl(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){xl(null,this.currentMetaTags),bl()}};function bl(){const e=document.querySelector("link[rel='canonical']");e&&e.remove()}function kl(e=""){return e?``:""}function xl(e,t){if(t&&[...t].filter(e=>e.parentNode===document.head).forEach(e=>document.head.removeChild(e)),e)return e.map(e=>{const t=document.createElement("meta");return Object.keys(e).forEach(n=>{t.setAttribute(n,e[n])}),document.head.appendChild(t),t})}function _l(e){for(const t of["name","property","itemprop"])if(e.hasOwnProperty(t))return e[t]+t;return JSON.stringify(e)}var wl=n(22),Pl=n.n(wl),Cl={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:Pl()((function(){this.setActiveHash()}),300),setActiveHash(){const e=[].slice.call(document.querySelectorAll(".sidebar-link")),t=[].slice.call(document.querySelectorAll(".header-anchor")).filter(t=>e.some(e=>e.hash===t.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),a=window.innerHeight+n;for(let e=0;e=i.parentElement.offsetTop+10&&(!o||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},El=n(23),Sl=n.n(El),Al={mounted(){Sl.a.configure({showSpinner:!1}),this.$router.beforeEach((e,t,n)=>{e.path===t.path||qn.component(e.name)||Sl.a.start(),n()}),this.$router.afterEach(()=>{Sl.a.done(),this.isSidebarOpen=!1})}},Tl=n(91),Ml=n.n(Tl),Ol={mounted(){Ml.a.polyfill()}};n(237),n(238);class Ul{constructor(){this.containerEl=document.getElementById("message-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.id="message-container",document.body.appendChild(this.containerEl))}show({text:e="",duration:t=3e3}){let n=document.createElement("div");n.className="message move-in",n.innerHTML=`\n \n \n \n
    ${e}
    \n `,this.containerEl.appendChild(n),t>0&&setTimeout(()=>{this.close(n)},t)}close(e){e.className=e.className.replace("move-in",""),e.className+="move-out",e.addEventListener("animationend",()=>{e.remove()})}}var Ll=[yl,Cl,Al,Ol,{mounted(){this.updateCopy()},watch:{$route:{handler(){this.updateCopy()}}},updated(){this.updateCopy()},methods:{updateCopy(){!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||setTimeout(()=>{(['div[class*="language-"] pre','div[class*="aside-code"] aside']instanceof Array||Array.isArray(['div[class*="language-"] pre','div[class*="aside-code"] aside']))&&['div[class*="language-"] pre','div[class*="aside-code"] aside'].forEach(e=>{document.querySelectorAll(e).forEach(this.generateCopyButton)})},1e3)},generateCopyButton(e){if(e.classList.contains("codecopy-enabled"))return;const t=document.createElement("i");t.className="code-copy",t.innerHTML='',t.title="Click to Copy to Clipboard",t.addEventListener("click",()=>{this.copyToClipboard(e.innerText)}),e.appendChild(t),e.classList.add("codecopy-enabled")},copyToClipboard(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);const n=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);t.select(),document.execCommand("copy");(new Ul).show({text:"Copy successfully and then paste it for use.",duration:3e3}),document.body.removeChild(t),n&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(n))}}}],jl={name:"GlobalLayout",computed:{layout(){const e=this.getLayout();return fl("layout",e),qn.component(e)}},methods:{getLayout(){if(this.$page.path){const e=this.$page.frontmatter.layout;return e&&(this.$vuepress.getLayoutAsyncComponent(e)||this.$vuepress.getVueComponent(e))?e:"Layout"}return"NotFound"}}},$l=n(10),Rl=Object($l.a)(jl,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(e,t,n){switch(t){case"components":e[t]||(e[t]={}),Object.assign(e[t],n);break;case"mixins":e[t]||(e[t]=[]),e[t].push(...n);break;default:throw new Error("Unknown option name.")}}(Rl,"mixins",Ll);const Il=[{name:"v-628bc8f0",path:"/1.x/advanced/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-628bc8f0").then(n)}},{path:"/1.x/advanced/index.html",redirect:"/1.x/advanced/"},{name:"v-34fe0e46",path:"/1.x/advanced/email-inbound-parse.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-34fe0e46").then(n)}},{name:"v-386691fe",path:"/1.x/advanced/override-core-model.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-386691fe").then(n)}},{name:"v-b8b65022",path:"/1.x/advanced/helpers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-b8b65022").then(n)}},{name:"v-7cb2e029",path:"/1.x/advanced/security-practice.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-7cb2e029").then(n)}},{name:"v-1cbafd5b",path:"/1.x/advanced/events.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-1cbafd5b").then(n)}},{name:"v-3a964646",path:"/1.x/api/getting-started-with-the-api.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3a964646").then(n)}},{name:"v-0359c01b",path:"/1.x/advanced/render-event.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0359c01b").then(n)}},{name:"v-b3e2f7dc",path:"/1.x/api/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-b3e2f7dc").then(n)}},{path:"/1.x/api/index.html",redirect:"/1.x/api/"},{name:"v-0648babb",path:"/1.x/architecture/modular-design.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0648babb").then(n)}},{name:"v-d80157e0",path:"/1.x/architecture/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-d80157e0").then(n)}},{path:"/1.x/architecture/index.html",redirect:"/1.x/architecture/"},{name:"v-2d5f850a",path:"/1.x/architecture/packages.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2d5f850a").then(n)}},{name:"v-f8ff2a8a",path:"/1.x/architecture/repository-pattern.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-f8ff2a8a").then(n)}},{name:"v-1d0a5d05",path:"/1.x/architecture/theme.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-1d0a5d05").then(n)}},{name:"v-3d14d060",path:"/1.x/custom-attributes/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3d14d060").then(n)}},{path:"/1.x/custom-attributes/index.html",redirect:"/1.x/custom-attributes/"},{name:"v-37d6db67",path:"/1.x/custom-attributes/custom-attribute.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-37d6db67").then(n)}},{name:"v-fb520162",path:"/1.x/custom-attributes/uses.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-fb520162").then(n)}},{name:"v-0606cc70",path:"/1.x/introduction/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0606cc70").then(n)}},{path:"/1.x/introduction/index.html",redirect:"/1.x/introduction/"},{name:"v-7cda367b",path:"/1.x/introduction/requirements.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-7cda367b").then(n)}},{name:"v-a1dfbd8a",path:"/1.x/introduction/installation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-a1dfbd8a").then(n)}},{name:"v-49812bde",path:"/1.x/packages/add-menu-in-admin.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-49812bde").then(n)}},{name:"v-97db1d60",path:"/1.x/packages/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-97db1d60").then(n)}},{path:"/1.x/packages/index.html",redirect:"/1.x/packages/"},{name:"v-81282f8a",path:"/1.x/packages/assets.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-81282f8a").then(n)}},{name:"v-9436f116",path:"/1.x/packages/controllers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-9436f116").then(n)}},{name:"v-3d32147b",path:"/1.x/packages/create-acl.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3d32147b").then(n)}},{name:"v-3098292d",path:"/1.x/packages/create-models.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3098292d").then(n)}},{name:"v-43d3637b",path:"/1.x/packages/create-package.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-43d3637b").then(n)}},{name:"v-43c25037",path:"/1.x/packages/create-migrations.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-43c25037").then(n)}},{name:"v-67061e4a",path:"/1.x/packages/datagrid.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-67061e4a").then(n)}},{name:"v-87d9c7de",path:"/1.x/packages/layouts.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-87d9c7de").then(n)}},{name:"v-253dcc3b",path:"/1.x/packages/localization.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-253dcc3b").then(n)}},{name:"v-4e564c1b",path:"/1.x/packages/routes.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4e564c1b").then(n)}},{name:"v-5ab843d6",path:"/1.x/packages/store-data-through-repositories.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-5ab843d6").then(n)}},{name:"v-32163c7b",path:"/1.x/packages/validation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-32163c7b").then(n)}},{name:"v-53650bf2",path:"/1.x/packages/views.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-53650bf2").then(n)}},{name:"v-22174a62",path:"/2.0/advanced/email-inbound-parse.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-22174a62").then(n)}},{name:"v-3f10e261",path:"/2.0/advanced/helpers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3f10e261").then(n)}},{name:"v-3b63817b",path:"/2.0/advanced/events.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3b63817b").then(n)}},{name:"v-97e6ce60",path:"/2.0/advanced/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-97e6ce60").then(n)}},{path:"/2.0/advanced/index.html",redirect:"/2.0/advanced/"},{name:"v-257fce1a",path:"/2.0/advanced/override-core-model.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-257fce1a").then(n)}},{name:"v-6f60c50a",path:"/2.0/advanced/render-event.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-6f60c50a").then(n)}},{name:"v-bc74fe4a",path:"/2.0/advanced/security-practice.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-bc74fe4a").then(n)}},{name:"v-97082ec0",path:"/2.0/api/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-97082ec0").then(n)}},{path:"/2.0/api/index.html",redirect:"/2.0/api/"},{name:"v-4d68c870",path:"/2.0/architecture/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4d68c870").then(n)}},{path:"/2.0/architecture/index.html",redirect:"/2.0/architecture/"},{name:"v-77ed9d62",path:"/2.0/api/getting-started-with-the-api.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-77ed9d62").then(n)}},{name:"v-4dd4215b",path:"/2.0/architecture/modular-design.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4dd4215b").then(n)}},{name:"v-48779cdb",path:"/2.0/architecture/repository-pattern.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-48779cdb").then(n)}},{name:"v-a373ca4a",path:"/2.0/architecture/packages.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-a373ca4a").then(n)}},{name:"v-923fce92",path:"/2.0/architecture/theme.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-923fce92").then(n)}},{name:"v-2d236119",path:"/2.0/custom-attributes/custom-attribute.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2d236119").then(n)}},{name:"v-597357a4",path:"/2.0/custom-attributes/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-597357a4").then(n)}},{path:"/2.0/custom-attributes/index.html",redirect:"/2.0/custom-attributes/"},{name:"v-001b8d81",path:"/2.0/custom-attributes/uses.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-001b8d81").then(n)}},{name:"v-811f7e60",path:"/2.0/introduction/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-811f7e60").then(n)}},{path:"/2.0/introduction/index.html",redirect:"/2.0/introduction/"},{name:"v-65c09c5b",path:"/2.0/introduction/docker.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-65c09c5b").then(n)}},{name:"v-c6f4abca",path:"/2.0/introduction/installation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-c6f4abca").then(n)}},{name:"v-6a4fbf5b",path:"/2.0/introduction/requirements.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-6a4fbf5b").then(n)}},{name:"v-00520ac3",path:"/2.0/packages/add-menu-in-admin.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-00520ac3").then(n)}},{name:"v-05934130",path:"/2.0/packages/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-05934130").then(n)}},{path:"/2.0/packages/index.html",redirect:"/2.0/packages/"},{name:"v-43d7274a",path:"/2.0/packages/assets.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-43d7274a").then(n)}},{name:"v-2607b25b",path:"/2.0/packages/blade-components.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2607b25b").then(n)}},{name:"v-4643c467",path:"/2.0/packages/controllers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4643c467").then(n)}},{name:"v-19b6241b",path:"/2.0/packages/create-acl.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-19b6241b").then(n)}},{name:"v-a3469142",path:"/2.0/packages/create-models.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-a3469142").then(n)}},{name:"v-68d4f0e9",path:"/2.0/packages/create-migrations.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-68d4f0e9").then(n)}},{name:"v-1dedbe9b",path:"/2.0/packages/create-package.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-1dedbe9b").then(n)}},{name:"v-52bde2bb",path:"/2.0/packages/datagrid.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-52bde2bb").then(n)}},{name:"v-577f2683",path:"/2.0/packages/layouts.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-577f2683").then(n)}},{name:"v-6cfed03b",path:"/2.0/packages/routes.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-6cfed03b").then(n)}},{name:"v-2b98acca",path:"/2.0/packages/localization.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2b98acca").then(n)}},{name:"v-b87050f2",path:"/2.0/packages/store-data-through-repositories.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-b87050f2").then(n)}},{name:"v-0e9a4c1b",path:"/2.0/packages/validation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0e9a4c1b").then(n)}},{name:"v-9498b98e",path:"/2.0/packages/views.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-9498b98e").then(n)}},{name:"v-0c08fe70",path:"/2.0/prologue/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0c08fe70").then(n)}},{path:"/2.0/prologue/index.html",redirect:"/2.0/prologue/"},{name:"v-4b11a99b",path:"/2.0/prologue/contribution-guide.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4b11a99b").then(n)}},{name:"v-2888eb6a",path:"/2.0/prologue/upgrade-guide.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2888eb6a").then(n)}},{name:"v-7ea5c780",path:"/master/advanced/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-7ea5c780").then(n)}},{path:"/master/advanced/index.html",redirect:"/master/advanced/"},{name:"v-fb9fdb00",path:"/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-fb9fdb00").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-3042924a",path:"/master/advanced/data-transfer.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3042924a").then(n)}},{name:"v-761748db",path:"/master/advanced/email-inbound-parse.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-761748db").then(n)}},{name:"v-1f119f3b",path:"/master/advanced/helpers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-1f119f3b").then(n)}},{name:"v-35006eca",path:"/master/advanced/override-core-model.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-35006eca").then(n)}},{name:"v-cc8367fe",path:"/master/advanced/render-event.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-cc8367fe").then(n)}},{name:"v-6c9aa255",path:"/master/advanced/events.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-6c9aa255").then(n)}},{name:"v-a79c52ca",path:"/master/advanced/security-practice.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-a79c52ca").then(n)}},{name:"v-75c7df60",path:"/master/api/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-75c7df60").then(n)}},{path:"/master/api/index.html",redirect:"/master/api/"},{name:"v-f2f6664a",path:"/master/api/getting-started-with-the-api.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-f2f6664a").then(n)}},{name:"v-5b513a44",path:"/master/architecture/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-5b513a44").then(n)}},{path:"/master/architecture/index.html",redirect:"/master/architecture/"},{name:"v-3d6730e7",path:"/master/architecture/modular-design.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3d6730e7").then(n)}},{name:"v-50c09862",path:"/master/architecture/packages.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-50c09862").then(n)}},{name:"v-82f3414a",path:"/master/architecture/theme.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-82f3414a").then(n)}},{name:"v-38093e8f",path:"/master/architecture/repository-pattern.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-38093e8f").then(n)}},{name:"v-19fa9c70",path:"/master/custom-attributes/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-19fa9c70").then(n)}},{path:"/master/custom-attributes/index.html",redirect:"/master/custom-attributes/"},{name:"v-3e7871fb",path:"/master/custom-attributes/uses.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3e7871fb").then(n)}},{name:"v-11d2520a",path:"/master/custom-attributes/custom-attribute.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-11d2520a").then(n)}},{name:"v-102d7560",path:"/master/introduction/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-102d7560").then(n)}},{path:"/master/introduction/index.html",redirect:"/master/introduction/"},{name:"v-29ba2c92",path:"/master/introduction/docker.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-29ba2c92").then(n)}},{name:"v-4ad03c83",path:"/master/introduction/installation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4ad03c83").then(n)}},{name:"v-94b795ac",path:"/master/packages/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-94b795ac").then(n)}},{path:"/master/packages/index.html",redirect:"/master/packages/"},{name:"v-5516a1ca",path:"/master/packages/add-menu-in-admin.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-5516a1ca").then(n)}},{name:"v-49e9b357",path:"/master/packages/assets.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-49e9b357").then(n)}},{name:"v-7b128352",path:"/master/introduction/requirements.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-7b128352").then(n)}},{name:"v-2d59775b",path:"/master/packages/controllers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2d59775b").then(n)}},{name:"v-68450b87",path:"/master/packages/blade-components.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-68450b87").then(n)}},{name:"v-c13ca42a",path:"/master/packages/create-acl.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-c13ca42a").then(n)}},{name:"v-77bdaafb",path:"/master/packages/create-migrations.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-77bdaafb").then(n)}},{name:"v-f028604a",path:"/master/packages/create-models.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-f028604a").then(n)}},{name:"v-0b718b3d",path:"/master/packages/datagrid.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0b718b3d").then(n)}},{name:"v-066aec9b",path:"/master/packages/layouts.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-066aec9b").then(n)}},{name:"v-03cb4f1a",path:"/master/packages/create-package.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-03cb4f1a").then(n)}},{name:"v-0142f749",path:"/master/packages/routes.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0142f749").then(n)}},{name:"v-3e3a5dab",path:"/master/packages/localization.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3e3a5dab").then(n)}},{name:"v-4ac4bd6b",path:"/master/packages/validation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4ac4bd6b").then(n)}},{name:"v-24913d76",path:"/master/prologue/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-24913d76").then(n)}},{path:"/master/prologue/index.html",redirect:"/master/prologue/"},{name:"v-c1dbb14a",path:"/master/packages/store-data-through-repositories.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-c1dbb14a").then(n)}},{name:"v-2b0dbf0a",path:"/master/packages/views.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2b0dbf0a").then(n)}},{name:"v-c4ee6cda",path:"/master/prologue/contribution-guide.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-c4ee6cda").then(n)}},{name:"v-71ef02ca",path:"/master/prologue/upgrade-guide.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-71ef02ca").then(n)}},{path:"*",component:Rl}],Dl={title:"Krayin CRM Developer Portal",description:"Krayin CRM Developer Portal",base:"/",headTags:[["link",{rel:"icon",type:"image/png",href:"/favicon.ico"}],["meta",{name:"title",content:"Krayin CRM Developer Portal"}]],pages:[{title:"Digging Deeper",frontmatter:{},regularPath:"/1.x/advanced/",relativePath:"1.x/advanced/README.md",key:"v-628bc8f0",path:"/1.x/advanced/",headers:[{level:3,title:"Events and Event Handlers",slug:"events-and-event-handlers"},{level:3,title:"Helpers",slug:"helpers"},{level:3,title:"Overriding Core Models",slug:"overriding-core-models"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{frontmatter:{},regularPath:"/1.x/advanced/email-inbound-parse.html",relativePath:"1.x/advanced/email-inbound-parse.md",key:"v-34fe0e46",path:"/1.x/advanced/email-inbound-parse.html",headers:[{level:3,title:"SendGrid Inbound Parse",slug:"sendgrid-inbound-parse"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Override Core Model",frontmatter:{},regularPath:"/1.x/advanced/override-core-model.html",relativePath:"1.x/advanced/override-core-model.md",key:"v-386691fe",path:"/1.x/advanced/override-core-model.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Overriding a Model Class",slug:"overriding-a-model-class"},{level:3,title:"Define an Interface (Contract)",slug:"define-an-interface-contract"},{level:3,title:"Register the Model Override",slug:"register-the-model-override"},{level:3,title:"Implement the Custom Model Class",slug:"implement-the-custom-model-class"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Helpers",frontmatter:{},regularPath:"/1.x/advanced/helpers.html",relativePath:"1.x/advanced/helpers.md",key:"v-b8b65022",path:"/1.x/advanced/helpers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Core Helpers",slug:"core-helpers"},{level:3,title:"Get the lists of timezone",slug:"get-the-lists-of-timezone"},{level:3,title:"Get the list of available locals",slug:"get-the-list-of-available-locals"},{level:3,title:"Get the list of countries",slug:"get-the-list-of-countries"},{level:3,title:"Get the country name",slug:"get-the-country-name"},{level:3,title:"Get the available states associated with country code",slug:"get-the-available-states-associated-with-country-code"},{level:3,title:"Get the specified state name associated with state code",slug:"get-the-specified-state-name-associated-with-state-code"},{level:3,title:"Get the Grouped the states by the countries",slug:"get-the-grouped-the-states-by-the-countries"},{level:3,title:"To Sort the items",slug:"to-sort-the-items"},{level:3,title:"Set a value in an array using dot notation",slug:"set-a-value-in-an-array-using-dot-notation"},{level:3,title:"To converted associated array",slug:"to-converted-associated-array"},{level:3,title:"To merge the array",slug:"to-merge-the-array"},{level:3,title:"Create singleton object through single facade",slug:"create-singleton-object-through-single-facade"},{level:3,title:"Format Date",slug:"format-date"},{level:3,title:"Return currency symbol from currency code",slug:"return-currency-symbol-from-currency-code"},{level:3,title:"Format base price",slug:"format-base-price"},{level:3,title:"Get the config field",slug:"get-the-config-field"},{level:3,title:"Get the config data",slug:"get-the-config-data"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Best Security Practices",frontmatter:{},regularPath:"/1.x/advanced/security-practice.html",relativePath:"1.x/advanced/security-practice.md",key:"v-7cb2e029",path:"/1.x/advanced/security-practice.html",headers:[{level:2,title:"Software Updates",slug:"software-updates"},{level:2,title:"Limiting Error Messages",slug:"limiting-error-messages"},{level:2,title:"Limiting Admin Access",slug:"limiting-admin-access"},{level:2,title:"Restricting Unnecessary Files",slug:"restricting-unnecessary-files"},{level:2,title:"Restricting PHP Execution Inside Storage",slug:"restricting-php-execution-inside-storage"},{level:2,title:"Server Hardening",slug:"server-hardening"},{level:2,title:"Strong Passwords",slug:"strong-passwords"},{level:2,title:"Implementation of HTTP Security Headers",slug:"implementation-of-http-security-headers"},{level:3,title:"HTTP Strict Transport Security (HSTS)",slug:"http-strict-transport-security-hsts"},{level:3,title:"Cross-Site Scripting Protection (X-XSS Protection)",slug:"cross-site-scripting-protection-x-xss-protection"},{level:3,title:"X-Frame-Options​",slug:"x-frame-options​"},{level:3,title:"X-Content-Type-Options​",slug:"x-content-type-options​"},{level:3,title:"Content Security Policy (CSP)",slug:"content-security-policy-csp"},{level:3,title:"Continuous Logging And Monitoring",slug:"continuous-logging-and-monitoring"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Events",frontmatter:{},regularPath:"/1.x/advanced/events.html",relativePath:"1.x/advanced/events.md",key:"v-1cbafd5b",path:"/1.x/advanced/events.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Creating an Event Class",slug:"creating-an-event-class"},{level:3,title:"Using Package Generator",slug:"using-package-generator"},{level:3,title:"Manually Registering Events",slug:"manually-registering-events"},{level:3,title:"Manually Registering Listeners",slug:"manually-registering-listeners"},{level:2,title:"Specifying Events",slug:"specifying-events"},{level:2,title:"Events Fired in Krayin",slug:"events-fired-in-krayin"},{level:2,title:"Listening to Existing Events",slug:"listening-to-existing-events"},{level:3,title:"Registering a Listener",slug:"registering-a-listener"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Krayin APIs",frontmatter:{},regularPath:"/1.x/api/getting-started-with-the-api.html",relativePath:"1.x/api/getting-started-with-the-api.md",key:"v-3a964646",path:"/1.x/api/getting-started-with-the-api.html",headers:[{level:2,title:"REST API",slug:"rest-api"},{level:2,title:"Explore REST API Demo",slug:"explore-rest-api-demo"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"View Render Event",frontmatter:{},regularPath:"/1.x/advanced/render-event.html",relativePath:"1.x/advanced/render-event.md",key:"v-0359c01b",path:"/1.x/advanced/render-event.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Render View",slug:"render-view"},{level:3,title:"Listening to Events",slug:"listening-to-events"},{level:3,title:"Implementation Details",slug:"implementation-details"},{level:3,title:"Considerations",slug:"considerations"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Krayin APIs",frontmatter:{},regularPath:"/1.x/api/",relativePath:"1.x/api/README.md",key:"v-b3e2f7dc",path:"/1.x/api/",headers:[{level:2,title:"REST API",slug:"rest-api"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Modular Design in Krayin",frontmatter:{},regularPath:"/1.x/architecture/modular-design.html",relativePath:"1.x/architecture/modular-design.md",key:"v-0648babb",path:"/1.x/architecture/modular-design.html",headers:[{level:2,title:"Key Benefits of Modular Design",slug:"key-benefits-of-modular-design"},{level:2,title:"Module Structure in Krayin",slug:"module-structure-in-krayin"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Architecture concepts",frontmatter:{},regularPath:"/1.x/architecture/",relativePath:"1.x/architecture/README.md",key:"v-d80157e0",path:"/1.x/architecture/",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Packages",frontmatter:{},regularPath:"/1.x/architecture/packages.html",relativePath:"1.x/architecture/packages.md",key:"v-2d5f850a",path:"/1.x/architecture/packages.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Available Packages In Krayin",slug:"available-packages-in-krayin"},{level:3,title:"Admin",slug:"admin"},{level:3,title:"Activity",slug:"activity"},{level:3,title:"Attribute",slug:"attribute"},{level:3,title:"Contact",slug:"contact"},{level:3,title:"Core",slug:"core"},{level:3,title:"Email",slug:"email"},{level:3,title:"EmailTemplate",slug:"emailtemplate"},{level:3,title:"Installer",slug:"installer"},{level:3,title:"Lead",slug:"lead"},{level:3,title:"Product",slug:"product"},{level:3,title:"Quote",slug:"quote"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"UI",slug:"ui"},{level:3,title:"User",slug:"user"},{level:3,title:"WebForm",slug:"webform"},{level:3,title:"Workflow",slug:"workflow"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Repository Pattern in Krayin",frontmatter:{},regularPath:"/1.x/architecture/repository-pattern.html",relativePath:"1.x/architecture/repository-pattern.md",key:"v-f8ff2a8a",path:"/1.x/architecture/repository-pattern.html",headers:[{level:3,title:"Benefits of the Repository Pattern",slug:"benefits-of-the-repository-pattern"},{level:3,title:"Implementation in Krayin",slug:"implementation-in-krayin"},{level:2,title:"Eloquent ORM",slug:"eloquent-orm"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Theme",frontmatter:{},regularPath:"/1.x/architecture/theme.html",relativePath:"1.x/architecture/theme.md",key:"v-1d0a5d05",path:"/1.x/architecture/theme.html",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Custom Attribute Creation",frontmatter:{},regularPath:"/1.x/custom-attributes/",relativePath:"1.x/custom-attributes/README.md",key:"v-3d14d060",path:"/1.x/custom-attributes/",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Use model with custom Attributes",frontmatter:{},regularPath:"/1.x/custom-attributes/custom-attribute.html",relativePath:"1.x/custom-attributes/custom-attribute.md",key:"v-37d6db67",path:"/1.x/custom-attributes/custom-attribute.html",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Create and using a new attribute",frontmatter:{},regularPath:"/1.x/custom-attributes/uses.html",relativePath:"1.x/custom-attributes/uses.md",key:"v-fb520162",path:"/1.x/custom-attributes/uses.html",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Introduction",frontmatter:{},regularPath:"/1.x/introduction/",relativePath:"1.x/introduction/README.md",key:"v-0606cc70",path:"/1.x/introduction/",headers:[{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Requirements",frontmatter:{},regularPath:"/1.x/introduction/requirements.html",relativePath:"1.x/introduction/requirements.md",key:"v-7cda367b",path:"/1.x/introduction/requirements.html",headers:[{level:2,title:"Server configuration",slug:"server-configuration"},{level:2,title:"PHP Extensions",slug:"php-extensions"},{level:2,title:"PHP Configuration",slug:"php-configuration"},{level:2,title:"Supported Database Servers",slug:"supported-database-servers"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Installation",frontmatter:{},regularPath:"/1.x/introduction/installation.html",relativePath:"1.x/introduction/installation.md",key:"v-a1dfbd8a",path:"/1.x/introduction/installation.html",headers:[{level:2,title:"Install Using Composer",slug:"install-using-composer"},{level:2,title:"Start Using Krayin",slug:"start-using-krayin"},{level:3,title:"On a Production Server",slug:"on-a-production-server"},{level:3,title:"On Your Local Server",slug:"on-your-local-server"},{level:3,title:"Login as an Admin",slug:"login-as-an-admin"},{level:3,title:"Contributing",slug:"contributing"},{level:3,title:"License",slug:"license"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Menu",frontmatter:{},regularPath:"/1.x/packages/add-menu-in-admin.html",relativePath:"1.x/packages/add-menu-in-admin.md",key:"v-49812bde",path:"/1.x/packages/add-menu-in-admin.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Configure the menu",slug:"configure-the-menu"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define Menu Items",slug:"define-menu-items"},{level:3,title:"Define Routes",slug:"define-routes"},{level:3,title:"Add Menu Icon",slug:"add-menu-icon"},{level:3,title:"Merge Configuration",slug:"merge-configuration"},{level:3,title:"Optimize Application",slug:"optimize-application"},{level:2,title:"Level of Menu",slug:"level-of-menu"},{level:3,title:"First Level (Sidebar)",slug:"first-level-sidebar"},{level:3,title:"Second Level (Hover Menu)",slug:"second-level-hover-menu"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Package Development",frontmatter:{},regularPath:"/1.x/packages/",relativePath:"1.x/packages/README.md",key:"v-97db1d60",path:"/1.x/packages/",headers:[{level:2,title:"Package Development",slug:"package-development"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Bundling Assets",frontmatter:{},regularPath:"/1.x/packages/assets.html",relativePath:"1.x/packages/assets.md",key:"v-81282f8a",path:"/1.x/packages/assets.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:2,title:"Configure Compiling Assets",slug:"configure-compiling-assets"},{level:2,title:"Create Configuration Files",slug:"create-configuration-files"},{level:3,title:"Set Up package.json",slug:"set-up-package-json"},{level:3,title:"Set Up webpack.mix.js",slug:"set-up-webpack-mix-js"},{level:3,title:"Importing Laravel Mix",slug:"importing-laravel-mix"},{level:3,title:"Merging Manifests",slug:"merging-manifests"},{level:3,title:"Setting the Public Path",slug:"setting-the-public-path"},{level:3,title:"Mix Configuration",slug:"mix-configuration"},{level:3,title:"Asset Compilation",slug:"asset-compilation"},{level:3,title:"Webpack Configuration",slug:"webpack-configuration"},{level:3,title:"Source Maps",slug:"source-maps"},{level:3,title:"Versioning",slug:"versioning"},{level:2,title:"Load Assets in Blade File",slug:"load-assets-in-blade-file"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Controller",frontmatter:{},regularPath:"/1.x/packages/controllers.html",relativePath:"1.x/packages/controllers.md",key:"v-9436f116",path:"/1.x/packages/controllers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"How to create Controllers",slug:"how-to-create-controllers"},{level:3,title:"Directory Structure",slug:"directory-structure"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Access Control List",frontmatter:{},regularPath:"/1.x/packages/create-acl.html",relativePath:"1.x/packages/create-acl.md",key:"v-3d32147b",path:"/1.x/packages/create-acl.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define ACL Configuration",slug:"define-acl-configuration"},{level:2,title:"Merge ACL Configuration",slug:"merge-acl-configuration"},{level:3,title:"Modify Service Provider",slug:"modify-service-provider"},{level:3,title:"Register Method",slug:"register-method"},{level:3,title:"Clear Configuration Cache",slug:"clear-configuration-cache"},{level:3,title:"Verify in Admin Panel",slug:"verify-in-admin-panel"},{level:2,title:"Checking Roles and Permissions",slug:"checking-roles-and-permissions"},{level:3,title:"Access Roles",slug:"access-roles"},{level:3,title:"Permission Checks",slug:"permission-checks"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Models",frontmatter:{},regularPath:"/1.x/packages/create-models.html",relativePath:"1.x/packages/create-models.md",key:"v-3098292d",path:"/1.x/packages/create-models.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Create the Contract",slug:"create-the-contract"},{level:3,title:"Create the Proxy",slug:"create-the-proxy"},{level:3,title:"Create the Model",slug:"create-the-model"},{level:3,title:"Create Module Service Provider",slug:"create-module-service-provider"},{level:3,title:"Registering ModuleServiceProvider",slug:"registering-moduleserviceprovider"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Getting Started",frontmatter:{},regularPath:"/1.x/packages/create-package.html",relativePath:"1.x/packages/create-package.md",key:"v-43d3637b",path:"/1.x/packages/create-package.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Registering Your Package",slug:"registering-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands"},{level:2,title:"Manual Setup of Files",slug:"manual-setup-of-files"},{level:3,title:"Create Package Directory",slug:"create-package-directory"},{level:3,title:"Create Service Provider",slug:"create-service-provider"},{level:3,title:"Register Your Package",slug:"register-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands-2"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Migrations",frontmatter:{},regularPath:"/1.x/packages/create-migrations.html",relativePath:"1.x/packages/create-migrations.md",key:"v-43c25037",path:"/1.x/packages/create-migrations.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Loading Migration from Package",slug:"loading-migration-from-package"},{level:3,title:"Creating Tables from Migrations",slug:"creating-tables-from-migrations"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"DataGrid",frontmatter:{},regularPath:"/1.x/packages/datagrid.html",relativePath:"1.x/packages/datagrid.md",key:"v-67061e4a",path:"/1.x/packages/datagrid.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Global Properties of DataGrid",slug:"global-properties-of-datagrid"},{level:2,title:"How DataGrid Works",slug:"how-datagrid-works"},{level:2,title:"Multiple DataGrids",slug:"multiple-datagrids"},{level:3,title:"DataGrid to JSON",slug:"datagrid-to-json"},{level:3,title:"Render DataGrid",slug:"render-datagrid"},{level:2,title:"Sample DataGrid",slug:"sample-datagrid"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Layouts",frontmatter:{},regularPath:"/1.x/packages/layouts.html",relativePath:"1.x/packages/layouts.md",key:"v-87d9c7de",path:"/1.x/packages/layouts.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Category Layout",slug:"category-layout"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Localization",frontmatter:{},regularPath:"/1.x/packages/localization.html",relativePath:"1.x/packages/localization.md",key:"v-253dcc3b",path:"/1.x/packages/localization.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Publishing the Language Files",slug:"publishing-the-language-files"},{level:2,title:"Configuring the Locale",slug:"configuring-the-locale"},{level:2,title:"Create a new Locale",slug:"create-a-new-locale"},{level:3,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Writing a Translation in app.php",slug:"writing-a-translation-in-app-php"},{level:2,title:"Load Translation from Package",slug:"load-translation-from-package"},{level:3,title:"Update the Service Provider",slug:"update-the-service-provider"},{level:3,title:"Use Translations in Blade Files",slug:"use-translations-in-blade-files"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Routes",frontmatter:{},regularPath:"/1.x/packages/routes.html",relativePath:"1.x/packages/routes.md",key:"v-4e564c1b",path:"/1.x/packages/routes.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Create a new Route",slug:"create-a-new-route"},{level:3,title:"Routes",slug:"routes-2"},{level:2,title:"Loading Routes",slug:"loading-routes"},{level:3,title:"Register Routes in ServiceProvider",slug:"register-routes-in-serviceprovider"},{level:2,title:"Available HTTP methods",slug:"available-http-methods"},{level:3,title:"GET",slug:"get"},{level:3,title:"POST",slug:"post"},{level:3,title:"PUT",slug:"put"},{level:3,title:"DELETE",slug:"delete"},{level:3,title:"PATCH",slug:"patch"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Repositories",frontmatter:{},regularPath:"/1.x/packages/store-data-through-repositories.html",relativePath:"1.x/packages/store-data-through-repositories.md",key:"v-5ab843d6",path:"/1.x/packages/store-data-through-repositories.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Dependency Injection",slug:"dependency-injection"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Create a New Repository Class",slug:"create-a-new-repository-class"},{level:3,title:"Explanation",slug:"explanation"},{level:2,title:"Manually Setting Up Repository Files",slug:"manually-setting-up-repository-files"},{level:3,title:"Setting Up CategoryRepository in Webkul/Category Package",slug:"setting-up-categoryrepository-in-webkul-category-package"},{level:2,title:"Available Methods",slug:"available-methods"},{level:3,title:"all",slug:"all"},{level:3,title:"Find",slug:"find"},{level:3,title:"FindOrFail",slug:"findorfail"},{level:3,title:"Create",slug:"create"},{level:3,title:"Update",slug:"update"},{level:3,title:"Delete",slug:"delete"},{level:3,title:"Paginate",slug:"paginate"},{level:3,title:"FindWhere",slug:"findwhere"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Validation",frontmatter:{},regularPath:"/1.x/packages/validation.html",relativePath:"1.x/packages/validation.md",key:"v-32163c7b",path:"/1.x/packages/validation.html",headers:[{level:2,title:"Validation Using Laravel",slug:"validation-using-laravel"},{level:3,title:"Introduction",slug:"introduction"},{level:3,title:"Usage",slug:"usage"},{level:2,title:"Validation Using Vue",slug:"validation-using-vue"},{level:3,title:"Introduction",slug:"introduction-2"},{level:3,title:"Installation",slug:"installation"},{level:3,title:"Configuration",slug:"configuration"},{level:3,title:"Examples",slug:"examples"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Views",frontmatter:{},regularPath:"/1.x/packages/views.html",relativePath:"1.x/packages/views.md",key:"v-53650bf2",path:"/1.x/packages/views.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Adding HTML Content",slug:"adding-html-content"},{level:2,title:"Load Views from Package",slug:"load-views-from-package"},{level:2,title:"Rendering Views",slug:"rendering-views"},{level:2,title:"Blade File Naming Convention",slug:"blade-file-naming-convention"},{level:3,title:"Listing (Index Blade):",slug:"listing-index-blade"},{level:3,title:"Creation (Create Blade):",slug:"creation-create-blade"},{level:3,title:"Updating (Edit Blade):",slug:"updating-edit-blade"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{frontmatter:{},regularPath:"/2.0/advanced/email-inbound-parse.html",relativePath:"2.0/advanced/email-inbound-parse.md",key:"v-22174a62",path:"/2.0/advanced/email-inbound-parse.html",headers:[{level:3,title:"SendGrid Inbound Parse",slug:"sendgrid-inbound-parse"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Helpers",frontmatter:{},regularPath:"/2.0/advanced/helpers.html",relativePath:"2.0/advanced/helpers.md",key:"v-3f10e261",path:"/2.0/advanced/helpers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Core Helpers",slug:"core-helpers"},{level:3,title:"Get the lists of timezone",slug:"get-the-lists-of-timezone"},{level:3,title:"Get the list of available locals",slug:"get-the-list-of-available-locals"},{level:3,title:"Get the list of countries",slug:"get-the-list-of-countries"},{level:3,title:"Get the country name",slug:"get-the-country-name"},{level:3,title:"Get the available states associated with country code",slug:"get-the-available-states-associated-with-country-code"},{level:3,title:"Get the specified state name associated with state code",slug:"get-the-specified-state-name-associated-with-state-code"},{level:3,title:"Get the Grouped the states by the countries",slug:"get-the-grouped-the-states-by-the-countries"},{level:3,title:"To Sort the items",slug:"to-sort-the-items"},{level:3,title:"Create singleton object through single facade",slug:"create-singleton-object-through-single-facade"},{level:3,title:"Format Date",slug:"format-date"},{level:3,title:"Return currency symbol from currency code",slug:"return-currency-symbol-from-currency-code"},{level:3,title:"Format base price",slug:"format-base-price"},{level:3,title:"Get the config field",slug:"get-the-config-field"},{level:3,title:"Get the config data",slug:"get-the-config-data"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Events",frontmatter:{},regularPath:"/2.0/advanced/events.html",relativePath:"2.0/advanced/events.md",key:"v-3b63817b",path:"/2.0/advanced/events.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Creating an Event Class",slug:"creating-an-event-class"},{level:3,title:"Using Package Generator",slug:"using-package-generator"},{level:3,title:"Manually Registering Events",slug:"manually-registering-events"},{level:3,title:"Manually Registering Listeners",slug:"manually-registering-listeners"},{level:2,title:"Specifying Events",slug:"specifying-events"},{level:2,title:"Events Fired in Krayin",slug:"events-fired-in-krayin"},{level:2,title:"Listening to Existing Events",slug:"listening-to-existing-events"},{level:3,title:"Registering a Listener",slug:"registering-a-listener"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Digging Deeper",frontmatter:{},regularPath:"/2.0/advanced/",relativePath:"2.0/advanced/README.md",key:"v-97e6ce60",path:"/2.0/advanced/",headers:[{level:3,title:"Events and Event Handlers",slug:"events-and-event-handlers"},{level:3,title:"Helpers",slug:"helpers"},{level:3,title:"Overriding Core Models",slug:"overriding-core-models"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Override Core Model",frontmatter:{},regularPath:"/2.0/advanced/override-core-model.html",relativePath:"2.0/advanced/override-core-model.md",key:"v-257fce1a",path:"/2.0/advanced/override-core-model.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Overriding a Model Class",slug:"overriding-a-model-class"},{level:3,title:"Define an Interface (Contract)",slug:"define-an-interface-contract"},{level:3,title:"Register the Model Override",slug:"register-the-model-override"},{level:3,title:"Implement the Custom Model Class",slug:"implement-the-custom-model-class"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"View Render Event",frontmatter:{},regularPath:"/2.0/advanced/render-event.html",relativePath:"2.0/advanced/render-event.md",key:"v-6f60c50a",path:"/2.0/advanced/render-event.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Render View",slug:"render-view"},{level:3,title:"Listening to Events",slug:"listening-to-events"},{level:3,title:"Implementation Details",slug:"implementation-details"},{level:3,title:"Considerations",slug:"considerations"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Best Security Practices",frontmatter:{},regularPath:"/2.0/advanced/security-practice.html",relativePath:"2.0/advanced/security-practice.md",key:"v-bc74fe4a",path:"/2.0/advanced/security-practice.html",headers:[{level:2,title:"Software Updates",slug:"software-updates"},{level:2,title:"Limiting Error Messages",slug:"limiting-error-messages"},{level:2,title:"Limiting Admin Access",slug:"limiting-admin-access"},{level:2,title:"Restricting Unnecessary Files",slug:"restricting-unnecessary-files"},{level:2,title:"Restricting PHP Execution Inside Storage",slug:"restricting-php-execution-inside-storage"},{level:2,title:"Server Hardening",slug:"server-hardening"},{level:2,title:"Strong Passwords",slug:"strong-passwords"},{level:2,title:"Implementation of HTTP Security Headers",slug:"implementation-of-http-security-headers"},{level:3,title:"HTTP Strict Transport Security (HSTS)",slug:"http-strict-transport-security-hsts"},{level:3,title:"Cross-Site Scripting Protection (X-XSS Protection)",slug:"cross-site-scripting-protection-x-xss-protection"},{level:3,title:"X-Frame-Options​",slug:"x-frame-options​"},{level:3,title:"X-Content-Type-Options​",slug:"x-content-type-options​"},{level:3,title:"Content Security Policy (CSP)",slug:"content-security-policy-csp"},{level:3,title:"Continuous Logging And Monitoring",slug:"continuous-logging-and-monitoring"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Krayin APIs",frontmatter:{},regularPath:"/2.0/api/",relativePath:"2.0/api/README.md",key:"v-97082ec0",path:"/2.0/api/",headers:[{level:2,title:"REST API",slug:"rest-api"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Architecture concepts",frontmatter:{},regularPath:"/2.0/architecture/",relativePath:"2.0/architecture/README.md",key:"v-4d68c870",path:"/2.0/architecture/",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Krayin APIs",frontmatter:{},regularPath:"/2.0/api/getting-started-with-the-api.html",relativePath:"2.0/api/getting-started-with-the-api.md",key:"v-77ed9d62",path:"/2.0/api/getting-started-with-the-api.html",headers:[{level:2,title:"REST API",slug:"rest-api"},{level:2,title:"Explore REST API Demo",slug:"explore-rest-api-demo"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Modular Design in Krayin",frontmatter:{},regularPath:"/2.0/architecture/modular-design.html",relativePath:"2.0/architecture/modular-design.md",key:"v-4dd4215b",path:"/2.0/architecture/modular-design.html",headers:[{level:2,title:"Key Benefits of Modular Design",slug:"key-benefits-of-modular-design"},{level:2,title:"Module Structure in Krayin",slug:"module-structure-in-krayin"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Repository Pattern in Krayin",frontmatter:{},regularPath:"/2.0/architecture/repository-pattern.html",relativePath:"2.0/architecture/repository-pattern.md",key:"v-48779cdb",path:"/2.0/architecture/repository-pattern.html",headers:[{level:3,title:"Benefits of the Repository Pattern",slug:"benefits-of-the-repository-pattern"},{level:3,title:"Implementation in Krayin",slug:"implementation-in-krayin"},{level:2,title:"Eloquent ORM",slug:"eloquent-orm"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Packages",frontmatter:{},regularPath:"/2.0/architecture/packages.html",relativePath:"2.0/architecture/packages.md",key:"v-a373ca4a",path:"/2.0/architecture/packages.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Available Packages In Krayin",slug:"available-packages-in-krayin"},{level:3,title:"Admin",slug:"admin"},{level:3,title:"Activity",slug:"activity"},{level:3,title:"Attribute",slug:"attribute"},{level:3,title:"Contact",slug:"contact"},{level:3,title:"Core",slug:"core"},{level:3,title:"Email",slug:"email"},{level:3,title:"EmailTemplate",slug:"emailtemplate"},{level:3,title:"Installer",slug:"installer"},{level:3,title:"Lead",slug:"lead"},{level:3,title:"Product",slug:"product"},{level:3,title:"Quote",slug:"quote"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"User",slug:"user"},{level:3,title:"WebForm",slug:"webform"},{level:3,title:"Automation",slug:"automation"},{level:3,title:"Datagrid",slug:"datagrid"},{level:3,title:"Warehouse",slug:"warehouse"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Theme",frontmatter:{},regularPath:"/2.0/architecture/theme.html",relativePath:"2.0/architecture/theme.md",key:"v-923fce92",path:"/2.0/architecture/theme.html",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Use model with custom Attributes",frontmatter:{},regularPath:"/2.0/custom-attributes/custom-attribute.html",relativePath:"2.0/custom-attributes/custom-attribute.md",key:"v-2d236119",path:"/2.0/custom-attributes/custom-attribute.html",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Custom Attribute Creation",frontmatter:{},regularPath:"/2.0/custom-attributes/",relativePath:"2.0/custom-attributes/README.md",key:"v-597357a4",path:"/2.0/custom-attributes/",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Create and using a new attribute",frontmatter:{},regularPath:"/2.0/custom-attributes/uses.html",relativePath:"2.0/custom-attributes/uses.md",key:"v-001b8d81",path:"/2.0/custom-attributes/uses.html",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Introduction",frontmatter:{},regularPath:"/2.0/introduction/",relativePath:"2.0/introduction/README.md",key:"v-811f7e60",path:"/2.0/introduction/",headers:[{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Docker",frontmatter:{},regularPath:"/2.0/introduction/docker.html",relativePath:"2.0/introduction/docker.md",key:"v-65c09c5b",path:"/2.0/introduction/docker.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Docker Setup for Krayin",slug:"docker-setup-for-krayin"},{level:3,title:"1. Using Krayin Docker Image from Docker Hub",slug:"_1-using-krayin-docker-image-from-docker-hub"},{level:3,title:"2. Using Krayin GitHub Docker Repository",slug:"_2-using-krayin-github-docker-repository"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Installation",frontmatter:{},regularPath:"/2.0/introduction/installation.html",relativePath:"2.0/introduction/installation.md",key:"v-c6f4abca",path:"/2.0/introduction/installation.html",headers:[{level:2,title:"Install Using GUI Installer",slug:"install-using-gui-installer"},{level:2,title:"Install Using Composer",slug:"install-using-composer"},{level:2,title:"Start Using Krayin",slug:"start-using-krayin"},{level:3,title:"On a Production Server",slug:"on-a-production-server"},{level:3,title:"On Your Local Server",slug:"on-your-local-server"},{level:3,title:"Login as an Admin",slug:"login-as-an-admin"},{level:3,title:"Contributing",slug:"contributing"},{level:3,title:"License",slug:"license"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Requirements",frontmatter:{},regularPath:"/2.0/introduction/requirements.html",relativePath:"2.0/introduction/requirements.md",key:"v-6a4fbf5b",path:"/2.0/introduction/requirements.html",headers:[{level:2,title:"Server configuration",slug:"server-configuration"},{level:2,title:"PHP Extensions",slug:"php-extensions"},{level:2,title:"PHP Configuration",slug:"php-configuration"},{level:2,title:"Supported Database Servers",slug:"supported-database-servers"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Menu",frontmatter:{},regularPath:"/2.0/packages/add-menu-in-admin.html",relativePath:"2.0/packages/add-menu-in-admin.md",key:"v-00520ac3",path:"/2.0/packages/add-menu-in-admin.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Configure the menu",slug:"configure-the-menu"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define Menu Items",slug:"define-menu-items"},{level:3,title:"Define Routes",slug:"define-routes"},{level:3,title:"Add Menu Icon",slug:"add-menu-icon"},{level:3,title:"Merge Configuration",slug:"merge-configuration"},{level:3,title:"Optimize Application",slug:"optimize-application"},{level:2,title:"Level of Menu",slug:"level-of-menu"},{level:3,title:"First Level (Sidebar)",slug:"first-level-sidebar"},{level:3,title:"Second Level (Hover Menu)",slug:"second-level-hover-menu"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Package Development",frontmatter:{},regularPath:"/2.0/packages/",relativePath:"2.0/packages/README.md",key:"v-05934130",path:"/2.0/packages/",headers:[{level:2,title:"Package Development",slug:"package-development"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Bundling Assets",frontmatter:{},regularPath:"/2.0/packages/assets.html",relativePath:"2.0/packages/assets.md",key:"v-43d7274a",path:"/2.0/packages/assets.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:2,title:"Configure Compiling Assets",slug:"configure-compiling-assets"},{level:2,title:"Create Configuration Files",slug:"create-configuration-files"},{level:3,title:"Set Up package.json",slug:"set-up-package-json"},{level:3,title:"Set Up webpack.mix.js",slug:"set-up-webpack-mix-js"},{level:3,title:"Importing Laravel Mix",slug:"importing-laravel-mix"},{level:3,title:"Merging Manifests",slug:"merging-manifests"},{level:3,title:"Setting the Public Path",slug:"setting-the-public-path"},{level:3,title:"Mix Configuration",slug:"mix-configuration"},{level:3,title:"Asset Compilation",slug:"asset-compilation"},{level:3,title:"Webpack Configuration",slug:"webpack-configuration"},{level:3,title:"Source Maps",slug:"source-maps"},{level:3,title:"Versioning",slug:"versioning"},{level:2,title:"Load Assets in Blade File",slug:"load-assets-in-blade-file"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Blade Components",frontmatter:{},regularPath:"/2.0/packages/blade-components.html",relativePath:"2.0/packages/blade-components.md",key:"v-2607b25b",path:"/2.0/packages/blade-components.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Components",slug:"components"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"Avatar",slug:"avatar"},{level:3,title:"Activities",slug:"activities"},{level:3,title:"Lookup",slug:"lookup"},{level:3,title:"Attachment",slug:"attachment"},{level:3,title:"Inline Editable",slug:"inline-editable"},{level:3,title:"Accordion",slug:"accordion"},{level:3,title:"Button",slug:"button"},{level:3,title:"Drawer",slug:"drawer"},{level:3,title:"Dropdown",slug:"dropdown"},{level:3,title:"Flat-Picker",slug:"flat-picker"},{level:3,title:"Data Grid",slug:"data-grid"},{level:3,title:"Tinymce",slug:"tinymce"},{level:3,title:"Shimmer",slug:"shimmer"},{level:3,title:"Table",slug:"table"},{level:3,title:"Modal",slug:"modal"},{level:3,title:"Tree",slug:"tree"},{level:3,title:"Media",slug:"media"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Controller",frontmatter:{},regularPath:"/2.0/packages/controllers.html",relativePath:"2.0/packages/controllers.md",key:"v-4643c467",path:"/2.0/packages/controllers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"How to create Controllers",slug:"how-to-create-controllers"},{level:3,title:"Directory Structure",slug:"directory-structure"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Access Control List",frontmatter:{},regularPath:"/2.0/packages/create-acl.html",relativePath:"2.0/packages/create-acl.md",key:"v-19b6241b",path:"/2.0/packages/create-acl.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define ACL Configuration",slug:"define-acl-configuration"},{level:2,title:"Merge ACL Configuration",slug:"merge-acl-configuration"},{level:3,title:"Modify Service Provider",slug:"modify-service-provider"},{level:3,title:"Register Method",slug:"register-method"},{level:3,title:"Clear Configuration Cache",slug:"clear-configuration-cache"},{level:3,title:"Verify in Admin Panel",slug:"verify-in-admin-panel"},{level:2,title:"Checking Roles and Permissions",slug:"checking-roles-and-permissions"},{level:3,title:"Access Roles",slug:"access-roles"},{level:3,title:"Permission Checks",slug:"permission-checks"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Models",frontmatter:{},regularPath:"/2.0/packages/create-models.html",relativePath:"2.0/packages/create-models.md",key:"v-a3469142",path:"/2.0/packages/create-models.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Create the Contract",slug:"create-the-contract"},{level:3,title:"Create the Proxy",slug:"create-the-proxy"},{level:3,title:"Create the Model",slug:"create-the-model"},{level:3,title:"Create Module Service Provider",slug:"create-module-service-provider"},{level:3,title:"Registering ModuleServiceProvider",slug:"registering-moduleserviceprovider"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Migrations",frontmatter:{},regularPath:"/2.0/packages/create-migrations.html",relativePath:"2.0/packages/create-migrations.md",key:"v-68d4f0e9",path:"/2.0/packages/create-migrations.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Loading Migration from Package",slug:"loading-migration-from-package"},{level:3,title:"Creating Tables from Migrations",slug:"creating-tables-from-migrations"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Getting Started",frontmatter:{},regularPath:"/2.0/packages/create-package.html",relativePath:"2.0/packages/create-package.md",key:"v-1dedbe9b",path:"/2.0/packages/create-package.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Registering Your Package",slug:"registering-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands"},{level:2,title:"Manual Setup of Files",slug:"manual-setup-of-files"},{level:3,title:"Create Package Directory",slug:"create-package-directory"},{level:3,title:"Create Service Provider",slug:"create-service-provider"},{level:3,title:"Register Your Package",slug:"register-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands-2"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"DataGrid",frontmatter:{},regularPath:"/2.0/packages/datagrid.html",relativePath:"2.0/packages/datagrid.md",key:"v-52bde2bb",path:"/2.0/packages/datagrid.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Global Properties of DataGrid",slug:"global-properties-of-datagrid"},{level:2,title:"How DataGrid Works",slug:"how-datagrid-works"},{level:2,title:"Multiple DataGrids",slug:"multiple-datagrids"},{level:3,title:"DataGrid to JSON",slug:"datagrid-to-json"},{level:3,title:"Render DataGrid",slug:"render-datagrid"},{level:2,title:"Sample DataGrid",slug:"sample-datagrid"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Layouts",frontmatter:{},regularPath:"/2.0/packages/layouts.html",relativePath:"2.0/packages/layouts.md",key:"v-577f2683",path:"/2.0/packages/layouts.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Category Layout",slug:"category-layout"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Routes",frontmatter:{},regularPath:"/2.0/packages/routes.html",relativePath:"2.0/packages/routes.md",key:"v-6cfed03b",path:"/2.0/packages/routes.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Create a new Route",slug:"create-a-new-route"},{level:3,title:"Routes",slug:"routes-2"},{level:2,title:"Loading Routes",slug:"loading-routes"},{level:3,title:"Register Routes in ServiceProvider",slug:"register-routes-in-serviceprovider"},{level:2,title:"Available HTTP methods",slug:"available-http-methods"},{level:3,title:"GET",slug:"get"},{level:3,title:"POST",slug:"post"},{level:3,title:"PUT",slug:"put"},{level:3,title:"DELETE",slug:"delete"},{level:3,title:"PATCH",slug:"patch"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Localization",frontmatter:{},regularPath:"/2.0/packages/localization.html",relativePath:"2.0/packages/localization.md",key:"v-2b98acca",path:"/2.0/packages/localization.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Publishing the Language Files",slug:"publishing-the-language-files"},{level:2,title:"Configuring the Locale",slug:"configuring-the-locale"},{level:2,title:"Create a new Locale",slug:"create-a-new-locale"},{level:3,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Writing a Translation in app.php",slug:"writing-a-translation-in-app-php"},{level:2,title:"Load Translation from Package",slug:"load-translation-from-package"},{level:3,title:"Update the Service Provider",slug:"update-the-service-provider"},{level:3,title:"Use Translations in Blade Files",slug:"use-translations-in-blade-files"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Repositories",frontmatter:{},regularPath:"/2.0/packages/store-data-through-repositories.html",relativePath:"2.0/packages/store-data-through-repositories.md",key:"v-b87050f2",path:"/2.0/packages/store-data-through-repositories.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Dependency Injection",slug:"dependency-injection"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Create a New Repository Class",slug:"create-a-new-repository-class"},{level:3,title:"Explanation",slug:"explanation"},{level:2,title:"Manually Setting Up Repository Files",slug:"manually-setting-up-repository-files"},{level:3,title:"Setting Up CategoryRepository in Webkul/Category Package",slug:"setting-up-categoryrepository-in-webkul-category-package"},{level:2,title:"Available Methods",slug:"available-methods"},{level:3,title:"all",slug:"all"},{level:3,title:"Find",slug:"find"},{level:3,title:"FindOrFail",slug:"findorfail"},{level:3,title:"Create",slug:"create"},{level:3,title:"Update",slug:"update"},{level:3,title:"Delete",slug:"delete"},{level:3,title:"Paginate",slug:"paginate"},{level:3,title:"FindWhere",slug:"findwhere"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Validation",frontmatter:{},regularPath:"/2.0/packages/validation.html",relativePath:"2.0/packages/validation.md",key:"v-0e9a4c1b",path:"/2.0/packages/validation.html",headers:[{level:2,title:"Validation Using Laravel",slug:"validation-using-laravel"},{level:3,title:"Introduction",slug:"introduction"},{level:3,title:"Usage",slug:"usage"},{level:2,title:"Validation Using Vue",slug:"validation-using-vue"},{level:3,title:"Introduction",slug:"introduction-2"},{level:3,title:"Installation",slug:"installation"},{level:3,title:"Configuration",slug:"configuration"},{level:3,title:"Examples",slug:"examples"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Views",frontmatter:{},regularPath:"/2.0/packages/views.html",relativePath:"2.0/packages/views.md",key:"v-9498b98e",path:"/2.0/packages/views.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Adding HTML Content",slug:"adding-html-content"},{level:2,title:"Load Views from Package",slug:"load-views-from-package"},{level:2,title:"Rendering Views",slug:"rendering-views"},{level:2,title:"Blade File Naming Convention",slug:"blade-file-naming-convention"},{level:3,title:"Listing (Index Blade):",slug:"listing-index-blade"},{level:3,title:"Creation (Create Blade):",slug:"creation-create-blade"},{level:3,title:"Updating (Edit Blade):",slug:"updating-edit-blade"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Prologue",frontmatter:{},regularPath:"/2.0/prologue/",relativePath:"2.0/prologue/README.md",key:"v-0c08fe70",path:"/2.0/prologue/",headers:[{level:2,title:"Introduction to Krayin",slug:"introduction-to-krayin"},{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Contribution Guide",frontmatter:{},regularPath:"/2.0/prologue/contribution-guide.html",relativePath:"2.0/prologue/contribution-guide.md",key:"v-4b11a99b",path:"/2.0/prologue/contribution-guide.html",headers:[{level:2,title:"Bug Reports",slug:"bug-reports"},{level:2,title:"Projects to Contribute",slug:"projects-to-contribute"},{level:2,title:"Feature Requests",slug:"feature-requests"},{level:2,title:"Branch Selection",slug:"branch-selection"},{level:2,title:"Compiled Assets",slug:"compiled-assets"},{level:2,title:"Tailwind Class Reordering",slug:"tailwind-class-reordering"},{level:2,title:"Pint Tests",slug:"pint-tests"},{level:2,title:"Security Vulnerabilities",slug:"security-vulnerabilities"},{level:2,title:"Coding Style",slug:"coding-style"},{level:2,title:"PHPDoc",slug:"phpdoc"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Upgrade Guide",frontmatter:{},regularPath:"/2.0/prologue/upgrade-guide.html",relativePath:"2.0/prologue/upgrade-guide.md",key:"v-2888eb6a",path:"/2.0/prologue/upgrade-guide.html",headers:[{level:2,title:"Upgrade Steps",slug:"upgrade-steps"},{level:2,title:"New Changes",slug:"new-changes"},{level:3,title:"Changes in the latest release",slug:"changes-in-the-latest-release"},{level:2,title:"Composer Dependencies",slug:"composer-dependencies-2"},{level:3,title:"Differences in Composer Dependencies",slug:"differences-in-composer-dependencies"},{level:3,title:"Differences in Development Dependencies",slug:"differences-in-development-dependencies"},{level:3,title:"Differences in Autoloading",slug:"differences-in-autoloading"},{level:3,title:"Summary of Changes",slug:"summary-of-changes"},{level:3,title:"Upgrade Instructions",slug:"upgrade-instructions"},{level:3,title:"Conclusion",slug:"conclusion"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Digging Deeper",frontmatter:{},regularPath:"/master/advanced/",relativePath:"master/advanced/README.md",key:"v-7ea5c780",path:"/master/advanced/",headers:[{level:3,title:"Events and Event Handlers",slug:"events-and-event-handlers"},{level:3,title:"Helpers",slug:"helpers"},{level:3,title:"Overriding Core Models",slug:"overriding-core-models"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Home",frontmatter:{home:!0,heroText:"Krayin CRM Developer Portal",tagline:"Find detailed documentation and code examples.",actionText:"Get Started →",actionLink:"/2.0/introduction/",features:[{title:"Package creation",details:"Learn how to create a new package for Krayin."},{title:"Digging Deeper",details:"Learn advanced topics like payment methods, shipping methods."},{title:"API documentation",details:"Learn how to connect your existing systems with the Krayin API."}],footer:"Copyright © 2024 Krayin"},regularPath:"/",relativePath:"README.md",key:"v-fb9fdb00",path:"/",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{frontmatter:{},regularPath:"/master/advanced/data-transfer.html",relativePath:"master/advanced/data-transfer.md",key:"v-3042924a",path:"/master/advanced/data-transfer.html",headers:[{level:3,title:"Introduction",slug:"introduction"},{level:3,title:"Features",slug:"features"},{level:3,title:"Usage",slug:"usage"},{level:3,title:"Validation",slug:"validation"},{level:3,title:"Error Handling",slug:"error-handling"},{level:3,title:"CRUD Actions",slug:"crud-actions"},{level:3,title:"Edit Import Data",slug:"edit-import-data"},{level:3,title:"Queue Configuration",slug:"queue-configuration"},{level:3,title:"Conclusion",slug:"conclusion"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{frontmatter:{},regularPath:"/master/advanced/email-inbound-parse.html",relativePath:"master/advanced/email-inbound-parse.md",key:"v-761748db",path:"/master/advanced/email-inbound-parse.html",headers:[{level:3,title:"SendGrid Inbound Parse",slug:"sendgrid-inbound-parse"},{level:3,title:"IMAP Inbound Parse",slug:"imap-inbound-parse"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Helpers",frontmatter:{},regularPath:"/master/advanced/helpers.html",relativePath:"master/advanced/helpers.md",key:"v-1f119f3b",path:"/master/advanced/helpers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Core Helpers",slug:"core-helpers"},{level:3,title:"Get the lists of timezone",slug:"get-the-lists-of-timezone"},{level:3,title:"Get the list of available locals",slug:"get-the-list-of-available-locals"},{level:3,title:"Get the list of countries",slug:"get-the-list-of-countries"},{level:3,title:"Get the country name",slug:"get-the-country-name"},{level:3,title:"Get the available states associated with country code",slug:"get-the-available-states-associated-with-country-code"},{level:3,title:"Get the specified state name associated with state code",slug:"get-the-specified-state-name-associated-with-state-code"},{level:3,title:"Get the Grouped the states by the countries",slug:"get-the-grouped-the-states-by-the-countries"},{level:3,title:"Create singleton object through single facade",slug:"create-singleton-object-through-single-facade"},{level:3,title:"Format Date",slug:"format-date"},{level:3,title:"Return currency symbol from currency code",slug:"return-currency-symbol-from-currency-code"},{level:3,title:"Format base price",slug:"format-base-price"},{level:3,title:"Get the config field",slug:"get-the-config-field"},{level:3,title:"Get the config data",slug:"get-the-config-data"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Override Core Model",frontmatter:{},regularPath:"/master/advanced/override-core-model.html",relativePath:"master/advanced/override-core-model.md",key:"v-35006eca",path:"/master/advanced/override-core-model.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Overriding a Model Class",slug:"overriding-a-model-class"},{level:3,title:"Define an Interface (Contract)",slug:"define-an-interface-contract"},{level:3,title:"Register the Model Override",slug:"register-the-model-override"},{level:3,title:"Implement the Custom Model Class",slug:"implement-the-custom-model-class"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"View Render Event",frontmatter:{},regularPath:"/master/advanced/render-event.html",relativePath:"master/advanced/render-event.md",key:"v-cc8367fe",path:"/master/advanced/render-event.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Render View",slug:"render-view"},{level:3,title:"Listening to Events",slug:"listening-to-events"},{level:3,title:"Implementation Details",slug:"implementation-details"},{level:3,title:"Considerations",slug:"considerations"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Events",frontmatter:{},regularPath:"/master/advanced/events.html",relativePath:"master/advanced/events.md",key:"v-6c9aa255",path:"/master/advanced/events.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Creating an Event Class",slug:"creating-an-event-class"},{level:3,title:"Using Package Generator",slug:"using-package-generator"},{level:3,title:"Manually Registering Events",slug:"manually-registering-events"},{level:3,title:"Manually Registering Listeners",slug:"manually-registering-listeners"},{level:2,title:"Specifying Events",slug:"specifying-events"},{level:2,title:"Events Fired in Krayin",slug:"events-fired-in-krayin"},{level:2,title:"Listening to Existing Events",slug:"listening-to-existing-events"},{level:3,title:"Registering a Listener",slug:"registering-a-listener"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Best Security Practices",frontmatter:{},regularPath:"/master/advanced/security-practice.html",relativePath:"master/advanced/security-practice.md",key:"v-a79c52ca",path:"/master/advanced/security-practice.html",headers:[{level:2,title:"Software Updates",slug:"software-updates"},{level:2,title:"Limiting Error Messages",slug:"limiting-error-messages"},{level:2,title:"Limiting Admin Access",slug:"limiting-admin-access"},{level:2,title:"Restricting Unnecessary Files",slug:"restricting-unnecessary-files"},{level:2,title:"Restricting PHP Execution Inside Storage",slug:"restricting-php-execution-inside-storage"},{level:2,title:"Server Hardening",slug:"server-hardening"},{level:2,title:"Strong Passwords",slug:"strong-passwords"},{level:2,title:"Implementation of HTTP Security Headers",slug:"implementation-of-http-security-headers"},{level:3,title:"HTTP Strict Transport Security (HSTS)",slug:"http-strict-transport-security-hsts"},{level:3,title:"Cross-Site Scripting Protection (X-XSS Protection)",slug:"cross-site-scripting-protection-x-xss-protection"},{level:3,title:"X-Frame-Options​",slug:"x-frame-options​"},{level:3,title:"X-Content-Type-Options​",slug:"x-content-type-options​"},{level:3,title:"Content Security Policy (CSP)",slug:"content-security-policy-csp"},{level:3,title:"Continuous Logging And Monitoring",slug:"continuous-logging-and-monitoring"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Krayin APIs",frontmatter:{},regularPath:"/master/api/",relativePath:"master/api/README.md",key:"v-75c7df60",path:"/master/api/",headers:[{level:2,title:"REST API",slug:"rest-api"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Krayin APIs",frontmatter:{},regularPath:"/master/api/getting-started-with-the-api.html",relativePath:"master/api/getting-started-with-the-api.md",key:"v-f2f6664a",path:"/master/api/getting-started-with-the-api.html",headers:[{level:2,title:"REST API",slug:"rest-api"},{level:2,title:"Explore REST API Demo",slug:"explore-rest-api-demo"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Architecture concepts",frontmatter:{},regularPath:"/master/architecture/",relativePath:"master/architecture/README.md",key:"v-5b513a44",path:"/master/architecture/",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Modular Design in Krayin",frontmatter:{},regularPath:"/master/architecture/modular-design.html",relativePath:"master/architecture/modular-design.md",key:"v-3d6730e7",path:"/master/architecture/modular-design.html",headers:[{level:2,title:"Key Benefits of Modular Design",slug:"key-benefits-of-modular-design"},{level:2,title:"Module Structure in Krayin",slug:"module-structure-in-krayin"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Packages",frontmatter:{},regularPath:"/master/architecture/packages.html",relativePath:"master/architecture/packages.md",key:"v-50c09862",path:"/master/architecture/packages.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Available Packages In Krayin",slug:"available-packages-in-krayin"},{level:3,title:"Admin",slug:"admin"},{level:3,title:"Activity",slug:"activity"},{level:3,title:"Attribute",slug:"attribute"},{level:3,title:"Contact",slug:"contact"},{level:3,title:"Core",slug:"core"},{level:3,title:"Email",slug:"email"},{level:3,title:"EmailTemplate",slug:"emailtemplate"},{level:3,title:"Installer",slug:"installer"},{level:3,title:"Lead",slug:"lead"},{level:3,title:"Product",slug:"product"},{level:3,title:"Quote",slug:"quote"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"User",slug:"user"},{level:3,title:"WebForm",slug:"webform"},{level:3,title:"Automation",slug:"automation"},{level:3,title:"Datagrid",slug:"datagrid"},{level:3,title:"Warehouse",slug:"warehouse"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Theme",frontmatter:{},regularPath:"/master/architecture/theme.html",relativePath:"master/architecture/theme.md",key:"v-82f3414a",path:"/master/architecture/theme.html",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Repository Pattern in Krayin",frontmatter:{},regularPath:"/master/architecture/repository-pattern.html",relativePath:"master/architecture/repository-pattern.md",key:"v-38093e8f",path:"/master/architecture/repository-pattern.html",headers:[{level:3,title:"Benefits of the Repository Pattern",slug:"benefits-of-the-repository-pattern"},{level:3,title:"Implementation in Krayin",slug:"implementation-in-krayin"},{level:2,title:"Eloquent ORM",slug:"eloquent-orm"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Custom Attribute Creation",frontmatter:{},regularPath:"/master/custom-attributes/",relativePath:"master/custom-attributes/README.md",key:"v-19fa9c70",path:"/master/custom-attributes/",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Create and using a new attribute",frontmatter:{},regularPath:"/master/custom-attributes/uses.html",relativePath:"master/custom-attributes/uses.md",key:"v-3e7871fb",path:"/master/custom-attributes/uses.html",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Use model with custom Attributes",frontmatter:{},regularPath:"/master/custom-attributes/custom-attribute.html",relativePath:"master/custom-attributes/custom-attribute.md",key:"v-11d2520a",path:"/master/custom-attributes/custom-attribute.html",lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Introduction",frontmatter:{},regularPath:"/master/introduction/",relativePath:"master/introduction/README.md",key:"v-102d7560",path:"/master/introduction/",headers:[{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Docker",frontmatter:{},regularPath:"/master/introduction/docker.html",relativePath:"master/introduction/docker.md",key:"v-29ba2c92",path:"/master/introduction/docker.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Docker Setup for Krayin",slug:"docker-setup-for-krayin"},{level:3,title:"1. Using Krayin Docker Image from Docker Hub",slug:"_1-using-krayin-docker-image-from-docker-hub"},{level:3,title:"2. Using Krayin GitHub Docker Repository",slug:"_2-using-krayin-github-docker-repository"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Installation",frontmatter:{},regularPath:"/master/introduction/installation.html",relativePath:"master/introduction/installation.md",key:"v-4ad03c83",path:"/master/introduction/installation.html",headers:[{level:2,title:"Install Using GUI Installer",slug:"install-using-gui-installer"},{level:2,title:"Install Using Composer",slug:"install-using-composer"},{level:2,title:"Start Using Krayin",slug:"start-using-krayin"},{level:3,title:"On a Production Server",slug:"on-a-production-server"},{level:3,title:"On Your Local Server",slug:"on-your-local-server"},{level:3,title:"Login as an Admin",slug:"login-as-an-admin"},{level:3,title:"Contributing",slug:"contributing"},{level:3,title:"License",slug:"license"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Package Development",frontmatter:{},regularPath:"/master/packages/",relativePath:"master/packages/README.md",key:"v-94b795ac",path:"/master/packages/",headers:[{level:2,title:"Package Development",slug:"package-development"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Menu",frontmatter:{},regularPath:"/master/packages/add-menu-in-admin.html",relativePath:"master/packages/add-menu-in-admin.md",key:"v-5516a1ca",path:"/master/packages/add-menu-in-admin.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Configure the menu",slug:"configure-the-menu"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define Menu Items",slug:"define-menu-items"},{level:3,title:"Define Routes",slug:"define-routes"},{level:3,title:"Add Menu Icon",slug:"add-menu-icon"},{level:3,title:"Merge Configuration",slug:"merge-configuration"},{level:3,title:"Optimize Application",slug:"optimize-application"},{level:2,title:"Level of Menu",slug:"level-of-menu"},{level:3,title:"First Level (Sidebar)",slug:"first-level-sidebar"},{level:3,title:"Second Level (Hover Menu)",slug:"second-level-hover-menu"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Bundling Assets",frontmatter:{},regularPath:"/master/packages/assets.html",relativePath:"master/packages/assets.md",key:"v-49e9b357",path:"/master/packages/assets.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:2,title:"Configure Compiling Assets",slug:"configure-compiling-assets"},{level:2,title:"Create Configuration Files",slug:"create-configuration-files"},{level:3,title:"Set Up package.json",slug:"set-up-package-json"},{level:3,title:"Set Up webpack.mix.js",slug:"set-up-webpack-mix-js"},{level:3,title:"Importing Laravel Mix",slug:"importing-laravel-mix"},{level:3,title:"Merging Manifests",slug:"merging-manifests"},{level:3,title:"Setting the Public Path",slug:"setting-the-public-path"},{level:3,title:"Mix Configuration",slug:"mix-configuration"},{level:3,title:"Asset Compilation",slug:"asset-compilation"},{level:3,title:"Webpack Configuration",slug:"webpack-configuration"},{level:3,title:"Source Maps",slug:"source-maps"},{level:3,title:"Versioning",slug:"versioning"},{level:2,title:"Load Assets in Blade File",slug:"load-assets-in-blade-file"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Requirements",frontmatter:{},regularPath:"/master/introduction/requirements.html",relativePath:"master/introduction/requirements.md",key:"v-7b128352",path:"/master/introduction/requirements.html",headers:[{level:2,title:"Server configuration",slug:"server-configuration"},{level:2,title:"PHP Extensions",slug:"php-extensions"},{level:2,title:"PHP Configuration",slug:"php-configuration"},{level:2,title:"Supported Database Servers",slug:"supported-database-servers"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Controller",frontmatter:{},regularPath:"/master/packages/controllers.html",relativePath:"master/packages/controllers.md",key:"v-2d59775b",path:"/master/packages/controllers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"How to create Controllers",slug:"how-to-create-controllers"},{level:3,title:"Directory Structure",slug:"directory-structure"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Blade Components",frontmatter:{},regularPath:"/master/packages/blade-components.html",relativePath:"master/packages/blade-components.md",key:"v-68450b87",path:"/master/packages/blade-components.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Components",slug:"components"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"Avatar",slug:"avatar"},{level:3,title:"Activities",slug:"activities"},{level:3,title:"Lookup",slug:"lookup"},{level:3,title:"Attachment",slug:"attachment"},{level:3,title:"Inline Editable",slug:"inline-editable"},{level:3,title:"Accordion",slug:"accordion"},{level:3,title:"Button",slug:"button"},{level:3,title:"Drawer",slug:"drawer"},{level:3,title:"Dropdown",slug:"dropdown"},{level:3,title:"Flat-Picker",slug:"flat-picker"},{level:3,title:"Data Grid",slug:"data-grid"},{level:3,title:"Tinymce",slug:"tinymce"},{level:3,title:"Shimmer",slug:"shimmer"},{level:3,title:"Table",slug:"table"},{level:3,title:"Modal",slug:"modal"},{level:3,title:"Tree",slug:"tree"},{level:3,title:"Media",slug:"media"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Access Control List",frontmatter:{},regularPath:"/master/packages/create-acl.html",relativePath:"master/packages/create-acl.md",key:"v-c13ca42a",path:"/master/packages/create-acl.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define ACL Configuration",slug:"define-acl-configuration"},{level:2,title:"Merge ACL Configuration",slug:"merge-acl-configuration"},{level:3,title:"Modify Service Provider",slug:"modify-service-provider"},{level:3,title:"Register Method",slug:"register-method"},{level:3,title:"Clear Configuration Cache",slug:"clear-configuration-cache"},{level:3,title:"Verify in Admin Panel",slug:"verify-in-admin-panel"},{level:2,title:"Checking Roles and Permissions",slug:"checking-roles-and-permissions"},{level:3,title:"Access Roles",slug:"access-roles"},{level:3,title:"Permission Checks",slug:"permission-checks"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Migrations",frontmatter:{},regularPath:"/master/packages/create-migrations.html",relativePath:"master/packages/create-migrations.md",key:"v-77bdaafb",path:"/master/packages/create-migrations.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Loading Migration from Package",slug:"loading-migration-from-package"},{level:3,title:"Creating Tables from Migrations",slug:"creating-tables-from-migrations"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Models",frontmatter:{},regularPath:"/master/packages/create-models.html",relativePath:"master/packages/create-models.md",key:"v-f028604a",path:"/master/packages/create-models.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Create the Contract",slug:"create-the-contract"},{level:3,title:"Create the Proxy",slug:"create-the-proxy"},{level:3,title:"Create the Model",slug:"create-the-model"},{level:3,title:"Create Module Service Provider",slug:"create-module-service-provider"},{level:3,title:"Registering ModuleServiceProvider",slug:"registering-moduleserviceprovider"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"DataGrid",frontmatter:{},regularPath:"/master/packages/datagrid.html",relativePath:"master/packages/datagrid.md",key:"v-0b718b3d",path:"/master/packages/datagrid.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Global Properties of DataGrid",slug:"global-properties-of-datagrid"},{level:2,title:"How DataGrid Works",slug:"how-datagrid-works"},{level:2,title:"Multiple DataGrids",slug:"multiple-datagrids"},{level:3,title:"DataGrid to JSON",slug:"datagrid-to-json"},{level:3,title:"Render DataGrid",slug:"render-datagrid"},{level:2,title:"Sample DataGrid",slug:"sample-datagrid"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Layouts",frontmatter:{},regularPath:"/master/packages/layouts.html",relativePath:"master/packages/layouts.md",key:"v-066aec9b",path:"/master/packages/layouts.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Category Layout",slug:"category-layout"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Getting Started",frontmatter:{},regularPath:"/master/packages/create-package.html",relativePath:"master/packages/create-package.md",key:"v-03cb4f1a",path:"/master/packages/create-package.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Registering Your Package",slug:"registering-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands"},{level:2,title:"Manual Setup of Files",slug:"manual-setup-of-files"},{level:3,title:"Create Package Directory",slug:"create-package-directory"},{level:3,title:"Create Service Provider",slug:"create-service-provider"},{level:3,title:"Register Your Package",slug:"register-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands-2"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Routes",frontmatter:{},regularPath:"/master/packages/routes.html",relativePath:"master/packages/routes.md",key:"v-0142f749",path:"/master/packages/routes.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Create a new Route",slug:"create-a-new-route"},{level:3,title:"Routes",slug:"routes-2"},{level:2,title:"Loading Routes",slug:"loading-routes"},{level:3,title:"Register Routes in ServiceProvider",slug:"register-routes-in-serviceprovider"},{level:2,title:"Available HTTP methods",slug:"available-http-methods"},{level:3,title:"GET",slug:"get"},{level:3,title:"POST",slug:"post"},{level:3,title:"PUT",slug:"put"},{level:3,title:"DELETE",slug:"delete"},{level:3,title:"PATCH",slug:"patch"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Localization",frontmatter:{},regularPath:"/master/packages/localization.html",relativePath:"master/packages/localization.md",key:"v-3e3a5dab",path:"/master/packages/localization.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Publishing the Language Files",slug:"publishing-the-language-files"},{level:2,title:"Configuring the Locale",slug:"configuring-the-locale"},{level:2,title:"Create a new Locale",slug:"create-a-new-locale"},{level:3,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Writing a Translation in app.php",slug:"writing-a-translation-in-app-php"},{level:2,title:"Load Translation from Package",slug:"load-translation-from-package"},{level:3,title:"Update the Service Provider",slug:"update-the-service-provider"},{level:3,title:"Use Translations in Blade Files",slug:"use-translations-in-blade-files"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Validation",frontmatter:{},regularPath:"/master/packages/validation.html",relativePath:"master/packages/validation.md",key:"v-4ac4bd6b",path:"/master/packages/validation.html",headers:[{level:2,title:"Validation Using Laravel",slug:"validation-using-laravel"},{level:3,title:"Introduction",slug:"introduction"},{level:3,title:"Usage",slug:"usage"},{level:2,title:"Validation Using Vue",slug:"validation-using-vue"},{level:3,title:"Introduction",slug:"introduction-2"},{level:3,title:"Installation",slug:"installation"},{level:3,title:"Configuration",slug:"configuration"},{level:3,title:"Examples",slug:"examples"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Prologue",frontmatter:{},regularPath:"/master/prologue/",relativePath:"master/prologue/README.md",key:"v-24913d76",path:"/master/prologue/",headers:[{level:2,title:"Introduction to Krayin",slug:"introduction-to-krayin"},{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Repositories",frontmatter:{},regularPath:"/master/packages/store-data-through-repositories.html",relativePath:"master/packages/store-data-through-repositories.md",key:"v-c1dbb14a",path:"/master/packages/store-data-through-repositories.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Dependency Injection",slug:"dependency-injection"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Create a New Repository Class",slug:"create-a-new-repository-class"},{level:3,title:"Explanation",slug:"explanation"},{level:2,title:"Manually Setting Up Repository Files",slug:"manually-setting-up-repository-files"},{level:3,title:"Setting Up CategoryRepository in Webkul/Category Package",slug:"setting-up-categoryrepository-in-webkul-category-package"},{level:2,title:"Available Methods",slug:"available-methods"},{level:3,title:"all",slug:"all"},{level:3,title:"Find",slug:"find"},{level:3,title:"FindOrFail",slug:"findorfail"},{level:3,title:"Create",slug:"create"},{level:3,title:"Update",slug:"update"},{level:3,title:"Delete",slug:"delete"},{level:3,title:"Paginate",slug:"paginate"},{level:3,title:"FindWhere",slug:"findwhere"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Views",frontmatter:{},regularPath:"/master/packages/views.html",relativePath:"master/packages/views.md",key:"v-2b0dbf0a",path:"/master/packages/views.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Adding HTML Content",slug:"adding-html-content"},{level:2,title:"Load Views from Package",slug:"load-views-from-package"},{level:2,title:"Rendering Views",slug:"rendering-views"},{level:2,title:"Blade File Naming Convention",slug:"blade-file-naming-convention"},{level:3,title:"Listing (Index Blade):",slug:"listing-index-blade"},{level:3,title:"Creation (Create Blade):",slug:"creation-create-blade"},{level:3,title:"Updating (Edit Blade):",slug:"updating-edit-blade"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Contribution Guide",frontmatter:{},regularPath:"/master/prologue/contribution-guide.html",relativePath:"master/prologue/contribution-guide.md",key:"v-c4ee6cda",path:"/master/prologue/contribution-guide.html",headers:[{level:2,title:"Bug Reports",slug:"bug-reports"},{level:2,title:"Projects to Contribute",slug:"projects-to-contribute"},{level:2,title:"Feature Requests",slug:"feature-requests"},{level:2,title:"Branch Selection",slug:"branch-selection"},{level:2,title:"Compiled Assets",slug:"compiled-assets"},{level:2,title:"Tailwind Class Reordering",slug:"tailwind-class-reordering"},{level:2,title:"Pint Tests",slug:"pint-tests"},{level:2,title:"Security Vulnerabilities",slug:"security-vulnerabilities"},{level:2,title:"Coding Style",slug:"coding-style"},{level:2,title:"PHPDoc",slug:"phpdoc"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3},{title:"Upgrade Guide",frontmatter:{},regularPath:"/master/prologue/upgrade-guide.html",relativePath:"master/prologue/upgrade-guide.md",key:"v-71ef02ca",path:"/master/prologue/upgrade-guide.html",headers:[{level:2,title:"Upgrade Steps",slug:"upgrade-steps"},{level:2,title:"Composer Dependencies",slug:"composer-dependencies"},{level:3,title:"Differences in Composer Dependencies",slug:"differences-in-composer-dependencies"},{level:3,title:"Differences in Development Dependencies",slug:"differences-in-development-dependencies"},{level:3,title:"Differences in Autoloading",slug:"differences-in-autoloading"},{level:3,title:"Summary of Changes",slug:"summary-of-changes"},{level:3,title:"Upgrade Instructions",slug:"upgrade-instructions"},{level:3,title:"Conclusion",slug:"conclusion"}],lastUpdated:"10/23/2024, 8:16:05 AM",lastUpdatedTimestamp:1729671365e3}],themeConfig:{smoothScroll:!0,lastUpdated:"Last Updated",repo:"krayin/laravel-crm",repoLabel:"Contribute to Krayin CRM",docsRepo:"krayin/krayin-docs",docsDir:"docs",docsBranch:"master",editLinks:!0,editLinkText:"Help us improve this page on Github.",logo:"/logo.svg",nav:[{text:"Home",link:"/"},{text:"User Guide",link:"https://docs.krayincrm.com/"},{text:"Community Forum",link:"https://forums.krayincrm.com/"}],contactUs:{text:"Contact Us",link:"https://krayincrm.com/contacts/"},sidebar:{"/1.x/":[{title:"Introduction",path:"/1.x/introduction",collapsable:!0,children:[["/1.x/introduction/requirements","Requirements"],["/1.x/introduction/installation","Installation"]]},{title:"Architecture concepts",path:"/1.x/architecture",collapsable:!0,children:[["/1.x/architecture/packages","Packages"],["/1.x/architecture/repository-pattern","Repository Pattern"],["/1.x/architecture/modular-design","Modular Design"]]},{title:"Package Development",path:"/1.x/packages",collapsable:!0,children:[["/1.x/packages/create-package","Getting Started"],["/1.x/packages/create-migrations","Migrations"],["/1.x/packages/create-models","Models"],["/1.x/packages/store-data-through-repositories","Repository"],["/1.x/packages/routes","Routes"],["/1.x/packages/controllers","Controllers"],["/1.x/packages/views","Views"],["/1.x/packages/localization","Localization"],["/1.x/packages/layouts","Layouts"],["/1.x/packages/assets","Assets"],["/1.x/packages/add-menu-in-admin","Admin Menu"],["/1.x/packages/validation","Validation"],["/1.x/packages/datagrid","DataGrid"],["/1.x/packages/create-acl","Access Control List"]]},{title:"Digging Deeper",path:"/1.x/advanced",collapsable:!0,children:[["/1.x/advanced/events","Events Listeners"],["/1.x/advanced/helpers","Helpers"],["/1.x/advanced/override-core-model","Override Core Models"],["/1.x/advanced/render-event","View Render Event"],["/1.x/advanced/security-practice","Best Security Practices"],["/1.x/advanced/email-inbound-parse"," Email Inbound Parse"]]},{title:"Custom Attributes",path:"/1.x/custom-attributes",collapsable:!0,children:[["/1.x/custom-attributes/custom-attribute","Make Model With Custom Attribute"],["/1.x/custom-attributes/uses","How to use custom attribute"]]},{title:"Krayin APIs",path:"/1.x/api",collapsable:!0,children:[["/1.x/api/getting-started-with-the-api","Rest API"]]}],"/2.0/":[{title:"Prologue",path:"/2.0/prologue",collapsable:!0,children:[["/2.0/prologue/upgrade-guide","Upgrade Guide"],["/2.0/prologue/contribution-guide"," Contribution Guide"]]},{title:"Introduction",path:"/2.0/introduction",collapsable:!0,children:[["/2.0/introduction/requirements","Requirements"],["/2.0/introduction/installation","Installation"],["/2.0/introduction/docker","Docker"]]},{title:"Architecture concepts",path:"/2.0/architecture",collapsable:!0,children:[["/2.0/architecture/packages","Packages"],["/2.0/architecture/repository-pattern","Repository Pattern"],["/2.0/architecture/modular-design","Modular Design"]]},{title:"Package Development",path:"/2.0/packages",collapsable:!0,children:[["/2.0/packages/create-package","Getting Started"],["/2.0/packages/create-migrations","Migrations"],["/2.0/packages/create-models","Models"],["/2.0/packages/store-data-through-repositories","Repository"],["/2.0/packages/routes","Routes"],["/2.0/packages/controllers","Controllers"],["/2.0/packages/views","Views"],["/2.0/packages/localization","Localization"],["/2.0/packages/blade-components","Blade Components"],["/2.0/packages/layouts","Layouts"],["/2.0/packages/assets","Assets"],["/2.0/packages/add-menu-in-admin","Admin Menu"],["/2.0/packages/validation","Validation"],["/2.0/packages/datagrid","DataGrid"],["/2.0/packages/create-acl","Access Control List"]]},{title:"Digging Deeper",path:"/2.0/advanced",collapsable:!0,children:[["/2.0/advanced/events","Events Listeners"],["/2.0/advanced/helpers","Helpers"],["/2.0/advanced/override-core-model","Override Core Models"],["/2.0/advanced/render-event","View Render Event"],["/2.0/advanced/security-practice","Best Security Practices"],["/2.0/advanced/email-inbound-parse"," Email Inbound Parse"]]},{title:"Custom Attributes",path:"/2.0/custom-attributes",collapsable:!0,children:[["/2.0/custom-attributes/custom-attribute","Make Model With Custom Attribute"],["/2.0/custom-attributes/uses","How to use custom attribute"]]},{title:"Krayin APIs",path:"/2.0/api",collapsable:!0,children:[["/2.0/api/getting-started-with-the-api","Rest API"]]}],"/master/":[{title:"Prologue",path:"/master/prologue",collapsable:!0,children:[["/master/prologue/upgrade-guide","Upgrade Guide"],["/master/prologue/contribution-guide"," Contribution Guide"]]},{title:"Introduction",path:"/master/introduction",collapsable:!0,children:[["/master/introduction/requirements","Requirements"],["/master/introduction/installation","Installation"],["/master/introduction/docker","Docker"]]},{title:"Architecture concepts",path:"/master/architecture",collapsable:!0,children:[["/master/architecture/packages","Packages"],["/master/architecture/repository-pattern","Repository Pattern"],["/master/architecture/modular-design","Modular Design"]]},{title:"Package Development",path:"/master/packages",collapsable:!0,children:[["/master/packages/create-package","Getting Started"],["/master/packages/create-migrations","Migrations"],["/master/packages/create-models","Models"],["/master/packages/store-data-through-repositories","Repository"],["/master/packages/routes","Routes"],["/master/packages/controllers","Controllers"],["/master/packages/views","Views"],["/master/packages/localization","Localization"],["/master/packages/blade-components","Blade Components"],["/master/packages/layouts","Layouts"],["/master/packages/assets","Assets"],["/master/packages/add-menu-in-admin","Admin Menu"],["/master/packages/validation","Validation"],["/master/packages/datagrid","DataGrid"],["/master/packages/create-acl","Access Control List"]]},{title:"Digging Deeper",path:"/master/advanced",collapsable:!0,children:[["/master/advanced/events","Events Listeners"],["/master/advanced/helpers","Helpers"],["/master/advanced/override-core-model","Override Core Models"],["/master/advanced/render-event","View Render Event"],["/master/advanced/security-practice","Best Security Practices"],["/master/advanced/email-inbound-parse"," Email Inbound Parse"],["/master/advanced/data-transfer","Data Transfer"]]},{title:"Custom Attributes",path:"/master/custom-attributes",collapsable:!0,children:[["/master/custom-attributes/custom-attribute","Make Model With Custom Attribute"],["/master/custom-attributes/uses","How to use custom attribute"]]},{title:"Krayin APIs",path:"/master/api",collapsable:!0,children:[["/master/api/getting-started-with-the-api","Rest API"]]}]}}};n(239);qn.component("Badge",()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,319)));n(240),n(241);function Fl(e){const t=document.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return{x:n.left-t.left,y:n.top-t.top}}class Bl{constructor(e){Object.defineProperty(this,"registration",{value:e,configurable:!0,writable:!0})}update(){return this.registration.update()}skipWaiting(){const e=this.registration.waiting;return e?(console.log("[vuepress:sw] Doing worker.skipWaiting()."),new Promise((t,n)=>{const r=new MessageChannel;r.port1.onmessage=e=>{console.log("[vuepress:sw] Done worker.skipWaiting()."),e.data.error?n(e.data.error):t(e.data)},e.postMessage({type:"skip-waiting"},[r.port2])})):Promise.resolve()}}var Nl=new qn;var Hl={name:"BackToTop",props:{threshold:{type:Number,default:300}},data:()=>({scrollTop:null}),computed:{show(){return this.scrollTop>this.threshold}},mounted(){this.scrollTop=this.getScrollTop(),window.addEventListener("scroll",Pl()(()=>{this.scrollTop=this.getScrollTop()},100))},methods:{getScrollTop:()=>window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,scrollToTop(){window.scrollTo({top:0,behavior:"smooth"}),this.scrollTop=0}}},Vl=(n(242),Object($l.a)(Hl,(function(){var e=this._self._c;return e("transition",{attrs:{name:"fade"}},[this.show?e("svg",{staticClass:"go-to-top",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 49.484 28.284"},on:{click:this.scrollToTop}},[e("g",{attrs:{transform:"translate(-229 -126.358)"}},[e("rect",{attrs:{fill:"currentColor",width:"35",height:"5",rx:"2",transform:"translate(229 151.107) rotate(-45)"}}),this._v(" "),e("rect",{attrs:{fill:"currentColor",width:"35",height:"5",rx:"2",transform:"translate(274.949 154.642) rotate(-135)"}})])]):this._e()])}),[],!1,null,"5fd4ef0c",null).exports),zl=[{},({Vue:e})=>{e.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},({Vue:e,router:t})=>{t.options.scrollBehavior=(t,n,r)=>{if(r)return window.scrollTo({top:r.y,behavior:"smooth"});if(t.hash){if(e.$vuepress.$get("disableScrollBehavior"))return!1;const n=document.querySelector(t.hash);return!!n&&window.scrollTo({top:Fl(n).y,behavior:"smooth"})}return window.scrollTo({top:0,behavior:"smooth"})}},async({router:e,isServer:t})=>{if(!t){const{register:t}=await n.e(138).then(n.bind(null,313));e.onReady(()=>{t("/service-worker.js",{registrationOptions:{},ready(){console.log("[vuepress:sw] Service worker is active."),Nl.$emit("sw-ready")},cached(e){console.log("[vuepress:sw] Content has been cached for offline use."),Nl.$emit("sw-cached",new Bl(e))},updated(e){console.log("[vuepress:sw] Content updated."),Nl.$emit("sw-updated",new Bl(e))},offline(){console.log("[vuepress:sw] No internet connection found. App is running in offline mode."),Nl.$emit("sw-offline")},error(e){console.error("[vuepress:sw] Error during service worker registration:",e),Nl.$emit("sw-error",e),GA_ID&&ga("send","exception",{exDescription:e.message,exFatal:!1})}})})}},({Vue:e})=>{e.component("BackToTop",Vl)}],Gl=["BackToTop"];class Kl extends class{constructor(){this.store=new qn({data:{state:{}}})}$get(e){return this.store.state[e]}$set(e,t){qn.set(this.store.state,e,t)}$emit(...e){this.store.$emit(...e)}$on(...e){this.store.$on(...e)}}{}Object.assign(Kl.prototype,{getPageAsyncComponent:sl,getLayoutAsyncComponent:cl,getAsyncComponent:ul,getVueComponent:dl});var ql={install(e){const t=new Kl;e.$vuepress=t,e.prototype.$vuepress=t}};function Wl(e,t){const n=t.toLowerCase();return e.options.routes.some(e=>e.path.toLowerCase()===n)}var Xl={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(e){const t=this.pageKey||this.$parent.$page.key;return fl("pageKey",t),qn.component(t)||qn.component(t,sl(t)),qn.component(t)?e(t):e("")}},Yl={functional:!0,props:{slotKey:String,required:!0},render:(e,{props:t,slots:n})=>e("div",{class:["content__"+t.slotKey]},n()[t.slotKey])},Jl={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},Ql=(n(243),n(244),Object($l.a)(Jl,(function(){var e=this._self._c;return e("span",[e("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[e("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),e("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),e("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),Zl={functional:!0,render(e,{parent:t,children:n}){if(t._isMounted)return n;t.$once("hook:mounted",()=>{t.$forceUpdate()})}};qn.config.productionTip=!1,qn.use(Ko),qn.use(ql),qn.mixin(function(e,t,n=qn){!function(e){e.locales&&Object.keys(e.locales).forEach(t=>{e.locales[t].path=t});Object.freeze(e)}(t),n.$vuepress.$set("siteData",t);const r=new(e(n.$vuepress.$get("siteData"))),a=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(r)),i={};return Object.keys(a).reduce((e,t)=>(t.startsWith("$")&&(e[t]=a[t].get),e),i),{computed:i}}(e=>class{setPage(e){this.__page=e}get $site(){return e}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:e={}}=this.$site;let t,n;for(const r in e)"/"===r?n=e[r]:0===this.$page.path.indexOf(r)&&(t=e[r]);return t||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:e}=this.$page.frontmatter;return"string"==typeof e&&e}get $title(){const e=this.$page,{metaTitle:t}=this.$page.frontmatter;if("string"==typeof t)return t;const n=this.$siteTitle,r=e.frontmatter.home?null:e.frontmatter.title||e.title;return n?r?r+" | "+n:n:r||"VuePress"}get $description(){const e=function(e){if(e){const t=e.filter(e=>"description"===e.name)[0];if(t)return t.content}}(this.$page.frontmatter.meta);return e||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}get $lang(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}get $localePath(){return this.$localeConfig.path||"/"}get $themeLocaleConfig(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}get $page(){return this.__page?this.__page:function(e,t){for(let n=0;nn||(e.hash?!qn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(e.hash)}:{x:0,y:0})});!function(e){e.beforeEach((t,n,r)=>{if(Wl(e,t.path))r();else if(/(\/|\.html)$/.test(t.path))if(/\/$/.test(t.path)){const n=t.path.replace(/\/$/,"")+".html";Wl(e,n)?r(n):r()}else r();else{const n=t.path+"/",a=t.path+".html";Wl(e,a)?r(a):Wl(e,n)?r(n):r()}})}(n);const r={};try{await Promise.all(zl.filter(e=>"function"==typeof e).map(t=>t({Vue:qn,options:r,router:n,siteData:Dl,isServer:e})))}catch(e){console.error(e)}return{app:new qn(Object.assign(r,{router:n,render:e=>e("div",{attrs:{id:"app"}},[e("RouterView",{ref:"layout"}),e("div",{class:"global-ui"},Gl.map(t=>e(t)))])})),router:n}}(!1).then(({app:e,router:t})=>{t.onReady(()=>{e.$mount("#app")})})}]); \ No newline at end of file +var r=Object.freeze({}),a=Array.isArray;function i(e){return null==e}function o(e){return null!=e}function l(e){return!0===e}function s(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function c(e){return"function"==typeof e}function u(e){return null!==e&&"object"==typeof e}var d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function f(e){return"[object RegExp]"===d.call(e)}function v(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function h(e){return o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function g(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===d?JSON.stringify(e,m,2):String(e)}function m(e,t){return t&&t.__v_isRef?t.value:t}function y(e){var t=parseFloat(e);return isNaN(t)?e:t}function b(e,t){for(var n=Object.create(null),r=e.split(","),a=0;a-1)return e.splice(r,1)}}var _=Object.prototype.hasOwnProperty;function w(e,t){return _.call(e,t)}function P(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var C=/-(\w)/g,E=P((function(e){return e.replace(C,(function(e,t){return t?t.toUpperCase():""}))})),S=P((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),A=/\B([A-Z])/g,T=P((function(e){return e.replace(A,"-$1").toLowerCase()}));var M=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function U(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function O(e,t){for(var n in t)e[n]=t[n];return e}function L(e){for(var t={},n=0;n0,Z=Y&&Y.indexOf("edge/")>0;Y&&Y.indexOf("android");var ee=Y&&/iphone|ipad|ipod|ios/.test(Y);Y&&/chrome\/\d+/.test(Y),Y&&/phantomjs/.test(Y);var te,ne=Y&&Y.match(/firefox\/(\d+)/),re={}.watch,ae=!1;if(X)try{var ie={};Object.defineProperty(ie,"passive",{get:function(){ae=!0}}),window.addEventListener("test-passive",null,ie)}catch(e){}var oe=function(){return void 0===te&&(te=!X&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),te},le=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(e){return"function"==typeof e&&/native code/.test(e.toString())}var ce,ue="undefined"!=typeof Symbol&&se(Symbol)&&"undefined"!=typeof Reflect&&se(Reflect.ownKeys);ce="undefined"!=typeof Set&&se(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var de=null;function pe(e){void 0===e&&(e=null),e||de&&de._scope.off(),de=e,e&&e._scope.on()}var fe=function(){function e(e,t,n,r,a,i,o,l){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=a,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=o,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=l,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),ve=function(e){void 0===e&&(e="");var t=new fe;return t.text=e,t.isComment=!0,t};function he(e){return new fe(void 0,void 0,void 0,String(e))}function ge(e){var t=new fe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}"function"==typeof SuppressedError&&SuppressedError;var me=0,ye=[],be=function(){function e(){this._pending=!1,this.id=me++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,ye.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){var t=this.subs.filter((function(e){return e}));for(var n=0,r=t.length;n0&&(Ye((c=e(c,"".concat(n||"","_").concat(r)))[0])&&Ye(d)&&(p[u]=he(d.text+c[0].text),c.shift()),p.push.apply(p,c)):s(c)?Ye(d)?p[u]=he(d.text+c):""!==c&&p.push(he(c)):Ye(c)&&Ye(d)?p[u]=he(d.text+c.text):(l(t._isVList)&&o(c.tag)&&i(c.key)&&o(n)&&(c.key="__vlist".concat(n,"_").concat(r,"__")),p.push(c)));return p}(e):void 0}function Ye(e){return o(e)&&o(e.text)&&!1===e.isComment}function Je(e,t){var n,r,i,l,s=null;if(a(e)||"string"==typeof e)for(s=new Array(e.length),n=0,r=e.length;n0,l=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(l&&a&&a!==r&&s===a.$key&&!o&&!a.$hasNormal)return a;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=gt(e,n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=mt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),K(i,"$stable",l),K(i,"$key",s),K(i,"$hasNormal",o),i}function gt(e,t,n,r){var i=function(){var t=de;pe(e);var n=arguments.length?r.apply(null,arguments):r({}),i=(n=n&&"object"==typeof n&&!a(n)?[n]:Xe(n))&&n[0];return pe(t),n&&(!i||1===n.length&&i.isComment&&!vt(i))?void 0:n};return r.proxy&&Object.defineProperty(t,n,{get:i,enumerable:!0,configurable:!0}),i}function mt(e,t){return function(){return e[t]}}function yt(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};K(t,"_v_attr_proxy",!0),bt(t,e.$attrs,r,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||bt(e._listenersProxy={},e.$listeners,r,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||xt(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:M(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return Be(e,t,n)}))}}}function bt(e,t,n,r,a){var i=!1;for(var o in t)o in e?t[o]!==n[o]&&(i=!0):(i=!0,kt(e,o,r,a));for(var o in e)o in t||(i=!0,delete e[o]);return i}function kt(e,t,n,r){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return n[r][t]}})}function xt(e,t){for(var n in t)e[n]=t[n];for(var n in e)n in t||delete e[n]}var _t=null;function wt(e,t){return(e.__esModule||ue&&"Module"===e[Symbol.toStringTag])&&(e=e.default),u(e)?t.extend(e):e}function Pt(e){if(a(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(cn=function(){return un.now()})}var dn=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function pn(){var e,t;for(sn=cn(),on=!0,tn.sort(dn),ln=0;lnln&&tn[n].id>e.id;)n--;tn.splice(n+1,0,e)}else tn.push(e);an||(an=!0,Ft(pn))}}function vn(e,t){if(e){for(var n=Object.create(null),r=ue?Reflect.ownKeys(e):Object.keys(e),a=0;a-1)if(i&&!w(a,"default"))o=!1;else if(""===o||o===T(e)){var s=Rn(String,a.type);(s<0||l-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function Jn(e,t){var n=e.cache,r=e.keys,a=e._vnode,i=e.$vnode;for(var o in n){var l=n[o];if(l){var s=l.name;s&&!t(s)&&Qn(n,o,r,a)}}i.componentOptions.children=void 0}function Qn(e,t,n,r){var a=e[t];!a||r&&a.tag===r.tag||a.componentInstance.$destroy(),e[t]=null,x(n,t)}qn.prototype._init=function(e){var t=this;t._uid=Gn++,t._isVue=!0,t.__v_skip=!0,t._scope=new He(!0),t._scope.parent=void 0,t._scope._vm=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var a=r.componentOptions;n.propsData=a.propsData,n._parentListeners=a.listeners,n._renderChildren=a.children,n._componentTag=a.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Mn(Kn(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._provided=n?n._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Xt(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,a=n&&n.context;e.$slots=pt(t._renderChildren,a),e.$scopedSlots=n?ht(e.$parent,n.data.scopedSlots,e.$slots):r,e._c=function(t,n,r,a){return Ct(e,t,n,r,a,!1)},e.$createElement=function(t,n,r,a){return Ct(e,t,n,r,a,!0)};var i=n&&n.data;Oe(e,"$attrs",i&&i.attrs||r,null,!0),Oe(e,"$listeners",t._parentListeners||r,null,!0)}(t),en(t,"beforeCreate",void 0,!1),function(e){var t=vn(e.$options.inject,e);t&&(Ae(!1),Object.keys(t).forEach((function(n){Oe(e,n,t[n])})),Ae(!0))}(t),Fn(t),function(e){var t=e.$options.provide;if(t){var n=c(t)?t.call(e):t;if(!u(n))return;for(var r=Ve(e),a=ue?Reflect.ownKeys(n):Object.keys(n),i=0;i1?U(n):n;for(var r=U(arguments,1),a='event handler for "'.concat(e,'"'),i=0,o=n.length;iparseInt(this.max)&&Qn(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Qn(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){Jn(e,(function(e){return Yn(t,e)}))})),this.$watch("exclude",(function(t){Jn(e,(function(e){return!Yn(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Pt(e),n=t&&t.componentOptions;if(n){var r=Xn(n),a=this.include,i=this.exclude;if(a&&(!r||!Yn(a,r))||i&&r&&Yn(i,r))return t;var o=this.cache,l=this.keys,s=null==t.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):t.key;o[s]?(t.componentInstance=o[s].componentInstance,x(l,s),l.push(s)):(this.vnodeToCache=t,this.keyToCache=s),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return V}};Object.defineProperty(e,"config",t),e.util={warn:wn,extend:O,mergeOptions:Mn,defineReactive:Oe},e.set=Le,e.delete=je,e.nextTick=Ft,e.observable=function(e){return Ue(e),e},e.options=Object.create(null),N.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,O(e.options.components,er),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=U(arguments,1);return n.unshift(this),c(e.install)?e.install.apply(e,n):c(e)&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Mn(this.options,e),this}}(e),Wn(e),function(e){N.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&p(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&c(n)&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(qn),Object.defineProperty(qn.prototype,"$isServer",{get:oe}),Object.defineProperty(qn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(qn,"FunctionalRenderContext",{value:hn}),qn.version="2.7.16";var tr=b("style,class"),nr=b("input,textarea,option,select,progress"),rr=b("contenteditable,draggable,spellcheck"),ar=b("events,caret,typing,plaintext-only"),ir=b("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),or="http://www.w3.org/1999/xlink",lr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},sr=function(e){return lr(e)?e.slice(6,e.length):""},cr=function(e){return null==e||!1===e};function ur(e){for(var t=e.data,n=e,r=e;o(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=dr(r.data,t));for(;o(n=n.parent);)n&&n.data&&(t=dr(t,n.data));return function(e,t){if(o(e)||o(t))return pr(e,fr(t));return""}(t.staticClass,t.class)}function dr(e,t){return{staticClass:pr(e.staticClass,t.staticClass),class:o(e.class)?[e.class,t.class]:t.class}}function pr(e,t){return e?t?e+" "+t:e:t||""}function fr(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,a=e.length;r-1?Ir(e,t,n):ir(t)?cr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):rr(t)?e.setAttribute(t,function(e,t){return cr(t)||"false"===t?"false":"contenteditable"===e&&ar(t)?t:"true"}(t,n)):lr(t)?cr(n)?e.removeAttributeNS(or,sr(t)):e.setAttributeNS(or,t,n):Ir(e,t,n)}function Ir(e,t,n){if(cr(n))e.removeAttribute(t);else{if(J&&!Q&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Dr={create:$r,update:$r};function Fr(e,t){var n=t.elm,r=t.data,a=e.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var l=ur(t),s=n._transitionClasses;o(s)&&(l=pr(l,fr(s))),l!==n._prevClass&&(n.setAttribute("class",l),n._prevClass=l)}}var Br,Nr={create:Fr,update:Fr};function Hr(e,t,n){var r=Br;return function a(){var i=t.apply(null,arguments);null!==i&&Gr(e,a,n,r)}}var Vr=Ut&&!(ne&&Number(ne[1])<=53);function zr(e,t,n,r){if(Vr){var a=sn,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=a||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Br.addEventListener(e,t,ae?{capture:n,passive:r}:n)}function Gr(e,t,n,r){(r||Br).removeEventListener(e,t._wrapper||t,n)}function Kr(e,t){if(!i(e.data.on)||!i(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Br=t.elm||e.elm,function(e){if(o(e.__r)){var t=J?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}o(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),Ke(n,r,zr,Gr,Hr,t.context),Br=void 0}}var qr,Wr={create:Kr,update:Kr,destroy:function(e){return Kr(e,Pr)}};function Xr(e,t){if(!i(e.data.domProps)||!i(t.data.domProps)){var n,r,a=t.elm,s=e.data.domProps||{},c=t.data.domProps||{};for(n in(o(c.__ob__)||l(c._v_attr_proxy))&&(c=t.data.domProps=O({},c)),s)n in c||(a[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var u=i(r)?"":String(r);Yr(a,u)&&(a.value=u)}else if("innerHTML"===n&&gr(a.tagName)&&i(a.innerHTML)){(qr=qr||document.createElement("div")).innerHTML="".concat(r,"");for(var d=qr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;d.firstChild;)a.appendChild(d.firstChild)}else if(r!==s[n])try{a[n]=r}catch(e){}}}}function Yr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(o(r)){if(r.number)return y(n)!==y(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var Jr={create:Xr,update:Xr},Qr=P((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function Zr(e){var t=ea(e.style);return e.staticStyle?O(e.staticStyle,t):t}function ea(e){return Array.isArray(e)?L(e):"string"==typeof e?Qr(e):e}var ta,na=/^--/,ra=/\s*!important$/,aa=function(e,t,n){if(na.test(t))e.style.setProperty(t,n);else if(ra.test(n))e.style.setProperty(T(t),n.replace(ra,""),"important");else{var r=oa(t);if(Array.isArray(n))for(var a=0,i=n.length;a-1?t.split(ca).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" ".concat(e.getAttribute("class")||""," ");n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function da(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(ca).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" ".concat(e.getAttribute("class")||""," "),r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function pa(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&O(t,fa(e.name||"v")),O(t,e),t}return"string"==typeof e?fa(e):void 0}}var fa=P((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),va=X&&!Q,ha="transition",ma="transitionend",ya="animation",ba="animationend";va&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ha="WebkitTransition",ma="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ya="WebkitAnimation",ba="webkitAnimationEnd"));var ka=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function xa(e){ka((function(){ka(e)}))}function _a(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ua(e,t))}function wa(e,t){e._transitionClasses&&x(e._transitionClasses,t),da(e,t)}function Pa(e,t,n){var r=Ea(e,t),a=r.type,i=r.timeout,o=r.propCount;if(!a)return n();var l="transition"===a?ma:ba,s=0,c=function(){e.removeEventListener(l,u),n()},u=function(t){t.target===e&&++s>=o&&c()};setTimeout((function(){s0&&(n="transition",u=o,d=i.length):"animation"===t?c>0&&(n="animation",u=c,d=s.length):d=(n=(u=Math.max(o,c))>0?o>c?"transition":"animation":null)?"transition"===n?i.length:s.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&Ca.test(r[ha+"Property"])}}function Sa(e,t){for(;e.length1}function La(e,t){!0!==t.data.show&&Ta(t)}var ja=function(e){var t,n,r={},c=e.modules,u=e.nodeOps;for(t=0;tv?k(e,i(n[m+1])?null:n[m+1].elm,n,f,m,r):f>m&&_(t,d,v)}(d,h,m,n,c):o(m)?(o(e.text)&&u.setTextContent(d,""),k(d,null,m,0,m.length-1,n)):o(h)?_(h,0,h.length-1):o(e.text)&&u.setTextContent(d,""):e.text!==t.text&&u.setTextContent(d,t.text),o(v)&&o(f=v.hook)&&o(f=f.postpatch)&&f(e,t)}}}function E(e,t,n){if(l(n)&&o(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r-1,o.selected!==i&&(o.selected=i);else if(I(Fa(o),r))return void(e.selectedIndex!==l&&(e.selectedIndex=l));a||(e.selectedIndex=-1)}}function Da(e,t){return t.every((function(t){return!I(t,e)}))}function Fa(e){return"_value"in e?e._value:e.value}function Ba(e){e.target.composing=!0}function Na(e){e.target.composing&&(e.target.composing=!1,Ha(e.target,"input"))}function Ha(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Va(e){return!e.componentInstance||e.data&&e.data.transition?e:Va(e.componentInstance._vnode)}var za={model:$a,show:{bind:function(e,t,n){var r=t.value,a=(n=Va(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&a?(n.data.show=!0,Ta(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Va(n)).data&&n.data.transition?(n.data.show=!0,r?Ta(n,(function(){e.style.display=e.__vOriginalDisplay})):Ma(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,a){a||(e.style.display=e.__vOriginalDisplay)}}},Ga={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ka(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ka(Pt(t.children)):e}function qa(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var a=n._parentListeners;for(var r in a)t[E(r)]=a[r];return t}function Wa(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Xa=function(e){return e.tag||vt(e)},Ya=function(e){return"show"===e.name},Ja={name:"transition",props:Ga,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Xa)).length){0;var r=this.mode;0;var a=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return a;var i=Ka(a);if(!i)return a;if(this._leaving)return Wa(e,a);var o="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?o+"comment":o+i.tag:s(i.key)?0===String(i.key).indexOf(o)?i.key:o+i.key:i.key;var l=(i.data||(i.data={})).transition=qa(this),c=this._vnode,u=Ka(c);if(i.data.directives&&i.data.directives.some(Ya)&&(i.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,u)&&!vt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=O({},l);if("out-in"===r)return this._leaving=!0,qe(d,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Wa(e,a);if("in-out"===r){if(vt(i))return c;var p,f=function(){p()};qe(l,"afterEnter",f),qe(l,"enterCancelled",f),qe(d,"delayLeave",(function(e){p=e}))}}return a}}},Qa=O({tag:String,moveClass:String},Ga);function Za(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function ei(e){e.data.newPos=e.elm.getBoundingClientRect()}function ti(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,a=t.top-n.top;if(r||a){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(a,"px)"),i.transitionDuration="0s"}}delete Qa.mode;var ni={Transition:Ja,TransitionGroup:{props:Qa,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var a=Jt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,a(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,a=this.$slots.default||[],i=this.children=[],o=qa(this),l=0;l-1?yr[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:yr[e]=/HTMLUnknownElement/.test(t.toString())},O(qn.options.directives,za),O(qn.options.components,ni),qn.prototype.__patch__=X?ja:j,qn.prototype.$mount=function(e,t){return function(e,t,n){var r;e.$el=t,e.$options.render||(e.$options.render=ve),en(e,"beforeMount"),r=function(){e._update(e._render(),n)},new Gt(e,r,j,{before:function(){e._isMounted&&!e._isDestroyed&&en(e,"beforeUpdate")}},!0),n=!1;var a=e._preWatchers;if(a)for(var i=0;i=0&&(t=e.slice(r),e=e.slice(0,r));var a=e.indexOf("?");return a>=0&&(n=e.slice(a+1),e=e.slice(0,a)),{path:e,query:n,hash:t}}(a.path||""),c=t&&t.path||"/",u=s.path?wi(s.path,c,n||a.append):c,d=function(e,t,n){void 0===t&&(t={});var r,a=n||ui;try{r=a(e||"")}catch(e){r={}}for(var i in t){var o=t[i];r[i]=Array.isArray(o)?o.map(ci):ci(o)}return r}(s.query,a.query,r&&r.options.parseQuery),p=a.hash||s.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:u,query:d,hash:p}}var zi,Gi=function(){},Ki={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var t=this,n=this.$router,r=this.$route,a=n.resolve(this.to,r,this.append),i=a.location,o=a.route,l=a.href,s={},c=n.options.linkActiveClass,u=n.options.linkExactActiveClass,d=null==c?"router-link-active":c,p=null==u?"router-link-exact-active":u,f=null==this.activeClass?d:this.activeClass,v=null==this.exactActiveClass?p:this.exactActiveClass,h=o.redirectedFrom?fi(null,Vi(o.redirectedFrom),null,n):o;s[v]=yi(r,h,this.exactPath),s[f]=this.exact||this.exactPath?s[v]:function(e,t){return 0===e.path.replace(pi,"/").indexOf(t.path.replace(pi,"/"))&&(!t.hash||e.hash===t.hash)&&function(e,t){for(var n in t)if(!(n in e))return!1;return!0}(e.query,t.query)}(r,h);var g=s[v]?this.ariaCurrentValue:null,m=function(e){qi(e)&&(t.replace?n.replace(i,Gi):n.push(i,Gi))},y={click:qi};Array.isArray(this.event)?this.event.forEach((function(e){y[e]=m})):y[this.event]=m;var b={class:s},k=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:l,route:o,navigate:m,isActive:s[f],isExactActive:s[v]});if(k){if(1===k.length)return k[0];if(k.length>1||!k.length)return 0===k.length?e():e("span",{},k)}if("a"===this.tag)b.on=y,b.attrs={href:l,"aria-current":g};else{var x=function e(t){var n;if(t)for(var r=0;r-1&&(l.params[p]=n.params[p]);return l.path=Hi(u.path,l.params),s(u,l,o)}if(l.path){l.params={};for(var f=0;f-1}function Co(e,t){return Po(e)&&e._isRouter&&(null==t||e.type===t)}function Eo(e,t,n){var r=function(a){a>=e.length?n():e[a]?t(e[a],(function(){r(a+1)})):r(a+1)};r(0)}function So(e){return function(t,n,r){var a=!1,i=0,o=null;Ao(e,(function(e,t,n,l){if("function"==typeof e&&void 0===e.cid){a=!0,i++;var s,c=Uo((function(t){var a;((a=t).__esModule||Mo&&"Module"===a[Symbol.toStringTag])&&(t=t.default),e.resolved="function"==typeof t?t:zi.extend(t),n.components[l]=t,--i<=0&&r()})),u=Uo((function(e){var t="Failed to resolve async component "+l+": "+e;o||(o=Po(e)?e:new Error(t),r(o))}));try{s=e(c,u)}catch(e){u(e)}if(s)if("function"==typeof s.then)s.then(c,u);else{var d=s.component;d&&"function"==typeof d.then&&d.then(c,u)}}})),a||r()}}function Ao(e,t){return To(e.map((function(e){return Object.keys(e.components).map((function(n){return t(e.components[n],e.instances[n],e,n)}))})))}function To(e){return Array.prototype.concat.apply([],e)}var Mo="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Uo(e){var t=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!t)return t=!0,e.apply(this,n)}}var Oo=function(e,t){this.router=e,this.base=function(e){if(!e)if(Wi){var t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else e="/";"/"!==e.charAt(0)&&(e="/"+e);return e.replace(/\/$/,"")}(t),this.current=hi,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Lo(e,t,n,r){var a=Ao(e,(function(e,r,a,i){var o=function(e,t){"function"!=typeof e&&(e=zi.extend(e));return e.options[t]}(e,t);if(o)return Array.isArray(o)?o.map((function(e){return n(e,r,a,i)})):n(o,r,a,i)}));return To(r?a.reverse():a)}function jo(e,t){if(t)return function(){return e.apply(t,arguments)}}Oo.prototype.listen=function(e){this.cb=e},Oo.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))},Oo.prototype.onError=function(e){this.errorCbs.push(e)},Oo.prototype.transitionTo=function(e,t,n){var r,a=this;try{r=this.router.match(e,this.current)}catch(e){throw this.errorCbs.forEach((function(t){t(e)})),e}var i=this.current;this.confirmTransition(r,(function(){a.updateRoute(r),t&&t(r),a.ensureURL(),a.router.afterHooks.forEach((function(e){e&&e(r,i)})),a.ready||(a.ready=!0,a.readyCbs.forEach((function(e){e(r)})))}),(function(e){n&&n(e),e&&!a.ready&&(Co(e,bo.redirected)&&i===hi||(a.ready=!0,a.readyErrorCbs.forEach((function(t){t(e)}))))}))},Oo.prototype.confirmTransition=function(e,t,n){var r=this,a=this.current;this.pending=e;var i,o,l=function(e){!Co(e)&&Po(e)&&(r.errorCbs.length?r.errorCbs.forEach((function(t){t(e)})):console.error(e)),n&&n(e)},s=e.matched.length-1,c=a.matched.length-1;if(yi(e,a)&&s===c&&e.matched[s]===a.matched[c])return this.ensureURL(),e.hash&&oo(this.router,a,e,!1),l(((o=_o(i=a,e,bo.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",o));var u=function(e,t){var n,r=Math.max(e.length,t.length);for(n=0;n0)){var t=this.router,n=t.options.scrollBehavior,r=go&&n;r&&this.listeners.push(io());var a=function(){var n=e.current,a=Ro(e.base);e.current===hi&&a===e._startLocation||e.transitionTo(a,(function(e){r&&oo(t,e,n,!0)}))};window.addEventListener("popstate",a),this.listeners.push((function(){window.removeEventListener("popstate",a)}))}},t.prototype.go=function(e){window.history.go(e)},t.prototype.push=function(e,t,n){var r=this,a=this.current;this.transitionTo(e,(function(e){mo(Pi(r.base+e.fullPath)),oo(r.router,e,a,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this,a=this.current;this.transitionTo(e,(function(e){yo(Pi(r.base+e.fullPath)),oo(r.router,e,a,!1),t&&t(e)}),n)},t.prototype.ensureURL=function(e){if(Ro(this.base)!==this.current.fullPath){var t=Pi(this.base+this.current.fullPath);e?mo(t):yo(t)}},t.prototype.getCurrentLocation=function(){return Ro(this.base)},t}(Oo);function Ro(e){var t=window.location.pathname,n=t.toLowerCase(),r=e.toLowerCase();return!e||n!==r&&0!==n.indexOf(Pi(r+"/"))||(t=t.slice(e.length)),(t||"/")+window.location.search+window.location.hash}var Io=function(e){function t(t,n,r){e.call(this,t,n),r&&function(e){var t=Ro(e);if(!/^\/#/.test(t))return window.location.replace(Pi(e+"/#"+t)),!0}(this.base)||Do()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setupListeners=function(){var e=this;if(!(this.listeners.length>0)){var t=this.router.options.scrollBehavior,n=go&&t;n&&this.listeners.push(io());var r=function(){var t=e.current;Do()&&e.transitionTo(Fo(),(function(r){n&&oo(e.router,r,t,!0),go||Ho(r.fullPath)}))},a=go?"popstate":"hashchange";window.addEventListener(a,r),this.listeners.push((function(){window.removeEventListener(a,r)}))}},t.prototype.push=function(e,t,n){var r=this,a=this.current;this.transitionTo(e,(function(e){No(e.fullPath),oo(r.router,e,a,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this,a=this.current;this.transitionTo(e,(function(e){Ho(e.fullPath),oo(r.router,e,a,!1),t&&t(e)}),n)},t.prototype.go=function(e){window.history.go(e)},t.prototype.ensureURL=function(e){var t=this.current.fullPath;Fo()!==t&&(e?No(t):Ho(t))},t.prototype.getCurrentLocation=function(){return Fo()},t}(Oo);function Do(){var e=Fo();return"/"===e.charAt(0)||(Ho("/"+e),!1)}function Fo(){var e=window.location.href,t=e.indexOf("#");return t<0?"":e=e.slice(t+1)}function Bo(e){var t=window.location.href,n=t.indexOf("#");return(n>=0?t.slice(0,n):t)+"#"+e}function No(e){go?mo(Bo(e)):window.location.hash=e}function Ho(e){go?yo(Bo(e)):window.location.replace(Bo(e))}var Vo=function(e){function t(t,n){e.call(this,t,n),this.stack=[],this.index=-1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.push=function(e,t,n){var r=this;this.transitionTo(e,(function(e){r.stack=r.stack.slice(0,r.index+1).concat(e),r.index++,t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this;this.transitionTo(e,(function(e){r.stack=r.stack.slice(0,r.index).concat(e),t&&t(e)}),n)},t.prototype.go=function(e){var t=this,n=this.index+e;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){var e=t.current;t.index=n,t.updateRoute(r),t.router.afterHooks.forEach((function(t){t&&t(r,e)}))}),(function(e){Co(e,bo.duplicated)&&(t.index=n)}))}},t.prototype.getCurrentLocation=function(){var e=this.stack[this.stack.length-1];return e?e.fullPath:"/"},t.prototype.ensureURL=function(){},t}(Oo),zo=function(e){void 0===e&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Ji(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback="history"===t&&!go&&!1!==e.fallback,this.fallback&&(t="hash"),Wi||(t="abstract"),this.mode=t,t){case"history":this.history=new $o(this,e.base);break;case"hash":this.history=new Io(this,e.base,this.fallback);break;case"abstract":this.history=new Vo(this,e.base);break;default:0}},Go={currentRoute:{configurable:!0}};zo.prototype.match=function(e,t,n){return this.matcher.match(e,t,n)},Go.currentRoute.get=function(){return this.history&&this.history.current},zo.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",(function(){var n=t.apps.indexOf(e);n>-1&&t.apps.splice(n,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()})),!this.app){this.app=e;var n=this.history;if(n instanceof $o||n instanceof Io){var r=function(e){n.setupListeners(),function(e){var r=n.current,a=t.options.scrollBehavior;go&&a&&"fullPath"in e&&oo(t,e,r,!1)}(e)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(e){t.apps.forEach((function(t){t._route=e}))}))}},zo.prototype.beforeEach=function(e){return qo(this.beforeHooks,e)},zo.prototype.beforeResolve=function(e){return qo(this.resolveHooks,e)},zo.prototype.afterEach=function(e){return qo(this.afterHooks,e)},zo.prototype.onReady=function(e,t){this.history.onReady(e,t)},zo.prototype.onError=function(e){this.history.onError(e)},zo.prototype.push=function(e,t,n){var r=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){r.history.push(e,t,n)}));this.history.push(e,t,n)},zo.prototype.replace=function(e,t,n){var r=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){r.history.replace(e,t,n)}));this.history.replace(e,t,n)},zo.prototype.go=function(e){this.history.go(e)},zo.prototype.back=function(){this.go(-1)},zo.prototype.forward=function(){this.go(1)},zo.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map((function(e){return Object.keys(e.components).map((function(t){return e.components[t]}))}))):[]},zo.prototype.resolve=function(e,t,n){var r=Vi(e,t=t||this.history.current,n,this),a=this.match(r,t),i=a.redirectedFrom||a.fullPath;return{location:r,route:a,href:function(e,t,n){var r="hash"===n?"#"+t:t;return e?Pi(e+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:a}},zo.prototype.getRoutes=function(){return this.matcher.getRoutes()},zo.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==hi&&this.history.transitionTo(this.history.getCurrentLocation())},zo.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==hi&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(zo.prototype,Go);var Ko=zo;function qo(e,t){return e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}zo.install=function e(t){if(!e.installed||zi!==t){e.installed=!0,zi=t;var n=function(e){return void 0!==e},r=function(e,t){var r=e.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(e,t)};t.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),t.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed:function(){r(this)}}),Object.defineProperty(t.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(t.prototype,"$route",{get:function(){return this._routerRoot._route}}),t.component("RouterView",xi),t.component("RouterLink",Ki);var a=t.config.optionMergeStrategies;a.beforeRouteEnter=a.beforeRouteLeave=a.beforeRouteUpdate=a.created}},zo.version="3.6.5",zo.isNavigationFailure=Co,zo.NavigationFailureType=bo,zo.START_LOCATION=hi,Wi&&window.Vue&&window.Vue.use(zo);n(99);n(126),n(92);var Wo={"components/AlgoliaSearchBox":()=>Promise.all([n.e(0),n.e(11)]).then(n.bind(null,316)),"components/DropdownLink":()=>Promise.all([n.e(0),n.e(12)]).then(n.bind(null,261)),"components/DropdownTransition":()=>Promise.all([n.e(0),n.e(18)]).then(n.bind(null,249)),"components/Home":()=>Promise.all([n.e(0),n.e(15)]).then(n.bind(null,289)),"components/NavLink":()=>n.e(21).then(n.bind(null,248)),"components/NavLinks":()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,274)),"components/Navbar":()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,312)),"components/Page":()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,290)),"components/PageEdit":()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,276)),"components/PageNav":()=>Promise.all([n.e(0),n.e(13)]).then(n.bind(null,277)),"components/Sidebar":()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,291)),"components/SidebarButton":()=>Promise.all([n.e(0),n.e(19)]).then(n.bind(null,293)),"components/SidebarGroup":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,275)),"components/SidebarLink":()=>Promise.all([n.e(0),n.e(17)]).then(n.bind(null,262)),"components/SidebarLinks":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,260)),"components/TopNav":()=>Promise.all([n.e(0),n.e(20)]).then(n.bind(null,292)),"global-components/Badge":()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,319)),"layouts/404":()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,317)),"layouts/Layout":()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,318)),NotFound:()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,317)),Layout:()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,318))},Xo={"v-34fe0e46":()=>n.e(26).then(n.bind(null,320)),"v-1cbafd5b":()=>n.e(27).then(n.bind(null,321)),"v-386691fe":()=>n.e(29).then(n.bind(null,322)),"v-b8b65022":()=>n.e(28).then(n.bind(null,323)),"v-0359c01b":()=>n.e(30).then(n.bind(null,324)),"v-7cb2e029":()=>n.e(22).then(n.bind(null,325)),"v-d80157e0":()=>n.e(33).then(n.bind(null,326)),"v-3a964646":()=>n.e(32).then(n.bind(null,327)),"v-b3e2f7dc":()=>n.e(31).then(n.bind(null,328)),"v-628bc8f0":()=>n.e(25).then(n.bind(null,329)),"v-f8ff2a8a":()=>n.e(36).then(n.bind(null,330)),"v-0648babb":()=>n.e(34).then(n.bind(null,331)),"v-2d5f850a":()=>n.e(35).then(n.bind(null,332)),"v-3d14d060":()=>n.e(38).then(n.bind(null,333)),"v-1d0a5d05":()=>n.e(37).then(n.bind(null,334)),"v-37d6db67":()=>n.e(39).then(n.bind(null,335)),"v-fb520162":()=>n.e(14).then(n.bind(null,336)),"v-a1dfbd8a":()=>n.e(41).then(n.bind(null,337)),"v-0606cc70":()=>n.e(40).then(n.bind(null,338)),"v-7cda367b":()=>n.e(42).then(n.bind(null,339)),"v-49812bde":()=>n.e(44).then(n.bind(null,340)),"v-97db1d60":()=>n.e(43).then(n.bind(null,341)),"v-81282f8a":()=>n.e(45).then(n.bind(null,342)),"v-9436f116":()=>n.e(46).then(n.bind(null,343)),"v-3d32147b":()=>n.e(47).then(n.bind(null,344)),"v-43c25037":()=>n.e(48).then(n.bind(null,345)),"v-3098292d":()=>n.e(49).then(n.bind(null,346)),"v-43d3637b":()=>n.e(50).then(n.bind(null,347)),"v-67061e4a":()=>n.e(51).then(n.bind(null,348)),"v-253dcc3b":()=>n.e(53).then(n.bind(null,349)),"v-87d9c7de":()=>n.e(52).then(n.bind(null,350)),"v-4e564c1b":()=>n.e(54).then(n.bind(null,351)),"v-32163c7b":()=>n.e(56).then(n.bind(null,352)),"v-53650bf2":()=>n.e(57).then(n.bind(null,353)),"v-5ab843d6":()=>n.e(55).then(n.bind(null,354)),"v-97e6ce60":()=>n.e(58).then(n.bind(null,355)),"v-22174a62":()=>n.e(59).then(n.bind(null,356)),"v-257fce1a":()=>n.e(62).then(n.bind(null,357)),"v-3b63817b":()=>n.e(60).then(n.bind(null,358)),"v-3f10e261":()=>n.e(61).then(n.bind(null,359)),"v-97082ec0":()=>n.e(64).then(n.bind(null,360)),"v-bc74fe4a":()=>n.e(23).then(n.bind(null,361)),"v-77ed9d62":()=>n.e(65).then(n.bind(null,362)),"v-4d68c870":()=>n.e(66).then(n.bind(null,363)),"v-6f60c50a":()=>n.e(63).then(n.bind(null,364)),"v-4dd4215b":()=>n.e(67).then(n.bind(null,365)),"v-a373ca4a":()=>n.e(68).then(n.bind(null,366)),"v-48779cdb":()=>n.e(69).then(n.bind(null,367)),"v-923fce92":()=>n.e(70).then(n.bind(null,368)),"v-597357a4":()=>n.e(71).then(n.bind(null,369)),"v-001b8d81":()=>n.e(73).then(n.bind(null,370)),"v-2d236119":()=>n.e(72).then(n.bind(null,371)),"v-811f7e60":()=>n.e(74).then(n.bind(null,372)),"v-c6f4abca":()=>n.e(76).then(n.bind(null,373)),"v-65c09c5b":()=>n.e(75).then(n.bind(null,374)),"v-05934130":()=>n.e(78).then(n.bind(null,375)),"v-6a4fbf5b":()=>n.e(77).then(n.bind(null,376)),"v-00520ac3":()=>n.e(79).then(n.bind(null,377)),"v-4643c467":()=>n.e(82).then(n.bind(null,378)),"v-2607b25b":()=>n.e(81).then(n.bind(null,379)),"v-43d7274a":()=>n.e(80).then(n.bind(null,380)),"v-19b6241b":()=>n.e(83).then(n.bind(null,381)),"v-68d4f0e9":()=>n.e(84).then(n.bind(null,382)),"v-a3469142":()=>n.e(85).then(n.bind(null,383)),"v-1dedbe9b":()=>n.e(86).then(n.bind(null,384)),"v-577f2683":()=>n.e(88).then(n.bind(null,385)),"v-2b98acca":()=>n.e(89).then(n.bind(null,386)),"v-52bde2bb":()=>n.e(87).then(n.bind(null,387)),"v-6cfed03b":()=>n.e(90).then(n.bind(null,388)),"v-b87050f2":()=>n.e(91).then(n.bind(null,389)),"v-0e9a4c1b":()=>n.e(92).then(n.bind(null,390)),"v-0c08fe70":()=>n.e(94).then(n.bind(null,391)),"v-9498b98e":()=>n.e(93).then(n.bind(null,392)),"v-4b11a99b":()=>n.e(95).then(n.bind(null,393)),"v-2888eb6a":()=>n.e(96).then(n.bind(null,394)),"v-7ea5c780":()=>n.e(98).then(n.bind(null,395)),"v-fb9fdb00":()=>n.e(97).then(n.bind(null,396)),"v-3042924a":()=>n.e(99).then(n.bind(null,397)),"v-761748db":()=>n.e(100).then(n.bind(null,398)),"v-6c9aa255":()=>n.e(101).then(n.bind(null,399)),"v-1f119f3b":()=>n.e(102).then(n.bind(null,400)),"v-35006eca":()=>n.e(103).then(n.bind(null,401)),"v-75c7df60":()=>n.e(105).then(n.bind(null,402)),"v-cc8367fe":()=>n.e(104).then(n.bind(null,403)),"v-f2f6664a":()=>n.e(106).then(n.bind(null,404)),"v-a79c52ca":()=>n.e(24).then(n.bind(null,405)),"v-5b513a44":()=>n.e(107).then(n.bind(null,406)),"v-3d6730e7":()=>n.e(108).then(n.bind(null,407)),"v-38093e8f":()=>n.e(110).then(n.bind(null,408)),"v-82f3414a":()=>n.e(111).then(n.bind(null,409)),"v-19fa9c70":()=>n.e(112).then(n.bind(null,410)),"v-11d2520a":()=>n.e(113).then(n.bind(null,411)),"v-50c09862":()=>n.e(109).then(n.bind(null,412)),"v-3e7871fb":()=>n.e(114).then(n.bind(null,413)),"v-29ba2c92":()=>n.e(116).then(n.bind(null,414)),"v-102d7560":()=>n.e(115).then(n.bind(null,415)),"v-4ad03c83":()=>n.e(117).then(n.bind(null,416)),"v-7b128352":()=>n.e(118).then(n.bind(null,417)),"v-94b795ac":()=>n.e(119).then(n.bind(null,418)),"v-5516a1ca":()=>n.e(120).then(n.bind(null,419)),"v-68450b87":()=>n.e(122).then(n.bind(null,420)),"v-2d59775b":()=>n.e(123).then(n.bind(null,421)),"v-49e9b357":()=>n.e(121).then(n.bind(null,422)),"v-77bdaafb":()=>n.e(125).then(n.bind(null,423)),"v-c13ca42a":()=>n.e(124).then(n.bind(null,424)),"v-0b718b3d":()=>n.e(128).then(n.bind(null,425)),"v-f028604a":()=>n.e(126).then(n.bind(null,426)),"v-c1dbb14a":()=>n.e(132).then(n.bind(null,427)),"v-03cb4f1a":()=>n.e(127).then(n.bind(null,428)),"v-066aec9b":()=>n.e(129).then(n.bind(null,429)),"v-0142f749":()=>n.e(131).then(n.bind(null,430)),"v-3e3a5dab":()=>n.e(130).then(n.bind(null,431)),"v-4ac4bd6b":()=>n.e(133).then(n.bind(null,432)),"v-71ef02ca":()=>n.e(137).then(n.bind(null,433)),"v-c4ee6cda":()=>n.e(136).then(n.bind(null,434)),"v-24913d76":()=>n.e(135).then(n.bind(null,435)),"v-2b0dbf0a":()=>n.e(134).then(n.bind(null,436))};function Yo(e){const t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}const Jo=/-(\w)/g,Qo=Yo(e=>e.replace(Jo,(e,t)=>t?t.toUpperCase():"")),Zo=/\B([A-Z])/g,el=Yo(e=>e.replace(Zo,"-$1").toLowerCase()),tl=Yo(e=>e.charAt(0).toUpperCase()+e.slice(1));function nl(e,t){if(!t)return;if(e(t))return e(t);return t.includes("-")?e(tl(Qo(t))):e(tl(t))||e(el(t))}const rl=Object.assign({},Wo,Xo),al=e=>rl[e],il=e=>Xo[e],ol=e=>Wo[e],ll=e=>qn.component(e);function sl(e){return nl(il,e)}function cl(e){return nl(ol,e)}function ul(e){return nl(al,e)}function dl(e){return nl(ll,e)}function pl(...e){return Promise.all(e.filter(e=>e).map(async e=>{if(!dl(e)&&ul(e)){const t=await ul(e)();qn.component(e,t.default)}}))}function fl(e,t){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[e]=t)}var vl=n(89),hl=n.n(vl),gl=n(90),ml=n.n(gl),yl={created(){if(this.siteMeta=this.$site.headTags.filter(([e])=>"meta"===e).map(([e,t])=>t),this.$ssrContext){const t=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(e=t)?e.map(e=>{let t="{t+=` ${n}="${ml()(e[n])}"`}),t+">"}).join("\n "):"",this.$ssrContext.canonicalLink=kl(this.$canonicalUrl)}var e},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const e=this.getMergedMetaTags();this.currentMetaTags=xl(e,this.currentMetaTags)},getMergedMetaTags(){const e=this.$page.frontmatter.meta||[];return hl()([{name:"description",content:this.$description}],e,this.siteMeta,_l)},updateCanonicalLink(){bl(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",kl(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){xl(null,this.currentMetaTags),bl()}};function bl(){const e=document.querySelector("link[rel='canonical']");e&&e.remove()}function kl(e=""){return e?``:""}function xl(e,t){if(t&&[...t].filter(e=>e.parentNode===document.head).forEach(e=>document.head.removeChild(e)),e)return e.map(e=>{const t=document.createElement("meta");return Object.keys(e).forEach(n=>{t.setAttribute(n,e[n])}),document.head.appendChild(t),t})}function _l(e){for(const t of["name","property","itemprop"])if(e.hasOwnProperty(t))return e[t]+t;return JSON.stringify(e)}var wl=n(22),Pl=n.n(wl),Cl={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:Pl()((function(){this.setActiveHash()}),300),setActiveHash(){const e=[].slice.call(document.querySelectorAll(".sidebar-link")),t=[].slice.call(document.querySelectorAll(".header-anchor")).filter(t=>e.some(e=>e.hash===t.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),a=window.innerHeight+n;for(let e=0;e=i.parentElement.offsetTop+10&&(!o||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},El=n(23),Sl=n.n(El),Al={mounted(){Sl.a.configure({showSpinner:!1}),this.$router.beforeEach((e,t,n)=>{e.path===t.path||qn.component(e.name)||Sl.a.start(),n()}),this.$router.afterEach(()=>{Sl.a.done(),this.isSidebarOpen=!1})}},Tl=n(91),Ml=n.n(Tl),Ul={mounted(){Ml.a.polyfill()}};n(237),n(238);class Ol{constructor(){this.containerEl=document.getElementById("message-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.id="message-container",document.body.appendChild(this.containerEl))}show({text:e="",duration:t=3e3}){let n=document.createElement("div");n.className="message move-in",n.innerHTML=`\n \n \n \n
    ${e}
    \n `,this.containerEl.appendChild(n),t>0&&setTimeout(()=>{this.close(n)},t)}close(e){e.className=e.className.replace("move-in",""),e.className+="move-out",e.addEventListener("animationend",()=>{e.remove()})}}var Ll=[yl,Cl,Al,Ul,{mounted(){this.updateCopy()},watch:{$route:{handler(){this.updateCopy()}}},updated(){this.updateCopy()},methods:{updateCopy(){!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||setTimeout(()=>{(['div[class*="language-"] pre','div[class*="aside-code"] aside']instanceof Array||Array.isArray(['div[class*="language-"] pre','div[class*="aside-code"] aside']))&&['div[class*="language-"] pre','div[class*="aside-code"] aside'].forEach(e=>{document.querySelectorAll(e).forEach(this.generateCopyButton)})},1e3)},generateCopyButton(e){if(e.classList.contains("codecopy-enabled"))return;const t=document.createElement("i");t.className="code-copy",t.innerHTML='',t.title="Click to Copy to Clipboard",t.addEventListener("click",()=>{this.copyToClipboard(e.innerText)}),e.appendChild(t),e.classList.add("codecopy-enabled")},copyToClipboard(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);const n=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);t.select(),document.execCommand("copy");(new Ol).show({text:"Copy successfully and then paste it for use.",duration:3e3}),document.body.removeChild(t),n&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(n))}}}],jl={name:"GlobalLayout",computed:{layout(){const e=this.getLayout();return fl("layout",e),qn.component(e)}},methods:{getLayout(){if(this.$page.path){const e=this.$page.frontmatter.layout;return e&&(this.$vuepress.getLayoutAsyncComponent(e)||this.$vuepress.getVueComponent(e))?e:"Layout"}return"NotFound"}}},$l=n(10),Rl=Object($l.a)(jl,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(e,t,n){switch(t){case"components":e[t]||(e[t]={}),Object.assign(e[t],n);break;case"mixins":e[t]||(e[t]=[]),e[t].push(...n);break;default:throw new Error("Unknown option name.")}}(Rl,"mixins",Ll);const Il=[{name:"v-34fe0e46",path:"/1.x/advanced/email-inbound-parse.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-34fe0e46").then(n)}},{name:"v-1cbafd5b",path:"/1.x/advanced/events.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-1cbafd5b").then(n)}},{name:"v-386691fe",path:"/1.x/advanced/override-core-model.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-386691fe").then(n)}},{name:"v-b8b65022",path:"/1.x/advanced/helpers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-b8b65022").then(n)}},{name:"v-0359c01b",path:"/1.x/advanced/render-event.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0359c01b").then(n)}},{name:"v-7cb2e029",path:"/1.x/advanced/security-practice.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-7cb2e029").then(n)}},{name:"v-d80157e0",path:"/1.x/architecture/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-d80157e0").then(n)}},{path:"/1.x/architecture/index.html",redirect:"/1.x/architecture/"},{name:"v-3a964646",path:"/1.x/api/getting-started-with-the-api.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3a964646").then(n)}},{name:"v-b3e2f7dc",path:"/1.x/api/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-b3e2f7dc").then(n)}},{path:"/1.x/api/index.html",redirect:"/1.x/api/"},{name:"v-628bc8f0",path:"/1.x/advanced/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-628bc8f0").then(n)}},{path:"/1.x/advanced/index.html",redirect:"/1.x/advanced/"},{name:"v-f8ff2a8a",path:"/1.x/architecture/repository-pattern.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-f8ff2a8a").then(n)}},{name:"v-0648babb",path:"/1.x/architecture/modular-design.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0648babb").then(n)}},{name:"v-2d5f850a",path:"/1.x/architecture/packages.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2d5f850a").then(n)}},{name:"v-3d14d060",path:"/1.x/custom-attributes/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3d14d060").then(n)}},{path:"/1.x/custom-attributes/index.html",redirect:"/1.x/custom-attributes/"},{name:"v-1d0a5d05",path:"/1.x/architecture/theme.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-1d0a5d05").then(n)}},{name:"v-37d6db67",path:"/1.x/custom-attributes/custom-attribute.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-37d6db67").then(n)}},{name:"v-fb520162",path:"/1.x/custom-attributes/uses.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-fb520162").then(n)}},{name:"v-a1dfbd8a",path:"/1.x/introduction/installation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-a1dfbd8a").then(n)}},{name:"v-0606cc70",path:"/1.x/introduction/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0606cc70").then(n)}},{path:"/1.x/introduction/index.html",redirect:"/1.x/introduction/"},{name:"v-7cda367b",path:"/1.x/introduction/requirements.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-7cda367b").then(n)}},{name:"v-49812bde",path:"/1.x/packages/add-menu-in-admin.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-49812bde").then(n)}},{name:"v-97db1d60",path:"/1.x/packages/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-97db1d60").then(n)}},{path:"/1.x/packages/index.html",redirect:"/1.x/packages/"},{name:"v-81282f8a",path:"/1.x/packages/assets.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-81282f8a").then(n)}},{name:"v-9436f116",path:"/1.x/packages/controllers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-9436f116").then(n)}},{name:"v-3d32147b",path:"/1.x/packages/create-acl.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3d32147b").then(n)}},{name:"v-43c25037",path:"/1.x/packages/create-migrations.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-43c25037").then(n)}},{name:"v-3098292d",path:"/1.x/packages/create-models.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3098292d").then(n)}},{name:"v-43d3637b",path:"/1.x/packages/create-package.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-43d3637b").then(n)}},{name:"v-67061e4a",path:"/1.x/packages/datagrid.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-67061e4a").then(n)}},{name:"v-253dcc3b",path:"/1.x/packages/localization.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-253dcc3b").then(n)}},{name:"v-87d9c7de",path:"/1.x/packages/layouts.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-87d9c7de").then(n)}},{name:"v-4e564c1b",path:"/1.x/packages/routes.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4e564c1b").then(n)}},{name:"v-32163c7b",path:"/1.x/packages/validation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-32163c7b").then(n)}},{name:"v-53650bf2",path:"/1.x/packages/views.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-53650bf2").then(n)}},{name:"v-5ab843d6",path:"/1.x/packages/store-data-through-repositories.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-5ab843d6").then(n)}},{name:"v-97e6ce60",path:"/2.0/advanced/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-97e6ce60").then(n)}},{path:"/2.0/advanced/index.html",redirect:"/2.0/advanced/"},{name:"v-22174a62",path:"/2.0/advanced/email-inbound-parse.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-22174a62").then(n)}},{name:"v-257fce1a",path:"/2.0/advanced/override-core-model.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-257fce1a").then(n)}},{name:"v-3b63817b",path:"/2.0/advanced/events.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3b63817b").then(n)}},{name:"v-3f10e261",path:"/2.0/advanced/helpers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3f10e261").then(n)}},{name:"v-97082ec0",path:"/2.0/api/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-97082ec0").then(n)}},{path:"/2.0/api/index.html",redirect:"/2.0/api/"},{name:"v-bc74fe4a",path:"/2.0/advanced/security-practice.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-bc74fe4a").then(n)}},{name:"v-77ed9d62",path:"/2.0/api/getting-started-with-the-api.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-77ed9d62").then(n)}},{name:"v-4d68c870",path:"/2.0/architecture/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4d68c870").then(n)}},{path:"/2.0/architecture/index.html",redirect:"/2.0/architecture/"},{name:"v-6f60c50a",path:"/2.0/advanced/render-event.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-6f60c50a").then(n)}},{name:"v-4dd4215b",path:"/2.0/architecture/modular-design.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4dd4215b").then(n)}},{name:"v-a373ca4a",path:"/2.0/architecture/packages.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-a373ca4a").then(n)}},{name:"v-48779cdb",path:"/2.0/architecture/repository-pattern.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-48779cdb").then(n)}},{name:"v-923fce92",path:"/2.0/architecture/theme.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-923fce92").then(n)}},{name:"v-597357a4",path:"/2.0/custom-attributes/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-597357a4").then(n)}},{path:"/2.0/custom-attributes/index.html",redirect:"/2.0/custom-attributes/"},{name:"v-001b8d81",path:"/2.0/custom-attributes/uses.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-001b8d81").then(n)}},{name:"v-2d236119",path:"/2.0/custom-attributes/custom-attribute.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2d236119").then(n)}},{name:"v-811f7e60",path:"/2.0/introduction/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-811f7e60").then(n)}},{path:"/2.0/introduction/index.html",redirect:"/2.0/introduction/"},{name:"v-c6f4abca",path:"/2.0/introduction/installation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-c6f4abca").then(n)}},{name:"v-65c09c5b",path:"/2.0/introduction/docker.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-65c09c5b").then(n)}},{name:"v-05934130",path:"/2.0/packages/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-05934130").then(n)}},{path:"/2.0/packages/index.html",redirect:"/2.0/packages/"},{name:"v-6a4fbf5b",path:"/2.0/introduction/requirements.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-6a4fbf5b").then(n)}},{name:"v-00520ac3",path:"/2.0/packages/add-menu-in-admin.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-00520ac3").then(n)}},{name:"v-4643c467",path:"/2.0/packages/controllers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4643c467").then(n)}},{name:"v-2607b25b",path:"/2.0/packages/blade-components.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2607b25b").then(n)}},{name:"v-43d7274a",path:"/2.0/packages/assets.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-43d7274a").then(n)}},{name:"v-19b6241b",path:"/2.0/packages/create-acl.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-19b6241b").then(n)}},{name:"v-68d4f0e9",path:"/2.0/packages/create-migrations.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-68d4f0e9").then(n)}},{name:"v-a3469142",path:"/2.0/packages/create-models.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-a3469142").then(n)}},{name:"v-1dedbe9b",path:"/2.0/packages/create-package.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-1dedbe9b").then(n)}},{name:"v-577f2683",path:"/2.0/packages/layouts.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-577f2683").then(n)}},{name:"v-2b98acca",path:"/2.0/packages/localization.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2b98acca").then(n)}},{name:"v-52bde2bb",path:"/2.0/packages/datagrid.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-52bde2bb").then(n)}},{name:"v-6cfed03b",path:"/2.0/packages/routes.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-6cfed03b").then(n)}},{name:"v-b87050f2",path:"/2.0/packages/store-data-through-repositories.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-b87050f2").then(n)}},{name:"v-0e9a4c1b",path:"/2.0/packages/validation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0e9a4c1b").then(n)}},{name:"v-0c08fe70",path:"/2.0/prologue/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0c08fe70").then(n)}},{path:"/2.0/prologue/index.html",redirect:"/2.0/prologue/"},{name:"v-9498b98e",path:"/2.0/packages/views.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-9498b98e").then(n)}},{name:"v-4b11a99b",path:"/2.0/prologue/contribution-guide.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4b11a99b").then(n)}},{name:"v-2888eb6a",path:"/2.0/prologue/upgrade-guide.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2888eb6a").then(n)}},{name:"v-7ea5c780",path:"/master/advanced/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-7ea5c780").then(n)}},{path:"/master/advanced/index.html",redirect:"/master/advanced/"},{name:"v-fb9fdb00",path:"/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-fb9fdb00").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-3042924a",path:"/master/advanced/data-transfer.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3042924a").then(n)}},{name:"v-761748db",path:"/master/advanced/email-inbound-parse.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-761748db").then(n)}},{name:"v-6c9aa255",path:"/master/advanced/events.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-6c9aa255").then(n)}},{name:"v-1f119f3b",path:"/master/advanced/helpers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-1f119f3b").then(n)}},{name:"v-35006eca",path:"/master/advanced/override-core-model.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-35006eca").then(n)}},{name:"v-75c7df60",path:"/master/api/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-75c7df60").then(n)}},{path:"/master/api/index.html",redirect:"/master/api/"},{name:"v-cc8367fe",path:"/master/advanced/render-event.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-cc8367fe").then(n)}},{name:"v-f2f6664a",path:"/master/api/getting-started-with-the-api.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-f2f6664a").then(n)}},{name:"v-a79c52ca",path:"/master/advanced/security-practice.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-a79c52ca").then(n)}},{name:"v-5b513a44",path:"/master/architecture/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-5b513a44").then(n)}},{path:"/master/architecture/index.html",redirect:"/master/architecture/"},{name:"v-3d6730e7",path:"/master/architecture/modular-design.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3d6730e7").then(n)}},{name:"v-38093e8f",path:"/master/architecture/repository-pattern.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-38093e8f").then(n)}},{name:"v-82f3414a",path:"/master/architecture/theme.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-82f3414a").then(n)}},{name:"v-19fa9c70",path:"/master/custom-attributes/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-19fa9c70").then(n)}},{path:"/master/custom-attributes/index.html",redirect:"/master/custom-attributes/"},{name:"v-11d2520a",path:"/master/custom-attributes/custom-attribute.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-11d2520a").then(n)}},{name:"v-50c09862",path:"/master/architecture/packages.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-50c09862").then(n)}},{name:"v-3e7871fb",path:"/master/custom-attributes/uses.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3e7871fb").then(n)}},{name:"v-29ba2c92",path:"/master/introduction/docker.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-29ba2c92").then(n)}},{name:"v-102d7560",path:"/master/introduction/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-102d7560").then(n)}},{path:"/master/introduction/index.html",redirect:"/master/introduction/"},{name:"v-4ad03c83",path:"/master/introduction/installation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4ad03c83").then(n)}},{name:"v-7b128352",path:"/master/introduction/requirements.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-7b128352").then(n)}},{name:"v-94b795ac",path:"/master/packages/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-94b795ac").then(n)}},{path:"/master/packages/index.html",redirect:"/master/packages/"},{name:"v-5516a1ca",path:"/master/packages/add-menu-in-admin.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-5516a1ca").then(n)}},{name:"v-68450b87",path:"/master/packages/blade-components.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-68450b87").then(n)}},{name:"v-2d59775b",path:"/master/packages/controllers.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2d59775b").then(n)}},{name:"v-49e9b357",path:"/master/packages/assets.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-49e9b357").then(n)}},{name:"v-77bdaafb",path:"/master/packages/create-migrations.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-77bdaafb").then(n)}},{name:"v-c13ca42a",path:"/master/packages/create-acl.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-c13ca42a").then(n)}},{name:"v-0b718b3d",path:"/master/packages/datagrid.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0b718b3d").then(n)}},{name:"v-f028604a",path:"/master/packages/create-models.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-f028604a").then(n)}},{name:"v-c1dbb14a",path:"/master/packages/store-data-through-repositories.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-c1dbb14a").then(n)}},{name:"v-03cb4f1a",path:"/master/packages/create-package.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-03cb4f1a").then(n)}},{name:"v-066aec9b",path:"/master/packages/layouts.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-066aec9b").then(n)}},{name:"v-0142f749",path:"/master/packages/routes.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-0142f749").then(n)}},{name:"v-3e3a5dab",path:"/master/packages/localization.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-3e3a5dab").then(n)}},{name:"v-4ac4bd6b",path:"/master/packages/validation.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-4ac4bd6b").then(n)}},{name:"v-71ef02ca",path:"/master/prologue/upgrade-guide.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-71ef02ca").then(n)}},{name:"v-c4ee6cda",path:"/master/prologue/contribution-guide.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-c4ee6cda").then(n)}},{name:"v-24913d76",path:"/master/prologue/",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-24913d76").then(n)}},{path:"/master/prologue/index.html",redirect:"/master/prologue/"},{name:"v-2b0dbf0a",path:"/master/packages/views.html",component:Rl,beforeEnter:(e,t,n)=>{pl("Layout","v-2b0dbf0a").then(n)}},{path:"*",component:Rl}],Dl={title:"Krayin CRM Developer Portal",description:"Krayin CRM Developer Portal",base:"/",headTags:[["link",{rel:"icon",type:"image/png",href:"/favicon.ico"}],["meta",{name:"title",content:"Krayin CRM Developer Portal"}]],pages:[{frontmatter:{},regularPath:"/1.x/advanced/email-inbound-parse.html",relativePath:"1.x/advanced/email-inbound-parse.md",key:"v-34fe0e46",path:"/1.x/advanced/email-inbound-parse.html",headers:[{level:3,title:"SendGrid Inbound Parse",slug:"sendgrid-inbound-parse"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Events",frontmatter:{},regularPath:"/1.x/advanced/events.html",relativePath:"1.x/advanced/events.md",key:"v-1cbafd5b",path:"/1.x/advanced/events.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Creating an Event Class",slug:"creating-an-event-class"},{level:3,title:"Using Package Generator",slug:"using-package-generator"},{level:3,title:"Manually Registering Events",slug:"manually-registering-events"},{level:3,title:"Manually Registering Listeners",slug:"manually-registering-listeners"},{level:2,title:"Specifying Events",slug:"specifying-events"},{level:2,title:"Events Fired in Krayin",slug:"events-fired-in-krayin"},{level:2,title:"Listening to Existing Events",slug:"listening-to-existing-events"},{level:3,title:"Registering a Listener",slug:"registering-a-listener"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Override Core Model",frontmatter:{},regularPath:"/1.x/advanced/override-core-model.html",relativePath:"1.x/advanced/override-core-model.md",key:"v-386691fe",path:"/1.x/advanced/override-core-model.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Overriding a Model Class",slug:"overriding-a-model-class"},{level:3,title:"Define an Interface (Contract)",slug:"define-an-interface-contract"},{level:3,title:"Register the Model Override",slug:"register-the-model-override"},{level:3,title:"Implement the Custom Model Class",slug:"implement-the-custom-model-class"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Helpers",frontmatter:{},regularPath:"/1.x/advanced/helpers.html",relativePath:"1.x/advanced/helpers.md",key:"v-b8b65022",path:"/1.x/advanced/helpers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Core Helpers",slug:"core-helpers"},{level:3,title:"Get the lists of timezone",slug:"get-the-lists-of-timezone"},{level:3,title:"Get the list of available locals",slug:"get-the-list-of-available-locals"},{level:3,title:"Get the list of countries",slug:"get-the-list-of-countries"},{level:3,title:"Get the country name",slug:"get-the-country-name"},{level:3,title:"Get the available states associated with country code",slug:"get-the-available-states-associated-with-country-code"},{level:3,title:"Get the specified state name associated with state code",slug:"get-the-specified-state-name-associated-with-state-code"},{level:3,title:"Get the Grouped the states by the countries",slug:"get-the-grouped-the-states-by-the-countries"},{level:3,title:"To Sort the items",slug:"to-sort-the-items"},{level:3,title:"Set a value in an array using dot notation",slug:"set-a-value-in-an-array-using-dot-notation"},{level:3,title:"To converted associated array",slug:"to-converted-associated-array"},{level:3,title:"To merge the array",slug:"to-merge-the-array"},{level:3,title:"Create singleton object through single facade",slug:"create-singleton-object-through-single-facade"},{level:3,title:"Format Date",slug:"format-date"},{level:3,title:"Return currency symbol from currency code",slug:"return-currency-symbol-from-currency-code"},{level:3,title:"Format base price",slug:"format-base-price"},{level:3,title:"Get the config field",slug:"get-the-config-field"},{level:3,title:"Get the config data",slug:"get-the-config-data"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"View Render Event",frontmatter:{},regularPath:"/1.x/advanced/render-event.html",relativePath:"1.x/advanced/render-event.md",key:"v-0359c01b",path:"/1.x/advanced/render-event.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Render View",slug:"render-view"},{level:3,title:"Listening to Events",slug:"listening-to-events"},{level:3,title:"Implementation Details",slug:"implementation-details"},{level:3,title:"Considerations",slug:"considerations"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Best Security Practices",frontmatter:{},regularPath:"/1.x/advanced/security-practice.html",relativePath:"1.x/advanced/security-practice.md",key:"v-7cb2e029",path:"/1.x/advanced/security-practice.html",headers:[{level:2,title:"Software Updates",slug:"software-updates"},{level:2,title:"Limiting Error Messages",slug:"limiting-error-messages"},{level:2,title:"Limiting Admin Access",slug:"limiting-admin-access"},{level:2,title:"Restricting Unnecessary Files",slug:"restricting-unnecessary-files"},{level:2,title:"Restricting PHP Execution Inside Storage",slug:"restricting-php-execution-inside-storage"},{level:2,title:"Server Hardening",slug:"server-hardening"},{level:2,title:"Strong Passwords",slug:"strong-passwords"},{level:2,title:"Implementation of HTTP Security Headers",slug:"implementation-of-http-security-headers"},{level:3,title:"HTTP Strict Transport Security (HSTS)",slug:"http-strict-transport-security-hsts"},{level:3,title:"Cross-Site Scripting Protection (X-XSS Protection)",slug:"cross-site-scripting-protection-x-xss-protection"},{level:3,title:"X-Frame-Options​",slug:"x-frame-options​"},{level:3,title:"X-Content-Type-Options​",slug:"x-content-type-options​"},{level:3,title:"Content Security Policy (CSP)",slug:"content-security-policy-csp"},{level:3,title:"Continuous Logging And Monitoring",slug:"continuous-logging-and-monitoring"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Architecture concepts",frontmatter:{},regularPath:"/1.x/architecture/",relativePath:"1.x/architecture/README.md",key:"v-d80157e0",path:"/1.x/architecture/",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Krayin APIs",frontmatter:{},regularPath:"/1.x/api/getting-started-with-the-api.html",relativePath:"1.x/api/getting-started-with-the-api.md",key:"v-3a964646",path:"/1.x/api/getting-started-with-the-api.html",headers:[{level:2,title:"REST API",slug:"rest-api"},{level:2,title:"Explore REST API Demo",slug:"explore-rest-api-demo"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Krayin APIs",frontmatter:{},regularPath:"/1.x/api/",relativePath:"1.x/api/README.md",key:"v-b3e2f7dc",path:"/1.x/api/",headers:[{level:2,title:"REST API",slug:"rest-api"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Digging Deeper",frontmatter:{},regularPath:"/1.x/advanced/",relativePath:"1.x/advanced/README.md",key:"v-628bc8f0",path:"/1.x/advanced/",headers:[{level:3,title:"Events and Event Handlers",slug:"events-and-event-handlers"},{level:3,title:"Helpers",slug:"helpers"},{level:3,title:"Overriding Core Models",slug:"overriding-core-models"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Repository Pattern in Krayin",frontmatter:{},regularPath:"/1.x/architecture/repository-pattern.html",relativePath:"1.x/architecture/repository-pattern.md",key:"v-f8ff2a8a",path:"/1.x/architecture/repository-pattern.html",headers:[{level:3,title:"Benefits of the Repository Pattern",slug:"benefits-of-the-repository-pattern"},{level:3,title:"Implementation in Krayin",slug:"implementation-in-krayin"},{level:2,title:"Eloquent ORM",slug:"eloquent-orm"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Modular Design in Krayin",frontmatter:{},regularPath:"/1.x/architecture/modular-design.html",relativePath:"1.x/architecture/modular-design.md",key:"v-0648babb",path:"/1.x/architecture/modular-design.html",headers:[{level:2,title:"Key Benefits of Modular Design",slug:"key-benefits-of-modular-design"},{level:2,title:"Module Structure in Krayin",slug:"module-structure-in-krayin"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Packages",frontmatter:{},regularPath:"/1.x/architecture/packages.html",relativePath:"1.x/architecture/packages.md",key:"v-2d5f850a",path:"/1.x/architecture/packages.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Available Packages In Krayin",slug:"available-packages-in-krayin"},{level:3,title:"Admin",slug:"admin"},{level:3,title:"Activity",slug:"activity"},{level:3,title:"Attribute",slug:"attribute"},{level:3,title:"Contact",slug:"contact"},{level:3,title:"Core",slug:"core"},{level:3,title:"Email",slug:"email"},{level:3,title:"EmailTemplate",slug:"emailtemplate"},{level:3,title:"Installer",slug:"installer"},{level:3,title:"Lead",slug:"lead"},{level:3,title:"Product",slug:"product"},{level:3,title:"Quote",slug:"quote"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"UI",slug:"ui"},{level:3,title:"User",slug:"user"},{level:3,title:"WebForm",slug:"webform"},{level:3,title:"Workflow",slug:"workflow"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Custom Attribute Creation",frontmatter:{},regularPath:"/1.x/custom-attributes/",relativePath:"1.x/custom-attributes/README.md",key:"v-3d14d060",path:"/1.x/custom-attributes/",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Theme",frontmatter:{},regularPath:"/1.x/architecture/theme.html",relativePath:"1.x/architecture/theme.md",key:"v-1d0a5d05",path:"/1.x/architecture/theme.html",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Use model with custom Attributes",frontmatter:{},regularPath:"/1.x/custom-attributes/custom-attribute.html",relativePath:"1.x/custom-attributes/custom-attribute.md",key:"v-37d6db67",path:"/1.x/custom-attributes/custom-attribute.html",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Create and using a new attribute",frontmatter:{},regularPath:"/1.x/custom-attributes/uses.html",relativePath:"1.x/custom-attributes/uses.md",key:"v-fb520162",path:"/1.x/custom-attributes/uses.html",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Installation",frontmatter:{},regularPath:"/1.x/introduction/installation.html",relativePath:"1.x/introduction/installation.md",key:"v-a1dfbd8a",path:"/1.x/introduction/installation.html",headers:[{level:2,title:"Install Using Composer",slug:"install-using-composer"},{level:2,title:"Start Using Krayin",slug:"start-using-krayin"},{level:3,title:"On a Production Server",slug:"on-a-production-server"},{level:3,title:"On Your Local Server",slug:"on-your-local-server"},{level:3,title:"Login as an Admin",slug:"login-as-an-admin"},{level:3,title:"Contributing",slug:"contributing"},{level:3,title:"License",slug:"license"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Introduction",frontmatter:{},regularPath:"/1.x/introduction/",relativePath:"1.x/introduction/README.md",key:"v-0606cc70",path:"/1.x/introduction/",headers:[{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Requirements",frontmatter:{},regularPath:"/1.x/introduction/requirements.html",relativePath:"1.x/introduction/requirements.md",key:"v-7cda367b",path:"/1.x/introduction/requirements.html",headers:[{level:2,title:"Server configuration",slug:"server-configuration"},{level:2,title:"PHP Extensions",slug:"php-extensions"},{level:2,title:"PHP Configuration",slug:"php-configuration"},{level:2,title:"Supported Database Servers",slug:"supported-database-servers"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Menu",frontmatter:{},regularPath:"/1.x/packages/add-menu-in-admin.html",relativePath:"1.x/packages/add-menu-in-admin.md",key:"v-49812bde",path:"/1.x/packages/add-menu-in-admin.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Configure the menu",slug:"configure-the-menu"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define Menu Items",slug:"define-menu-items"},{level:3,title:"Define Routes",slug:"define-routes"},{level:3,title:"Add Menu Icon",slug:"add-menu-icon"},{level:3,title:"Merge Configuration",slug:"merge-configuration"},{level:3,title:"Optimize Application",slug:"optimize-application"},{level:2,title:"Level of Menu",slug:"level-of-menu"},{level:3,title:"First Level (Sidebar)",slug:"first-level-sidebar"},{level:3,title:"Second Level (Hover Menu)",slug:"second-level-hover-menu"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Package Development",frontmatter:{},regularPath:"/1.x/packages/",relativePath:"1.x/packages/README.md",key:"v-97db1d60",path:"/1.x/packages/",headers:[{level:2,title:"Package Development",slug:"package-development"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Bundling Assets",frontmatter:{},regularPath:"/1.x/packages/assets.html",relativePath:"1.x/packages/assets.md",key:"v-81282f8a",path:"/1.x/packages/assets.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:2,title:"Configure Compiling Assets",slug:"configure-compiling-assets"},{level:2,title:"Create Configuration Files",slug:"create-configuration-files"},{level:3,title:"Set Up package.json",slug:"set-up-package-json"},{level:3,title:"Set Up webpack.mix.js",slug:"set-up-webpack-mix-js"},{level:3,title:"Importing Laravel Mix",slug:"importing-laravel-mix"},{level:3,title:"Merging Manifests",slug:"merging-manifests"},{level:3,title:"Setting the Public Path",slug:"setting-the-public-path"},{level:3,title:"Mix Configuration",slug:"mix-configuration"},{level:3,title:"Asset Compilation",slug:"asset-compilation"},{level:3,title:"Webpack Configuration",slug:"webpack-configuration"},{level:3,title:"Source Maps",slug:"source-maps"},{level:3,title:"Versioning",slug:"versioning"},{level:2,title:"Load Assets in Blade File",slug:"load-assets-in-blade-file"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Controller",frontmatter:{},regularPath:"/1.x/packages/controllers.html",relativePath:"1.x/packages/controllers.md",key:"v-9436f116",path:"/1.x/packages/controllers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"How to create Controllers",slug:"how-to-create-controllers"},{level:3,title:"Directory Structure",slug:"directory-structure"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Access Control List",frontmatter:{},regularPath:"/1.x/packages/create-acl.html",relativePath:"1.x/packages/create-acl.md",key:"v-3d32147b",path:"/1.x/packages/create-acl.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define ACL Configuration",slug:"define-acl-configuration"},{level:2,title:"Merge ACL Configuration",slug:"merge-acl-configuration"},{level:3,title:"Modify Service Provider",slug:"modify-service-provider"},{level:3,title:"Register Method",slug:"register-method"},{level:3,title:"Clear Configuration Cache",slug:"clear-configuration-cache"},{level:3,title:"Verify in Admin Panel",slug:"verify-in-admin-panel"},{level:2,title:"Checking Roles and Permissions",slug:"checking-roles-and-permissions"},{level:3,title:"Access Roles",slug:"access-roles"},{level:3,title:"Permission Checks",slug:"permission-checks"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Migrations",frontmatter:{},regularPath:"/1.x/packages/create-migrations.html",relativePath:"1.x/packages/create-migrations.md",key:"v-43c25037",path:"/1.x/packages/create-migrations.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Loading Migration from Package",slug:"loading-migration-from-package"},{level:3,title:"Creating Tables from Migrations",slug:"creating-tables-from-migrations"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Models",frontmatter:{},regularPath:"/1.x/packages/create-models.html",relativePath:"1.x/packages/create-models.md",key:"v-3098292d",path:"/1.x/packages/create-models.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Create the Contract",slug:"create-the-contract"},{level:3,title:"Create the Proxy",slug:"create-the-proxy"},{level:3,title:"Create the Model",slug:"create-the-model"},{level:3,title:"Create Module Service Provider",slug:"create-module-service-provider"},{level:3,title:"Registering ModuleServiceProvider",slug:"registering-moduleserviceprovider"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Getting Started",frontmatter:{},regularPath:"/1.x/packages/create-package.html",relativePath:"1.x/packages/create-package.md",key:"v-43d3637b",path:"/1.x/packages/create-package.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Registering Your Package",slug:"registering-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands"},{level:2,title:"Manual Setup of Files",slug:"manual-setup-of-files"},{level:3,title:"Create Package Directory",slug:"create-package-directory"},{level:3,title:"Create Service Provider",slug:"create-service-provider"},{level:3,title:"Register Your Package",slug:"register-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands-2"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"DataGrid",frontmatter:{},regularPath:"/1.x/packages/datagrid.html",relativePath:"1.x/packages/datagrid.md",key:"v-67061e4a",path:"/1.x/packages/datagrid.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Global Properties of DataGrid",slug:"global-properties-of-datagrid"},{level:2,title:"How DataGrid Works",slug:"how-datagrid-works"},{level:2,title:"Multiple DataGrids",slug:"multiple-datagrids"},{level:3,title:"DataGrid to JSON",slug:"datagrid-to-json"},{level:3,title:"Render DataGrid",slug:"render-datagrid"},{level:2,title:"Sample DataGrid",slug:"sample-datagrid"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Localization",frontmatter:{},regularPath:"/1.x/packages/localization.html",relativePath:"1.x/packages/localization.md",key:"v-253dcc3b",path:"/1.x/packages/localization.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Publishing the Language Files",slug:"publishing-the-language-files"},{level:2,title:"Configuring the Locale",slug:"configuring-the-locale"},{level:2,title:"Create a new Locale",slug:"create-a-new-locale"},{level:3,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Writing a Translation in app.php",slug:"writing-a-translation-in-app-php"},{level:2,title:"Load Translation from Package",slug:"load-translation-from-package"},{level:3,title:"Update the Service Provider",slug:"update-the-service-provider"},{level:3,title:"Use Translations in Blade Files",slug:"use-translations-in-blade-files"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Layouts",frontmatter:{},regularPath:"/1.x/packages/layouts.html",relativePath:"1.x/packages/layouts.md",key:"v-87d9c7de",path:"/1.x/packages/layouts.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Category Layout",slug:"category-layout"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Routes",frontmatter:{},regularPath:"/1.x/packages/routes.html",relativePath:"1.x/packages/routes.md",key:"v-4e564c1b",path:"/1.x/packages/routes.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Create a new Route",slug:"create-a-new-route"},{level:3,title:"Routes",slug:"routes-2"},{level:2,title:"Loading Routes",slug:"loading-routes"},{level:3,title:"Register Routes in ServiceProvider",slug:"register-routes-in-serviceprovider"},{level:2,title:"Available HTTP methods",slug:"available-http-methods"},{level:3,title:"GET",slug:"get"},{level:3,title:"POST",slug:"post"},{level:3,title:"PUT",slug:"put"},{level:3,title:"DELETE",slug:"delete"},{level:3,title:"PATCH",slug:"patch"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Validation",frontmatter:{},regularPath:"/1.x/packages/validation.html",relativePath:"1.x/packages/validation.md",key:"v-32163c7b",path:"/1.x/packages/validation.html",headers:[{level:2,title:"Validation Using Laravel",slug:"validation-using-laravel"},{level:3,title:"Introduction",slug:"introduction"},{level:3,title:"Usage",slug:"usage"},{level:2,title:"Validation Using Vue",slug:"validation-using-vue"},{level:3,title:"Introduction",slug:"introduction-2"},{level:3,title:"Installation",slug:"installation"},{level:3,title:"Configuration",slug:"configuration"},{level:3,title:"Examples",slug:"examples"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Views",frontmatter:{},regularPath:"/1.x/packages/views.html",relativePath:"1.x/packages/views.md",key:"v-53650bf2",path:"/1.x/packages/views.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Adding HTML Content",slug:"adding-html-content"},{level:2,title:"Load Views from Package",slug:"load-views-from-package"},{level:2,title:"Rendering Views",slug:"rendering-views"},{level:2,title:"Blade File Naming Convention",slug:"blade-file-naming-convention"},{level:3,title:"Listing (Index Blade):",slug:"listing-index-blade"},{level:3,title:"Creation (Create Blade):",slug:"creation-create-blade"},{level:3,title:"Updating (Edit Blade):",slug:"updating-edit-blade"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Repositories",frontmatter:{},regularPath:"/1.x/packages/store-data-through-repositories.html",relativePath:"1.x/packages/store-data-through-repositories.md",key:"v-5ab843d6",path:"/1.x/packages/store-data-through-repositories.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Dependency Injection",slug:"dependency-injection"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Create a New Repository Class",slug:"create-a-new-repository-class"},{level:3,title:"Explanation",slug:"explanation"},{level:2,title:"Manually Setting Up Repository Files",slug:"manually-setting-up-repository-files"},{level:3,title:"Setting Up CategoryRepository in Webkul/Category Package",slug:"setting-up-categoryrepository-in-webkul-category-package"},{level:2,title:"Available Methods",slug:"available-methods"},{level:3,title:"all",slug:"all"},{level:3,title:"Find",slug:"find"},{level:3,title:"FindOrFail",slug:"findorfail"},{level:3,title:"Create",slug:"create"},{level:3,title:"Update",slug:"update"},{level:3,title:"Delete",slug:"delete"},{level:3,title:"Paginate",slug:"paginate"},{level:3,title:"FindWhere",slug:"findwhere"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Digging Deeper",frontmatter:{},regularPath:"/2.0/advanced/",relativePath:"2.0/advanced/README.md",key:"v-97e6ce60",path:"/2.0/advanced/",headers:[{level:3,title:"Events and Event Handlers",slug:"events-and-event-handlers"},{level:3,title:"Helpers",slug:"helpers"},{level:3,title:"Overriding Core Models",slug:"overriding-core-models"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{frontmatter:{},regularPath:"/2.0/advanced/email-inbound-parse.html",relativePath:"2.0/advanced/email-inbound-parse.md",key:"v-22174a62",path:"/2.0/advanced/email-inbound-parse.html",headers:[{level:3,title:"SendGrid Inbound Parse",slug:"sendgrid-inbound-parse"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Override Core Model",frontmatter:{},regularPath:"/2.0/advanced/override-core-model.html",relativePath:"2.0/advanced/override-core-model.md",key:"v-257fce1a",path:"/2.0/advanced/override-core-model.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Overriding a Model Class",slug:"overriding-a-model-class"},{level:3,title:"Define an Interface (Contract)",slug:"define-an-interface-contract"},{level:3,title:"Register the Model Override",slug:"register-the-model-override"},{level:3,title:"Implement the Custom Model Class",slug:"implement-the-custom-model-class"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Events",frontmatter:{},regularPath:"/2.0/advanced/events.html",relativePath:"2.0/advanced/events.md",key:"v-3b63817b",path:"/2.0/advanced/events.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Creating an Event Class",slug:"creating-an-event-class"},{level:3,title:"Using Package Generator",slug:"using-package-generator"},{level:3,title:"Manually Registering Events",slug:"manually-registering-events"},{level:3,title:"Manually Registering Listeners",slug:"manually-registering-listeners"},{level:2,title:"Specifying Events",slug:"specifying-events"},{level:2,title:"Events Fired in Krayin",slug:"events-fired-in-krayin"},{level:2,title:"Listening to Existing Events",slug:"listening-to-existing-events"},{level:3,title:"Registering a Listener",slug:"registering-a-listener"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Helpers",frontmatter:{},regularPath:"/2.0/advanced/helpers.html",relativePath:"2.0/advanced/helpers.md",key:"v-3f10e261",path:"/2.0/advanced/helpers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Core Helpers",slug:"core-helpers"},{level:3,title:"Get the lists of timezone",slug:"get-the-lists-of-timezone"},{level:3,title:"Get the list of available locals",slug:"get-the-list-of-available-locals"},{level:3,title:"Get the list of countries",slug:"get-the-list-of-countries"},{level:3,title:"Get the country name",slug:"get-the-country-name"},{level:3,title:"Get the available states associated with country code",slug:"get-the-available-states-associated-with-country-code"},{level:3,title:"Get the specified state name associated with state code",slug:"get-the-specified-state-name-associated-with-state-code"},{level:3,title:"Get the Grouped the states by the countries",slug:"get-the-grouped-the-states-by-the-countries"},{level:3,title:"To Sort the items",slug:"to-sort-the-items"},{level:3,title:"Create singleton object through single facade",slug:"create-singleton-object-through-single-facade"},{level:3,title:"Format Date",slug:"format-date"},{level:3,title:"Return currency symbol from currency code",slug:"return-currency-symbol-from-currency-code"},{level:3,title:"Format base price",slug:"format-base-price"},{level:3,title:"Get the config field",slug:"get-the-config-field"},{level:3,title:"Get the config data",slug:"get-the-config-data"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Krayin APIs",frontmatter:{},regularPath:"/2.0/api/",relativePath:"2.0/api/README.md",key:"v-97082ec0",path:"/2.0/api/",headers:[{level:2,title:"REST API",slug:"rest-api"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Best Security Practices",frontmatter:{},regularPath:"/2.0/advanced/security-practice.html",relativePath:"2.0/advanced/security-practice.md",key:"v-bc74fe4a",path:"/2.0/advanced/security-practice.html",headers:[{level:2,title:"Software Updates",slug:"software-updates"},{level:2,title:"Limiting Error Messages",slug:"limiting-error-messages"},{level:2,title:"Limiting Admin Access",slug:"limiting-admin-access"},{level:2,title:"Restricting Unnecessary Files",slug:"restricting-unnecessary-files"},{level:2,title:"Restricting PHP Execution Inside Storage",slug:"restricting-php-execution-inside-storage"},{level:2,title:"Server Hardening",slug:"server-hardening"},{level:2,title:"Strong Passwords",slug:"strong-passwords"},{level:2,title:"Implementation of HTTP Security Headers",slug:"implementation-of-http-security-headers"},{level:3,title:"HTTP Strict Transport Security (HSTS)",slug:"http-strict-transport-security-hsts"},{level:3,title:"Cross-Site Scripting Protection (X-XSS Protection)",slug:"cross-site-scripting-protection-x-xss-protection"},{level:3,title:"X-Frame-Options​",slug:"x-frame-options​"},{level:3,title:"X-Content-Type-Options​",slug:"x-content-type-options​"},{level:3,title:"Content Security Policy (CSP)",slug:"content-security-policy-csp"},{level:3,title:"Continuous Logging And Monitoring",slug:"continuous-logging-and-monitoring"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Krayin APIs",frontmatter:{},regularPath:"/2.0/api/getting-started-with-the-api.html",relativePath:"2.0/api/getting-started-with-the-api.md",key:"v-77ed9d62",path:"/2.0/api/getting-started-with-the-api.html",headers:[{level:2,title:"REST API",slug:"rest-api"},{level:2,title:"Explore REST API Demo",slug:"explore-rest-api-demo"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Architecture concepts",frontmatter:{},regularPath:"/2.0/architecture/",relativePath:"2.0/architecture/README.md",key:"v-4d68c870",path:"/2.0/architecture/",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"View Render Event",frontmatter:{},regularPath:"/2.0/advanced/render-event.html",relativePath:"2.0/advanced/render-event.md",key:"v-6f60c50a",path:"/2.0/advanced/render-event.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Render View",slug:"render-view"},{level:3,title:"Listening to Events",slug:"listening-to-events"},{level:3,title:"Implementation Details",slug:"implementation-details"},{level:3,title:"Considerations",slug:"considerations"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Modular Design in Krayin",frontmatter:{},regularPath:"/2.0/architecture/modular-design.html",relativePath:"2.0/architecture/modular-design.md",key:"v-4dd4215b",path:"/2.0/architecture/modular-design.html",headers:[{level:2,title:"Key Benefits of Modular Design",slug:"key-benefits-of-modular-design"},{level:2,title:"Module Structure in Krayin",slug:"module-structure-in-krayin"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Packages",frontmatter:{},regularPath:"/2.0/architecture/packages.html",relativePath:"2.0/architecture/packages.md",key:"v-a373ca4a",path:"/2.0/architecture/packages.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Available Packages In Krayin",slug:"available-packages-in-krayin"},{level:3,title:"Admin",slug:"admin"},{level:3,title:"Activity",slug:"activity"},{level:3,title:"Attribute",slug:"attribute"},{level:3,title:"Contact",slug:"contact"},{level:3,title:"Core",slug:"core"},{level:3,title:"Email",slug:"email"},{level:3,title:"EmailTemplate",slug:"emailtemplate"},{level:3,title:"Installer",slug:"installer"},{level:3,title:"Lead",slug:"lead"},{level:3,title:"Product",slug:"product"},{level:3,title:"Quote",slug:"quote"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"User",slug:"user"},{level:3,title:"WebForm",slug:"webform"},{level:3,title:"Automation",slug:"automation"},{level:3,title:"Datagrid",slug:"datagrid"},{level:3,title:"Warehouse",slug:"warehouse"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Repository Pattern in Krayin",frontmatter:{},regularPath:"/2.0/architecture/repository-pattern.html",relativePath:"2.0/architecture/repository-pattern.md",key:"v-48779cdb",path:"/2.0/architecture/repository-pattern.html",headers:[{level:3,title:"Benefits of the Repository Pattern",slug:"benefits-of-the-repository-pattern"},{level:3,title:"Implementation in Krayin",slug:"implementation-in-krayin"},{level:2,title:"Eloquent ORM",slug:"eloquent-orm"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Theme",frontmatter:{},regularPath:"/2.0/architecture/theme.html",relativePath:"2.0/architecture/theme.md",key:"v-923fce92",path:"/2.0/architecture/theme.html",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Custom Attribute Creation",frontmatter:{},regularPath:"/2.0/custom-attributes/",relativePath:"2.0/custom-attributes/README.md",key:"v-597357a4",path:"/2.0/custom-attributes/",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Create and using a new attribute",frontmatter:{},regularPath:"/2.0/custom-attributes/uses.html",relativePath:"2.0/custom-attributes/uses.md",key:"v-001b8d81",path:"/2.0/custom-attributes/uses.html",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Use model with custom Attributes",frontmatter:{},regularPath:"/2.0/custom-attributes/custom-attribute.html",relativePath:"2.0/custom-attributes/custom-attribute.md",key:"v-2d236119",path:"/2.0/custom-attributes/custom-attribute.html",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Introduction",frontmatter:{},regularPath:"/2.0/introduction/",relativePath:"2.0/introduction/README.md",key:"v-811f7e60",path:"/2.0/introduction/",headers:[{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Installation",frontmatter:{},regularPath:"/2.0/introduction/installation.html",relativePath:"2.0/introduction/installation.md",key:"v-c6f4abca",path:"/2.0/introduction/installation.html",headers:[{level:2,title:"Install Using GUI Installer",slug:"install-using-gui-installer"},{level:2,title:"Install Using Composer",slug:"install-using-composer"},{level:2,title:"Start Using Krayin",slug:"start-using-krayin"},{level:3,title:"On a Production Server",slug:"on-a-production-server"},{level:3,title:"On Your Local Server",slug:"on-your-local-server"},{level:3,title:"Login as an Admin",slug:"login-as-an-admin"},{level:3,title:"Contributing",slug:"contributing"},{level:3,title:"License",slug:"license"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Docker",frontmatter:{},regularPath:"/2.0/introduction/docker.html",relativePath:"2.0/introduction/docker.md",key:"v-65c09c5b",path:"/2.0/introduction/docker.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Docker Setup for Krayin",slug:"docker-setup-for-krayin"},{level:3,title:"1. Using Krayin Docker Image from Docker Hub",slug:"_1-using-krayin-docker-image-from-docker-hub"},{level:3,title:"2. Using Krayin GitHub Docker Repository",slug:"_2-using-krayin-github-docker-repository"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Package Development",frontmatter:{},regularPath:"/2.0/packages/",relativePath:"2.0/packages/README.md",key:"v-05934130",path:"/2.0/packages/",headers:[{level:2,title:"Package Development",slug:"package-development"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Requirements",frontmatter:{},regularPath:"/2.0/introduction/requirements.html",relativePath:"2.0/introduction/requirements.md",key:"v-6a4fbf5b",path:"/2.0/introduction/requirements.html",headers:[{level:2,title:"Server configuration",slug:"server-configuration"},{level:2,title:"PHP Extensions",slug:"php-extensions"},{level:2,title:"PHP Configuration",slug:"php-configuration"},{level:2,title:"Supported Database Servers",slug:"supported-database-servers"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Menu",frontmatter:{},regularPath:"/2.0/packages/add-menu-in-admin.html",relativePath:"2.0/packages/add-menu-in-admin.md",key:"v-00520ac3",path:"/2.0/packages/add-menu-in-admin.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Configure the menu",slug:"configure-the-menu"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define Menu Items",slug:"define-menu-items"},{level:3,title:"Define Routes",slug:"define-routes"},{level:3,title:"Add Menu Icon",slug:"add-menu-icon"},{level:3,title:"Merge Configuration",slug:"merge-configuration"},{level:3,title:"Optimize Application",slug:"optimize-application"},{level:2,title:"Level of Menu",slug:"level-of-menu"},{level:3,title:"First Level (Sidebar)",slug:"first-level-sidebar"},{level:3,title:"Second Level (Hover Menu)",slug:"second-level-hover-menu"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Controller",frontmatter:{},regularPath:"/2.0/packages/controllers.html",relativePath:"2.0/packages/controllers.md",key:"v-4643c467",path:"/2.0/packages/controllers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"How to create Controllers",slug:"how-to-create-controllers"},{level:3,title:"Directory Structure",slug:"directory-structure"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Blade Components",frontmatter:{},regularPath:"/2.0/packages/blade-components.html",relativePath:"2.0/packages/blade-components.md",key:"v-2607b25b",path:"/2.0/packages/blade-components.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Components",slug:"components"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"Avatar",slug:"avatar"},{level:3,title:"Activities",slug:"activities"},{level:3,title:"Lookup",slug:"lookup"},{level:3,title:"Attachment",slug:"attachment"},{level:3,title:"Inline Editable",slug:"inline-editable"},{level:3,title:"Accordion",slug:"accordion"},{level:3,title:"Button",slug:"button"},{level:3,title:"Drawer",slug:"drawer"},{level:3,title:"Dropdown",slug:"dropdown"},{level:3,title:"Flat-Picker",slug:"flat-picker"},{level:3,title:"Data Grid",slug:"data-grid"},{level:3,title:"Tinymce",slug:"tinymce"},{level:3,title:"Shimmer",slug:"shimmer"},{level:3,title:"Table",slug:"table"},{level:3,title:"Modal",slug:"modal"},{level:3,title:"Tree",slug:"tree"},{level:3,title:"Media",slug:"media"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Bundling Assets",frontmatter:{},regularPath:"/2.0/packages/assets.html",relativePath:"2.0/packages/assets.md",key:"v-43d7274a",path:"/2.0/packages/assets.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:2,title:"Configure Compiling Assets",slug:"configure-compiling-assets"},{level:2,title:"Create Configuration Files",slug:"create-configuration-files"},{level:3,title:"Set Up package.json",slug:"set-up-package-json"},{level:3,title:"Set Up webpack.mix.js",slug:"set-up-webpack-mix-js"},{level:3,title:"Importing Laravel Mix",slug:"importing-laravel-mix"},{level:3,title:"Merging Manifests",slug:"merging-manifests"},{level:3,title:"Setting the Public Path",slug:"setting-the-public-path"},{level:3,title:"Mix Configuration",slug:"mix-configuration"},{level:3,title:"Asset Compilation",slug:"asset-compilation"},{level:3,title:"Webpack Configuration",slug:"webpack-configuration"},{level:3,title:"Source Maps",slug:"source-maps"},{level:3,title:"Versioning",slug:"versioning"},{level:2,title:"Load Assets in Blade File",slug:"load-assets-in-blade-file"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Access Control List",frontmatter:{},regularPath:"/2.0/packages/create-acl.html",relativePath:"2.0/packages/create-acl.md",key:"v-19b6241b",path:"/2.0/packages/create-acl.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define ACL Configuration",slug:"define-acl-configuration"},{level:2,title:"Merge ACL Configuration",slug:"merge-acl-configuration"},{level:3,title:"Modify Service Provider",slug:"modify-service-provider"},{level:3,title:"Register Method",slug:"register-method"},{level:3,title:"Clear Configuration Cache",slug:"clear-configuration-cache"},{level:3,title:"Verify in Admin Panel",slug:"verify-in-admin-panel"},{level:2,title:"Checking Roles and Permissions",slug:"checking-roles-and-permissions"},{level:3,title:"Access Roles",slug:"access-roles"},{level:3,title:"Permission Checks",slug:"permission-checks"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Migrations",frontmatter:{},regularPath:"/2.0/packages/create-migrations.html",relativePath:"2.0/packages/create-migrations.md",key:"v-68d4f0e9",path:"/2.0/packages/create-migrations.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Loading Migration from Package",slug:"loading-migration-from-package"},{level:3,title:"Creating Tables from Migrations",slug:"creating-tables-from-migrations"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Models",frontmatter:{},regularPath:"/2.0/packages/create-models.html",relativePath:"2.0/packages/create-models.md",key:"v-a3469142",path:"/2.0/packages/create-models.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Create the Contract",slug:"create-the-contract"},{level:3,title:"Create the Proxy",slug:"create-the-proxy"},{level:3,title:"Create the Model",slug:"create-the-model"},{level:3,title:"Create Module Service Provider",slug:"create-module-service-provider"},{level:3,title:"Registering ModuleServiceProvider",slug:"registering-moduleserviceprovider"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Getting Started",frontmatter:{},regularPath:"/2.0/packages/create-package.html",relativePath:"2.0/packages/create-package.md",key:"v-1dedbe9b",path:"/2.0/packages/create-package.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Registering Your Package",slug:"registering-your-package"},{level:3,title:"Registering Your Package Using CLI",slug:"registering-your-package-using-cli"},{level:3,title:"Run the Commands",slug:"run-the-commands"},{level:2,title:"Manual Setup of Files",slug:"manual-setup-of-files"},{level:3,title:"Create Package Directory",slug:"create-package-directory"},{level:3,title:"Create Service Provider",slug:"create-service-provider"},{level:3,title:"Register Your Package",slug:"register-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands-2"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Layouts",frontmatter:{},regularPath:"/2.0/packages/layouts.html",relativePath:"2.0/packages/layouts.md",key:"v-577f2683",path:"/2.0/packages/layouts.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Category Layout",slug:"category-layout"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Localization",frontmatter:{},regularPath:"/2.0/packages/localization.html",relativePath:"2.0/packages/localization.md",key:"v-2b98acca",path:"/2.0/packages/localization.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Publishing the Language Files",slug:"publishing-the-language-files"},{level:2,title:"Configuring the Locale",slug:"configuring-the-locale"},{level:2,title:"Create a new Locale",slug:"create-a-new-locale"},{level:3,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Writing a Translation in app.php",slug:"writing-a-translation-in-app-php"},{level:2,title:"Load Translation from Package",slug:"load-translation-from-package"},{level:3,title:"Update the Service Provider",slug:"update-the-service-provider"},{level:3,title:"Use Translations in Blade Files",slug:"use-translations-in-blade-files"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"DataGrid",frontmatter:{},regularPath:"/2.0/packages/datagrid.html",relativePath:"2.0/packages/datagrid.md",key:"v-52bde2bb",path:"/2.0/packages/datagrid.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Global Properties of DataGrid",slug:"global-properties-of-datagrid"},{level:2,title:"How DataGrid Works",slug:"how-datagrid-works"},{level:2,title:"Multiple DataGrids",slug:"multiple-datagrids"},{level:3,title:"DataGrid to JSON",slug:"datagrid-to-json"},{level:3,title:"Render DataGrid",slug:"render-datagrid"},{level:2,title:"Sample DataGrid",slug:"sample-datagrid"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Routes",frontmatter:{},regularPath:"/2.0/packages/routes.html",relativePath:"2.0/packages/routes.md",key:"v-6cfed03b",path:"/2.0/packages/routes.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Create a new Route",slug:"create-a-new-route"},{level:3,title:"Routes",slug:"routes-2"},{level:2,title:"Loading Routes",slug:"loading-routes"},{level:3,title:"Register Routes in ServiceProvider",slug:"register-routes-in-serviceprovider"},{level:2,title:"Available HTTP methods",slug:"available-http-methods"},{level:3,title:"GET",slug:"get"},{level:3,title:"POST",slug:"post"},{level:3,title:"PUT",slug:"put"},{level:3,title:"DELETE",slug:"delete"},{level:3,title:"PATCH",slug:"patch"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Repositories",frontmatter:{},regularPath:"/2.0/packages/store-data-through-repositories.html",relativePath:"2.0/packages/store-data-through-repositories.md",key:"v-b87050f2",path:"/2.0/packages/store-data-through-repositories.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Dependency Injection",slug:"dependency-injection"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Create a New Repository Class",slug:"create-a-new-repository-class"},{level:3,title:"Explanation",slug:"explanation"},{level:2,title:"Manually Setting Up Repository Files",slug:"manually-setting-up-repository-files"},{level:3,title:"Setting Up CategoryRepository in Webkul/Category Package",slug:"setting-up-categoryrepository-in-webkul-category-package"},{level:2,title:"Available Methods",slug:"available-methods"},{level:3,title:"all",slug:"all"},{level:3,title:"Find",slug:"find"},{level:3,title:"FindOrFail",slug:"findorfail"},{level:3,title:"Create",slug:"create"},{level:3,title:"Update",slug:"update"},{level:3,title:"Delete",slug:"delete"},{level:3,title:"Paginate",slug:"paginate"},{level:3,title:"FindWhere",slug:"findwhere"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Validation",frontmatter:{},regularPath:"/2.0/packages/validation.html",relativePath:"2.0/packages/validation.md",key:"v-0e9a4c1b",path:"/2.0/packages/validation.html",headers:[{level:2,title:"Validation Using Laravel",slug:"validation-using-laravel"},{level:3,title:"Introduction",slug:"introduction"},{level:3,title:"Usage",slug:"usage"},{level:2,title:"Validation Using Vue",slug:"validation-using-vue"},{level:3,title:"Introduction",slug:"introduction-2"},{level:3,title:"Installation",slug:"installation"},{level:3,title:"Configuration",slug:"configuration"},{level:3,title:"Examples",slug:"examples"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Prologue",frontmatter:{},regularPath:"/2.0/prologue/",relativePath:"2.0/prologue/README.md",key:"v-0c08fe70",path:"/2.0/prologue/",headers:[{level:2,title:"Introduction to Krayin",slug:"introduction-to-krayin"},{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Views",frontmatter:{},regularPath:"/2.0/packages/views.html",relativePath:"2.0/packages/views.md",key:"v-9498b98e",path:"/2.0/packages/views.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Adding HTML Content",slug:"adding-html-content"},{level:2,title:"Load Views from Package",slug:"load-views-from-package"},{level:2,title:"Rendering Views",slug:"rendering-views"},{level:2,title:"Blade File Naming Convention",slug:"blade-file-naming-convention"},{level:3,title:"Listing (Index Blade):",slug:"listing-index-blade"},{level:3,title:"Creation (Create Blade):",slug:"creation-create-blade"},{level:3,title:"Updating (Edit Blade):",slug:"updating-edit-blade"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Contribution Guide",frontmatter:{},regularPath:"/2.0/prologue/contribution-guide.html",relativePath:"2.0/prologue/contribution-guide.md",key:"v-4b11a99b",path:"/2.0/prologue/contribution-guide.html",headers:[{level:2,title:"Bug Reports",slug:"bug-reports"},{level:2,title:"Projects to Contribute",slug:"projects-to-contribute"},{level:2,title:"Feature Requests",slug:"feature-requests"},{level:2,title:"Branch Selection",slug:"branch-selection"},{level:2,title:"Compiled Assets",slug:"compiled-assets"},{level:2,title:"Tailwind Class Reordering",slug:"tailwind-class-reordering"},{level:2,title:"Pint Tests",slug:"pint-tests"},{level:2,title:"Security Vulnerabilities",slug:"security-vulnerabilities"},{level:2,title:"Coding Style",slug:"coding-style"},{level:2,title:"PHPDoc",slug:"phpdoc"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Upgrade Guide",frontmatter:{},regularPath:"/2.0/prologue/upgrade-guide.html",relativePath:"2.0/prologue/upgrade-guide.md",key:"v-2888eb6a",path:"/2.0/prologue/upgrade-guide.html",headers:[{level:2,title:"Upgrade Steps",slug:"upgrade-steps"},{level:2,title:"New Changes",slug:"new-changes"},{level:3,title:"Changes in the latest release",slug:"changes-in-the-latest-release"},{level:2,title:"Composer Dependencies",slug:"composer-dependencies-2"},{level:3,title:"Differences in Composer Dependencies",slug:"differences-in-composer-dependencies"},{level:3,title:"Differences in Development Dependencies",slug:"differences-in-development-dependencies"},{level:3,title:"Differences in Autoloading",slug:"differences-in-autoloading"},{level:3,title:"Summary of Changes",slug:"summary-of-changes"},{level:3,title:"Upgrade Instructions",slug:"upgrade-instructions"},{level:3,title:"Conclusion",slug:"conclusion"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Digging Deeper",frontmatter:{},regularPath:"/master/advanced/",relativePath:"master/advanced/README.md",key:"v-7ea5c780",path:"/master/advanced/",headers:[{level:3,title:"Events and Event Handlers",slug:"events-and-event-handlers"},{level:3,title:"Helpers",slug:"helpers"},{level:3,title:"Overriding Core Models",slug:"overriding-core-models"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Home",frontmatter:{home:!0,heroText:"Krayin CRM Developer Portal",tagline:"Find detailed documentation and code examples.",actionText:"Get Started →",actionLink:"/2.0/introduction/",features:[{title:"Package creation",details:"Learn how to create a new package for Krayin."},{title:"Digging Deeper",details:"Learn advanced topics like payment methods, shipping methods."},{title:"API documentation",details:"Learn how to connect your existing systems with the Krayin API."}],footer:"Copyright © 2024 Krayin"},regularPath:"/",relativePath:"README.md",key:"v-fb9fdb00",path:"/",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{frontmatter:{},regularPath:"/master/advanced/data-transfer.html",relativePath:"master/advanced/data-transfer.md",key:"v-3042924a",path:"/master/advanced/data-transfer.html",headers:[{level:3,title:"Introduction",slug:"introduction"},{level:3,title:"Features",slug:"features"},{level:3,title:"Usage",slug:"usage"},{level:3,title:"Validation",slug:"validation"},{level:3,title:"Error Handling",slug:"error-handling"},{level:3,title:"CRUD Actions",slug:"crud-actions"},{level:3,title:"Edit Import Data",slug:"edit-import-data"},{level:3,title:"Queue Configuration",slug:"queue-configuration"},{level:3,title:"Conclusion",slug:"conclusion"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{frontmatter:{},regularPath:"/master/advanced/email-inbound-parse.html",relativePath:"master/advanced/email-inbound-parse.md",key:"v-761748db",path:"/master/advanced/email-inbound-parse.html",headers:[{level:3,title:"SendGrid Inbound Parse",slug:"sendgrid-inbound-parse"},{level:3,title:"IMAP Inbound Parse",slug:"imap-inbound-parse"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Events",frontmatter:{},regularPath:"/master/advanced/events.html",relativePath:"master/advanced/events.md",key:"v-6c9aa255",path:"/master/advanced/events.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Creating an Event Class",slug:"creating-an-event-class"},{level:3,title:"Using Package Generator",slug:"using-package-generator"},{level:3,title:"Manually Registering Events",slug:"manually-registering-events"},{level:3,title:"Manually Registering Listeners",slug:"manually-registering-listeners"},{level:2,title:"Specifying Events",slug:"specifying-events"},{level:2,title:"Events Fired in Krayin",slug:"events-fired-in-krayin"},{level:2,title:"Listening to Existing Events",slug:"listening-to-existing-events"},{level:3,title:"Registering a Listener",slug:"registering-a-listener"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Helpers",frontmatter:{},regularPath:"/master/advanced/helpers.html",relativePath:"master/advanced/helpers.md",key:"v-1f119f3b",path:"/master/advanced/helpers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Core Helpers",slug:"core-helpers"},{level:3,title:"Get the lists of timezone",slug:"get-the-lists-of-timezone"},{level:3,title:"Get the list of available locals",slug:"get-the-list-of-available-locals"},{level:3,title:"Get the list of countries",slug:"get-the-list-of-countries"},{level:3,title:"Get the country name",slug:"get-the-country-name"},{level:3,title:"Get the available states associated with country code",slug:"get-the-available-states-associated-with-country-code"},{level:3,title:"Get the specified state name associated with state code",slug:"get-the-specified-state-name-associated-with-state-code"},{level:3,title:"Get the Grouped the states by the countries",slug:"get-the-grouped-the-states-by-the-countries"},{level:3,title:"Create singleton object through single facade",slug:"create-singleton-object-through-single-facade"},{level:3,title:"Format Date",slug:"format-date"},{level:3,title:"Return currency symbol from currency code",slug:"return-currency-symbol-from-currency-code"},{level:3,title:"Format base price",slug:"format-base-price"},{level:3,title:"Get the config field",slug:"get-the-config-field"},{level:3,title:"Get the config data",slug:"get-the-config-data"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Override Core Model",frontmatter:{},regularPath:"/master/advanced/override-core-model.html",relativePath:"master/advanced/override-core-model.md",key:"v-35006eca",path:"/master/advanced/override-core-model.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Overriding a Model Class",slug:"overriding-a-model-class"},{level:3,title:"Define an Interface (Contract)",slug:"define-an-interface-contract"},{level:3,title:"Register the Model Override",slug:"register-the-model-override"},{level:3,title:"Implement the Custom Model Class",slug:"implement-the-custom-model-class"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Krayin APIs",frontmatter:{},regularPath:"/master/api/",relativePath:"master/api/README.md",key:"v-75c7df60",path:"/master/api/",headers:[{level:2,title:"REST API",slug:"rest-api"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"View Render Event",frontmatter:{},regularPath:"/master/advanced/render-event.html",relativePath:"master/advanced/render-event.md",key:"v-cc8367fe",path:"/master/advanced/render-event.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Render View",slug:"render-view"},{level:3,title:"Listening to Events",slug:"listening-to-events"},{level:3,title:"Implementation Details",slug:"implementation-details"},{level:3,title:"Considerations",slug:"considerations"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Krayin APIs",frontmatter:{},regularPath:"/master/api/getting-started-with-the-api.html",relativePath:"master/api/getting-started-with-the-api.md",key:"v-f2f6664a",path:"/master/api/getting-started-with-the-api.html",headers:[{level:2,title:"REST API",slug:"rest-api"},{level:2,title:"Explore REST API Demo",slug:"explore-rest-api-demo"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Best Security Practices",frontmatter:{},regularPath:"/master/advanced/security-practice.html",relativePath:"master/advanced/security-practice.md",key:"v-a79c52ca",path:"/master/advanced/security-practice.html",headers:[{level:2,title:"Software Updates",slug:"software-updates"},{level:2,title:"Limiting Error Messages",slug:"limiting-error-messages"},{level:2,title:"Limiting Admin Access",slug:"limiting-admin-access"},{level:2,title:"Restricting Unnecessary Files",slug:"restricting-unnecessary-files"},{level:2,title:"Restricting PHP Execution Inside Storage",slug:"restricting-php-execution-inside-storage"},{level:2,title:"Server Hardening",slug:"server-hardening"},{level:2,title:"Strong Passwords",slug:"strong-passwords"},{level:2,title:"Implementation of HTTP Security Headers",slug:"implementation-of-http-security-headers"},{level:3,title:"HTTP Strict Transport Security (HSTS)",slug:"http-strict-transport-security-hsts"},{level:3,title:"Cross-Site Scripting Protection (X-XSS Protection)",slug:"cross-site-scripting-protection-x-xss-protection"},{level:3,title:"X-Frame-Options​",slug:"x-frame-options​"},{level:3,title:"X-Content-Type-Options​",slug:"x-content-type-options​"},{level:3,title:"Content Security Policy (CSP)",slug:"content-security-policy-csp"},{level:3,title:"Continuous Logging And Monitoring",slug:"continuous-logging-and-monitoring"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Architecture concepts",frontmatter:{},regularPath:"/master/architecture/",relativePath:"master/architecture/README.md",key:"v-5b513a44",path:"/master/architecture/",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Modular Design in Krayin",frontmatter:{},regularPath:"/master/architecture/modular-design.html",relativePath:"master/architecture/modular-design.md",key:"v-3d6730e7",path:"/master/architecture/modular-design.html",headers:[{level:2,title:"Key Benefits of Modular Design",slug:"key-benefits-of-modular-design"},{level:2,title:"Module Structure in Krayin",slug:"module-structure-in-krayin"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Repository Pattern in Krayin",frontmatter:{},regularPath:"/master/architecture/repository-pattern.html",relativePath:"master/architecture/repository-pattern.md",key:"v-38093e8f",path:"/master/architecture/repository-pattern.html",headers:[{level:3,title:"Benefits of the Repository Pattern",slug:"benefits-of-the-repository-pattern"},{level:3,title:"Implementation in Krayin",slug:"implementation-in-krayin"},{level:2,title:"Eloquent ORM",slug:"eloquent-orm"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Theme",frontmatter:{},regularPath:"/master/architecture/theme.html",relativePath:"master/architecture/theme.md",key:"v-82f3414a",path:"/master/architecture/theme.html",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Custom Attribute Creation",frontmatter:{},regularPath:"/master/custom-attributes/",relativePath:"master/custom-attributes/README.md",key:"v-19fa9c70",path:"/master/custom-attributes/",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Use model with custom Attributes",frontmatter:{},regularPath:"/master/custom-attributes/custom-attribute.html",relativePath:"master/custom-attributes/custom-attribute.md",key:"v-11d2520a",path:"/master/custom-attributes/custom-attribute.html",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Packages",frontmatter:{},regularPath:"/master/architecture/packages.html",relativePath:"master/architecture/packages.md",key:"v-50c09862",path:"/master/architecture/packages.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Available Packages In Krayin",slug:"available-packages-in-krayin"},{level:3,title:"Admin",slug:"admin"},{level:3,title:"Activity",slug:"activity"},{level:3,title:"Attribute",slug:"attribute"},{level:3,title:"Contact",slug:"contact"},{level:3,title:"Core",slug:"core"},{level:3,title:"Email",slug:"email"},{level:3,title:"EmailTemplate",slug:"emailtemplate"},{level:3,title:"Installer",slug:"installer"},{level:3,title:"Lead",slug:"lead"},{level:3,title:"Product",slug:"product"},{level:3,title:"Quote",slug:"quote"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"User",slug:"user"},{level:3,title:"WebForm",slug:"webform"},{level:3,title:"Automation",slug:"automation"},{level:3,title:"Datagrid",slug:"datagrid"},{level:3,title:"Warehouse",slug:"warehouse"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Create and using a new attribute",frontmatter:{},regularPath:"/master/custom-attributes/uses.html",relativePath:"master/custom-attributes/uses.md",key:"v-3e7871fb",path:"/master/custom-attributes/uses.html",lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Docker",frontmatter:{},regularPath:"/master/introduction/docker.html",relativePath:"master/introduction/docker.md",key:"v-29ba2c92",path:"/master/introduction/docker.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Docker Setup for Krayin",slug:"docker-setup-for-krayin"},{level:3,title:"1. Using Krayin Docker Image from Docker Hub",slug:"_1-using-krayin-docker-image-from-docker-hub"},{level:3,title:"2. Using Krayin GitHub Docker Repository",slug:"_2-using-krayin-github-docker-repository"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Introduction",frontmatter:{},regularPath:"/master/introduction/",relativePath:"master/introduction/README.md",key:"v-102d7560",path:"/master/introduction/",headers:[{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Installation",frontmatter:{},regularPath:"/master/introduction/installation.html",relativePath:"master/introduction/installation.md",key:"v-4ad03c83",path:"/master/introduction/installation.html",headers:[{level:2,title:"Install Using GUI Installer",slug:"install-using-gui-installer"},{level:2,title:"Install Using Composer",slug:"install-using-composer"},{level:2,title:"Start Using Krayin",slug:"start-using-krayin"},{level:3,title:"On a Production Server",slug:"on-a-production-server"},{level:3,title:"On Your Local Server",slug:"on-your-local-server"},{level:3,title:"Login as an Admin",slug:"login-as-an-admin"},{level:3,title:"Contributing",slug:"contributing"},{level:3,title:"License",slug:"license"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Requirements",frontmatter:{},regularPath:"/master/introduction/requirements.html",relativePath:"master/introduction/requirements.md",key:"v-7b128352",path:"/master/introduction/requirements.html",headers:[{level:2,title:"Server configuration",slug:"server-configuration"},{level:2,title:"PHP Extensions",slug:"php-extensions"},{level:2,title:"PHP Configuration",slug:"php-configuration"},{level:2,title:"Supported Database Servers",slug:"supported-database-servers"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Package Development",frontmatter:{},regularPath:"/master/packages/",relativePath:"master/packages/README.md",key:"v-94b795ac",path:"/master/packages/",headers:[{level:2,title:"Package Development",slug:"package-development"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Menu",frontmatter:{},regularPath:"/master/packages/add-menu-in-admin.html",relativePath:"master/packages/add-menu-in-admin.md",key:"v-5516a1ca",path:"/master/packages/add-menu-in-admin.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Configure the menu",slug:"configure-the-menu"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define Menu Items",slug:"define-menu-items"},{level:3,title:"Define Routes",slug:"define-routes"},{level:3,title:"Add Menu Icon",slug:"add-menu-icon"},{level:3,title:"Merge Configuration",slug:"merge-configuration"},{level:3,title:"Optimize Application",slug:"optimize-application"},{level:2,title:"Level of Menu",slug:"level-of-menu"},{level:3,title:"First Level (Sidebar)",slug:"first-level-sidebar"},{level:3,title:"Second Level (Hover Menu)",slug:"second-level-hover-menu"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Blade Components",frontmatter:{},regularPath:"/master/packages/blade-components.html",relativePath:"master/packages/blade-components.md",key:"v-68450b87",path:"/master/packages/blade-components.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Components",slug:"components"},{level:3,title:"Tag",slug:"tag"},{level:3,title:"Avatar",slug:"avatar"},{level:3,title:"Activities",slug:"activities"},{level:3,title:"Lookup",slug:"lookup"},{level:3,title:"Attachment",slug:"attachment"},{level:3,title:"Inline Editable",slug:"inline-editable"},{level:3,title:"Accordion",slug:"accordion"},{level:3,title:"Button",slug:"button"},{level:3,title:"Drawer",slug:"drawer"},{level:3,title:"Dropdown",slug:"dropdown"},{level:3,title:"Flat-Picker",slug:"flat-picker"},{level:3,title:"Data Grid",slug:"data-grid"},{level:3,title:"Tinymce",slug:"tinymce"},{level:3,title:"Shimmer",slug:"shimmer"},{level:3,title:"Table",slug:"table"},{level:3,title:"Modal",slug:"modal"},{level:3,title:"Tree",slug:"tree"},{level:3,title:"Media",slug:"media"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Controller",frontmatter:{},regularPath:"/master/packages/controllers.html",relativePath:"master/packages/controllers.md",key:"v-2d59775b",path:"/master/packages/controllers.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"How to create Controllers",slug:"how-to-create-controllers"},{level:3,title:"Directory Structure",slug:"directory-structure"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Bundling Assets",frontmatter:{},regularPath:"/master/packages/assets.html",relativePath:"master/packages/assets.md",key:"v-49e9b357",path:"/master/packages/assets.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:2,title:"Configure Compiling Assets",slug:"configure-compiling-assets"},{level:2,title:"Create Configuration Files",slug:"create-configuration-files"},{level:3,title:"Set Up package.json",slug:"set-up-package-json"},{level:3,title:"Set Up webpack.mix.js",slug:"set-up-webpack-mix-js"},{level:3,title:"Importing Laravel Mix",slug:"importing-laravel-mix"},{level:3,title:"Merging Manifests",slug:"merging-manifests"},{level:3,title:"Setting the Public Path",slug:"setting-the-public-path"},{level:3,title:"Mix Configuration",slug:"mix-configuration"},{level:3,title:"Asset Compilation",slug:"asset-compilation"},{level:3,title:"Webpack Configuration",slug:"webpack-configuration"},{level:3,title:"Source Maps",slug:"source-maps"},{level:3,title:"Versioning",slug:"versioning"},{level:2,title:"Load Assets in Blade File",slug:"load-assets-in-blade-file"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Migrations",frontmatter:{},regularPath:"/master/packages/create-migrations.html",relativePath:"master/packages/create-migrations.md",key:"v-77bdaafb",path:"/master/packages/create-migrations.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Loading Migration from Package",slug:"loading-migration-from-package"},{level:3,title:"Creating Tables from Migrations",slug:"creating-tables-from-migrations"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Access Control List",frontmatter:{},regularPath:"/master/packages/create-acl.html",relativePath:"master/packages/create-acl.md",key:"v-c13ca42a",path:"/master/packages/create-acl.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Create Configuration File",slug:"create-configuration-file"},{level:3,title:"Define ACL Configuration",slug:"define-acl-configuration"},{level:2,title:"Merge ACL Configuration",slug:"merge-acl-configuration"},{level:3,title:"Modify Service Provider",slug:"modify-service-provider"},{level:3,title:"Register Method",slug:"register-method"},{level:3,title:"Clear Configuration Cache",slug:"clear-configuration-cache"},{level:3,title:"Verify in Admin Panel",slug:"verify-in-admin-panel"},{level:2,title:"Checking Roles and Permissions",slug:"checking-roles-and-permissions"},{level:3,title:"Access Roles",slug:"access-roles"},{level:3,title:"Permission Checks",slug:"permission-checks"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"DataGrid",frontmatter:{},regularPath:"/master/packages/datagrid.html",relativePath:"master/packages/datagrid.md",key:"v-0b718b3d",path:"/master/packages/datagrid.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Global Properties of DataGrid",slug:"global-properties-of-datagrid"},{level:2,title:"How DataGrid Works",slug:"how-datagrid-works"},{level:2,title:"Multiple DataGrids",slug:"multiple-datagrids"},{level:3,title:"DataGrid to JSON",slug:"datagrid-to-json"},{level:3,title:"Render DataGrid",slug:"render-datagrid"},{level:2,title:"Sample DataGrid",slug:"sample-datagrid"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Models",frontmatter:{},regularPath:"/master/packages/create-models.html",relativePath:"master/packages/create-models.md",key:"v-f028604a",path:"/master/packages/create-models.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:2,title:"Using Laravel Artisan Command",slug:"using-laravel-artisan-command"},{level:3,title:"Create the Contract",slug:"create-the-contract"},{level:3,title:"Create the Proxy",slug:"create-the-proxy"},{level:3,title:"Create the Model",slug:"create-the-model"},{level:3,title:"Create Module Service Provider",slug:"create-module-service-provider"},{level:3,title:"Registering ModuleServiceProvider",slug:"registering-moduleserviceprovider"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Repositories",frontmatter:{},regularPath:"/master/packages/store-data-through-repositories.html",relativePath:"master/packages/store-data-through-repositories.md",key:"v-c1dbb14a",path:"/master/packages/store-data-through-repositories.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Dependency Injection",slug:"dependency-injection"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Create a New Repository Class",slug:"create-a-new-repository-class"},{level:3,title:"Explanation",slug:"explanation"},{level:2,title:"Manually Setting Up Repository Files",slug:"manually-setting-up-repository-files"},{level:3,title:"Setting Up CategoryRepository in Webkul/Category Package",slug:"setting-up-categoryrepository-in-webkul-category-package"},{level:2,title:"Available Methods",slug:"available-methods"},{level:3,title:"all",slug:"all"},{level:3,title:"Find",slug:"find"},{level:3,title:"FindOrFail",slug:"findorfail"},{level:3,title:"Create",slug:"create"},{level:3,title:"Update",slug:"update"},{level:3,title:"Delete",slug:"delete"},{level:3,title:"Paginate",slug:"paginate"},{level:3,title:"FindWhere",slug:"findwhere"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Getting Started",frontmatter:{},regularPath:"/master/packages/create-package.html",relativePath:"master/packages/create-package.md",key:"v-03cb4f1a",path:"/master/packages/create-package.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Using Krayin Package Generator",slug:"using-krayin-package-generator"},{level:3,title:"Registering Your Package",slug:"registering-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands"},{level:2,title:"Manual Setup of Files",slug:"manual-setup-of-files"},{level:3,title:"Create Package Directory",slug:"create-package-directory"},{level:3,title:"Create Service Provider",slug:"create-service-provider"},{level:3,title:"Register Your Package",slug:"register-your-package"},{level:3,title:"Run the Commands",slug:"run-the-commands-2"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Layouts",frontmatter:{},regularPath:"/master/packages/layouts.html",relativePath:"master/packages/layouts.md",key:"v-066aec9b",path:"/master/packages/layouts.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Category Layout",slug:"category-layout"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Routes",frontmatter:{},regularPath:"/master/packages/routes.html",relativePath:"master/packages/routes.md",key:"v-0142f749",path:"/master/packages/routes.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Create a new Route",slug:"create-a-new-route"},{level:3,title:"Routes",slug:"routes-2"},{level:2,title:"Loading Routes",slug:"loading-routes"},{level:3,title:"Register Routes in ServiceProvider",slug:"register-routes-in-serviceprovider"},{level:2,title:"Available HTTP methods",slug:"available-http-methods"},{level:3,title:"GET",slug:"get"},{level:3,title:"POST",slug:"post"},{level:3,title:"PUT",slug:"put"},{level:3,title:"DELETE",slug:"delete"},{level:3,title:"PATCH",slug:"patch"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Localization",frontmatter:{},regularPath:"/master/packages/localization.html",relativePath:"master/packages/localization.md",key:"v-3e3a5dab",path:"/master/packages/localization.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Publishing the Language Files",slug:"publishing-the-language-files"},{level:2,title:"Configuring the Locale",slug:"configuring-the-locale"},{level:2,title:"Create a new Locale",slug:"create-a-new-locale"},{level:3,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Writing a Translation in app.php",slug:"writing-a-translation-in-app-php"},{level:2,title:"Load Translation from Package",slug:"load-translation-from-package"},{level:3,title:"Update the Service Provider",slug:"update-the-service-provider"},{level:3,title:"Use Translations in Blade Files",slug:"use-translations-in-blade-files"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Validation",frontmatter:{},regularPath:"/master/packages/validation.html",relativePath:"master/packages/validation.md",key:"v-4ac4bd6b",path:"/master/packages/validation.html",headers:[{level:2,title:"Validation Using Laravel",slug:"validation-using-laravel"},{level:3,title:"Introduction",slug:"introduction"},{level:3,title:"Usage",slug:"usage"},{level:2,title:"Validation Using Vue",slug:"validation-using-vue"},{level:3,title:"Introduction",slug:"introduction-2"},{level:3,title:"Installation",slug:"installation"},{level:3,title:"Configuration",slug:"configuration"},{level:3,title:"Examples",slug:"examples"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Upgrade Guide",frontmatter:{},regularPath:"/master/prologue/upgrade-guide.html",relativePath:"master/prologue/upgrade-guide.md",key:"v-71ef02ca",path:"/master/prologue/upgrade-guide.html",headers:[{level:2,title:"Upgrade Steps",slug:"upgrade-steps"},{level:2,title:"Composer Dependencies",slug:"composer-dependencies"},{level:3,title:"Differences in Composer Dependencies",slug:"differences-in-composer-dependencies"},{level:3,title:"Differences in Development Dependencies",slug:"differences-in-development-dependencies"},{level:3,title:"Differences in Autoloading",slug:"differences-in-autoloading"},{level:3,title:"Summary of Changes",slug:"summary-of-changes"},{level:3,title:"Upgrade Instructions",slug:"upgrade-instructions"},{level:3,title:"Conclusion",slug:"conclusion"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Contribution Guide",frontmatter:{},regularPath:"/master/prologue/contribution-guide.html",relativePath:"master/prologue/contribution-guide.md",key:"v-c4ee6cda",path:"/master/prologue/contribution-guide.html",headers:[{level:2,title:"Bug Reports",slug:"bug-reports"},{level:2,title:"Projects to Contribute",slug:"projects-to-contribute"},{level:2,title:"Feature Requests",slug:"feature-requests"},{level:2,title:"Branch Selection",slug:"branch-selection"},{level:2,title:"Compiled Assets",slug:"compiled-assets"},{level:2,title:"Tailwind Class Reordering",slug:"tailwind-class-reordering"},{level:2,title:"Pint Tests",slug:"pint-tests"},{level:2,title:"Security Vulnerabilities",slug:"security-vulnerabilities"},{level:2,title:"Coding Style",slug:"coding-style"},{level:2,title:"PHPDoc",slug:"phpdoc"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Prologue",frontmatter:{},regularPath:"/master/prologue/",relativePath:"master/prologue/README.md",key:"v-24913d76",path:"/master/prologue/",headers:[{level:2,title:"Introduction to Krayin",slug:"introduction-to-krayin"},{level:2,title:"Key Features of Krayin",slug:"key-features-of-krayin"},{level:3,title:"CRM Dashboard",slug:"crm-dashboard"},{level:3,title:"Convert Opportunities into Revenue",slug:"convert-opportunities-into-revenue"},{level:3,title:"Manage Interaction",slug:"manage-interaction"},{level:3,title:"Access Control List (ACL)",slug:"access-control-list-acl"},{level:3,title:"Activities Management",slug:"activities-management"},{level:3,title:"Kanban Visual Leads",slug:"kanban-visual-leads"},{level:3,title:"Unlimited Custom Fields",slug:"unlimited-custom-fields"},{level:3,title:"Product Creation",slug:"product-creation"},{level:3,title:"Contact Management",slug:"contact-management"},{level:3,title:"Modular Design",slug:"modular-design"},{level:2,title:"Community and Support",slug:"community-and-support"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4},{title:"Views",frontmatter:{},regularPath:"/master/packages/views.html",relativePath:"master/packages/views.md",key:"v-2b0dbf0a",path:"/master/packages/views.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Directory Structure",slug:"directory-structure"},{level:3,title:"Adding HTML Content",slug:"adding-html-content"},{level:2,title:"Load Views from Package",slug:"load-views-from-package"},{level:2,title:"Rendering Views",slug:"rendering-views"},{level:2,title:"Blade File Naming Convention",slug:"blade-file-naming-convention"},{level:3,title:"Listing (Index Blade):",slug:"listing-index-blade"},{level:3,title:"Creation (Create Blade):",slug:"creation-create-blade"},{level:3,title:"Updating (Edit Blade):",slug:"updating-edit-blade"}],lastUpdated:"10/23/2024, 8:16:20 AM",lastUpdatedTimestamp:172967138e4}],themeConfig:{smoothScroll:!0,lastUpdated:"Last Updated",repo:"krayin/laravel-crm",repoLabel:"Contribute to Krayin CRM",docsRepo:"krayin/krayin-docs",docsDir:"docs",docsBranch:"master",editLinks:!0,editLinkText:"Help us improve this page on Github.",logo:"/logo.svg",nav:[{text:"Home",link:"/"},{text:"User Guide",link:"https://docs.krayincrm.com/"},{text:"Community Forum",link:"https://forums.krayincrm.com/"}],contactUs:{text:"Contact Us",link:"https://krayincrm.com/contacts/"},sidebar:{"/1.x/":[{title:"Introduction",path:"/1.x/introduction",collapsable:!0,children:[["/1.x/introduction/requirements","Requirements"],["/1.x/introduction/installation","Installation"]]},{title:"Architecture concepts",path:"/1.x/architecture",collapsable:!0,children:[["/1.x/architecture/packages","Packages"],["/1.x/architecture/repository-pattern","Repository Pattern"],["/1.x/architecture/modular-design","Modular Design"]]},{title:"Package Development",path:"/1.x/packages",collapsable:!0,children:[["/1.x/packages/create-package","Getting Started"],["/1.x/packages/create-migrations","Migrations"],["/1.x/packages/create-models","Models"],["/1.x/packages/store-data-through-repositories","Repository"],["/1.x/packages/routes","Routes"],["/1.x/packages/controllers","Controllers"],["/1.x/packages/views","Views"],["/1.x/packages/localization","Localization"],["/1.x/packages/layouts","Layouts"],["/1.x/packages/assets","Assets"],["/1.x/packages/add-menu-in-admin","Admin Menu"],["/1.x/packages/validation","Validation"],["/1.x/packages/datagrid","DataGrid"],["/1.x/packages/create-acl","Access Control List"]]},{title:"Digging Deeper",path:"/1.x/advanced",collapsable:!0,children:[["/1.x/advanced/events","Events Listeners"],["/1.x/advanced/helpers","Helpers"],["/1.x/advanced/override-core-model","Override Core Models"],["/1.x/advanced/render-event","View Render Event"],["/1.x/advanced/security-practice","Best Security Practices"],["/1.x/advanced/email-inbound-parse"," Email Inbound Parse"]]},{title:"Custom Attributes",path:"/1.x/custom-attributes",collapsable:!0,children:[["/1.x/custom-attributes/custom-attribute","Make Model With Custom Attribute"],["/1.x/custom-attributes/uses","How to use custom attribute"]]},{title:"Krayin APIs",path:"/1.x/api",collapsable:!0,children:[["/1.x/api/getting-started-with-the-api","Rest API"]]}],"/2.0/":[{title:"Prologue",path:"/2.0/prologue",collapsable:!0,children:[["/2.0/prologue/upgrade-guide","Upgrade Guide"],["/2.0/prologue/contribution-guide"," Contribution Guide"]]},{title:"Introduction",path:"/2.0/introduction",collapsable:!0,children:[["/2.0/introduction/requirements","Requirements"],["/2.0/introduction/installation","Installation"],["/2.0/introduction/docker","Docker"]]},{title:"Architecture concepts",path:"/2.0/architecture",collapsable:!0,children:[["/2.0/architecture/packages","Packages"],["/2.0/architecture/repository-pattern","Repository Pattern"],["/2.0/architecture/modular-design","Modular Design"]]},{title:"Package Development",path:"/2.0/packages",collapsable:!0,children:[["/2.0/packages/create-package","Getting Started"],["/2.0/packages/create-migrations","Migrations"],["/2.0/packages/create-models","Models"],["/2.0/packages/store-data-through-repositories","Repository"],["/2.0/packages/routes","Routes"],["/2.0/packages/controllers","Controllers"],["/2.0/packages/views","Views"],["/2.0/packages/localization","Localization"],["/2.0/packages/blade-components","Blade Components"],["/2.0/packages/layouts","Layouts"],["/2.0/packages/assets","Assets"],["/2.0/packages/add-menu-in-admin","Admin Menu"],["/2.0/packages/validation","Validation"],["/2.0/packages/datagrid","DataGrid"],["/2.0/packages/create-acl","Access Control List"]]},{title:"Digging Deeper",path:"/2.0/advanced",collapsable:!0,children:[["/2.0/advanced/events","Events Listeners"],["/2.0/advanced/helpers","Helpers"],["/2.0/advanced/override-core-model","Override Core Models"],["/2.0/advanced/render-event","View Render Event"],["/2.0/advanced/security-practice","Best Security Practices"],["/2.0/advanced/email-inbound-parse"," Email Inbound Parse"]]},{title:"Custom Attributes",path:"/2.0/custom-attributes",collapsable:!0,children:[["/2.0/custom-attributes/custom-attribute","Make Model With Custom Attribute"],["/2.0/custom-attributes/uses","How to use custom attribute"]]},{title:"Krayin APIs",path:"/2.0/api",collapsable:!0,children:[["/2.0/api/getting-started-with-the-api","Rest API"]]}],"/master/":[{title:"Prologue",path:"/master/prologue",collapsable:!0,children:[["/master/prologue/upgrade-guide","Upgrade Guide"],["/master/prologue/contribution-guide"," Contribution Guide"]]},{title:"Introduction",path:"/master/introduction",collapsable:!0,children:[["/master/introduction/requirements","Requirements"],["/master/introduction/installation","Installation"],["/master/introduction/docker","Docker"]]},{title:"Architecture concepts",path:"/master/architecture",collapsable:!0,children:[["/master/architecture/packages","Packages"],["/master/architecture/repository-pattern","Repository Pattern"],["/master/architecture/modular-design","Modular Design"]]},{title:"Package Development",path:"/master/packages",collapsable:!0,children:[["/master/packages/create-package","Getting Started"],["/master/packages/create-migrations","Migrations"],["/master/packages/create-models","Models"],["/master/packages/store-data-through-repositories","Repository"],["/master/packages/routes","Routes"],["/master/packages/controllers","Controllers"],["/master/packages/views","Views"],["/master/packages/localization","Localization"],["/master/packages/blade-components","Blade Components"],["/master/packages/layouts","Layouts"],["/master/packages/assets","Assets"],["/master/packages/add-menu-in-admin","Admin Menu"],["/master/packages/validation","Validation"],["/master/packages/datagrid","DataGrid"],["/master/packages/create-acl","Access Control List"]]},{title:"Digging Deeper",path:"/master/advanced",collapsable:!0,children:[["/master/advanced/events","Events Listeners"],["/master/advanced/helpers","Helpers"],["/master/advanced/override-core-model","Override Core Models"],["/master/advanced/render-event","View Render Event"],["/master/advanced/security-practice","Best Security Practices"],["/master/advanced/email-inbound-parse"," Email Inbound Parse"],["/master/advanced/data-transfer","Data Transfer"]]},{title:"Custom Attributes",path:"/master/custom-attributes",collapsable:!0,children:[["/master/custom-attributes/custom-attribute","Make Model With Custom Attribute"],["/master/custom-attributes/uses","How to use custom attribute"]]},{title:"Krayin APIs",path:"/master/api",collapsable:!0,children:[["/master/api/getting-started-with-the-api","Rest API"]]}]}}};n(239);qn.component("Badge",()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,319)));n(240),n(241);function Fl(e){const t=document.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return{x:n.left-t.left,y:n.top-t.top}}class Bl{constructor(e){Object.defineProperty(this,"registration",{value:e,configurable:!0,writable:!0})}update(){return this.registration.update()}skipWaiting(){const e=this.registration.waiting;return e?(console.log("[vuepress:sw] Doing worker.skipWaiting()."),new Promise((t,n)=>{const r=new MessageChannel;r.port1.onmessage=e=>{console.log("[vuepress:sw] Done worker.skipWaiting()."),e.data.error?n(e.data.error):t(e.data)},e.postMessage({type:"skip-waiting"},[r.port2])})):Promise.resolve()}}var Nl=new qn;var Hl={name:"BackToTop",props:{threshold:{type:Number,default:300}},data:()=>({scrollTop:null}),computed:{show(){return this.scrollTop>this.threshold}},mounted(){this.scrollTop=this.getScrollTop(),window.addEventListener("scroll",Pl()(()=>{this.scrollTop=this.getScrollTop()},100))},methods:{getScrollTop:()=>window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,scrollToTop(){window.scrollTo({top:0,behavior:"smooth"}),this.scrollTop=0}}},Vl=(n(242),Object($l.a)(Hl,(function(){var e=this._self._c;return e("transition",{attrs:{name:"fade"}},[this.show?e("svg",{staticClass:"go-to-top",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 49.484 28.284"},on:{click:this.scrollToTop}},[e("g",{attrs:{transform:"translate(-229 -126.358)"}},[e("rect",{attrs:{fill:"currentColor",width:"35",height:"5",rx:"2",transform:"translate(229 151.107) rotate(-45)"}}),this._v(" "),e("rect",{attrs:{fill:"currentColor",width:"35",height:"5",rx:"2",transform:"translate(274.949 154.642) rotate(-135)"}})])]):this._e()])}),[],!1,null,"5fd4ef0c",null).exports),zl=[{},({Vue:e})=>{e.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},({Vue:e,router:t})=>{t.options.scrollBehavior=(t,n,r)=>{if(r)return window.scrollTo({top:r.y,behavior:"smooth"});if(t.hash){if(e.$vuepress.$get("disableScrollBehavior"))return!1;const n=document.querySelector(t.hash);return!!n&&window.scrollTo({top:Fl(n).y,behavior:"smooth"})}return window.scrollTo({top:0,behavior:"smooth"})}},async({router:e,isServer:t})=>{if(!t){const{register:t}=await n.e(138).then(n.bind(null,313));e.onReady(()=>{t("/service-worker.js",{registrationOptions:{},ready(){console.log("[vuepress:sw] Service worker is active."),Nl.$emit("sw-ready")},cached(e){console.log("[vuepress:sw] Content has been cached for offline use."),Nl.$emit("sw-cached",new Bl(e))},updated(e){console.log("[vuepress:sw] Content updated."),Nl.$emit("sw-updated",new Bl(e))},offline(){console.log("[vuepress:sw] No internet connection found. App is running in offline mode."),Nl.$emit("sw-offline")},error(e){console.error("[vuepress:sw] Error during service worker registration:",e),Nl.$emit("sw-error",e),GA_ID&&ga("send","exception",{exDescription:e.message,exFatal:!1})}})})}},({Vue:e})=>{e.component("BackToTop",Vl)}],Gl=["BackToTop"];class Kl extends class{constructor(){this.store=new qn({data:{state:{}}})}$get(e){return this.store.state[e]}$set(e,t){qn.set(this.store.state,e,t)}$emit(...e){this.store.$emit(...e)}$on(...e){this.store.$on(...e)}}{}Object.assign(Kl.prototype,{getPageAsyncComponent:sl,getLayoutAsyncComponent:cl,getAsyncComponent:ul,getVueComponent:dl});var ql={install(e){const t=new Kl;e.$vuepress=t,e.prototype.$vuepress=t}};function Wl(e,t){const n=t.toLowerCase();return e.options.routes.some(e=>e.path.toLowerCase()===n)}var Xl={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(e){const t=this.pageKey||this.$parent.$page.key;return fl("pageKey",t),qn.component(t)||qn.component(t,sl(t)),qn.component(t)?e(t):e("")}},Yl={functional:!0,props:{slotKey:String,required:!0},render:(e,{props:t,slots:n})=>e("div",{class:["content__"+t.slotKey]},n()[t.slotKey])},Jl={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},Ql=(n(243),n(244),Object($l.a)(Jl,(function(){var e=this._self._c;return e("span",[e("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[e("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),e("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),e("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),Zl={functional:!0,render(e,{parent:t,children:n}){if(t._isMounted)return n;t.$once("hook:mounted",()=>{t.$forceUpdate()})}};qn.config.productionTip=!1,qn.use(Ko),qn.use(ql),qn.mixin(function(e,t,n=qn){!function(e){e.locales&&Object.keys(e.locales).forEach(t=>{e.locales[t].path=t});Object.freeze(e)}(t),n.$vuepress.$set("siteData",t);const r=new(e(n.$vuepress.$get("siteData"))),a=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(r)),i={};return Object.keys(a).reduce((e,t)=>(t.startsWith("$")&&(e[t]=a[t].get),e),i),{computed:i}}(e=>class{setPage(e){this.__page=e}get $site(){return e}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:e={}}=this.$site;let t,n;for(const r in e)"/"===r?n=e[r]:0===this.$page.path.indexOf(r)&&(t=e[r]);return t||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:e}=this.$page.frontmatter;return"string"==typeof e&&e}get $title(){const e=this.$page,{metaTitle:t}=this.$page.frontmatter;if("string"==typeof t)return t;const n=this.$siteTitle,r=e.frontmatter.home?null:e.frontmatter.title||e.title;return n?r?r+" | "+n:n:r||"VuePress"}get $description(){const e=function(e){if(e){const t=e.filter(e=>"description"===e.name)[0];if(t)return t.content}}(this.$page.frontmatter.meta);return e||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}get $lang(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}get $localePath(){return this.$localeConfig.path||"/"}get $themeLocaleConfig(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}get $page(){return this.__page?this.__page:function(e,t){for(let n=0;nn||(e.hash?!qn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(e.hash)}:{x:0,y:0})});!function(e){e.beforeEach((t,n,r)=>{if(Wl(e,t.path))r();else if(/(\/|\.html)$/.test(t.path))if(/\/$/.test(t.path)){const n=t.path.replace(/\/$/,"")+".html";Wl(e,n)?r(n):r()}else r();else{const n=t.path+"/",a=t.path+".html";Wl(e,a)?r(a):Wl(e,n)?r(n):r()}})}(n);const r={};try{await Promise.all(zl.filter(e=>"function"==typeof e).map(t=>t({Vue:qn,options:r,router:n,siteData:Dl,isServer:e})))}catch(e){console.error(e)}return{app:new qn(Object.assign(r,{router:n,render:e=>e("div",{attrs:{id:"app"}},[e("RouterView",{ref:"layout"}),e("div",{class:"global-ui"},Gl.map(t=>e(t)))])})),router:n}}(!1).then(({app:e,router:t})=>{t.onReady(()=>{e.$mount("#app")})})}]); \ No newline at end of file diff --git a/index.html b/index.html index a03129c..49759ff 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ - + @@ -42,6 +42,6 @@

    Package creation

    Learn how to create a new package for Krayin.

    Digging Deeper

    Learn advanced topics like payment methods, shipping methods.

    API documentation

    Learn how to connect your existing systems with the Krayin API.

    - + diff --git a/master/advanced/data-transfer.html b/master/advanced/data-transfer.html index 5a40815..afe01b0 100644 --- a/master/advanced/data-transfer.html +++ b/master/advanced/data-transfer.html @@ -9,7 +9,7 @@ - + @@ -35,7 +35,7 @@ Contact Us (opens new window)

    # Introduction

    The Data Transfer Module allows you to import large amounts of data from CSV files into your application, with support for leads, products, and persons entities. This module leverages Laravel's queue feature for efficient handling of large datasets, ensuring seamless imports even in high-volume scenarios. Additionally, it includes comprehensive validation and error-handling strategies to provide flexibility in dealing with data integrity.

    # Features

    • Queue and Non-Queue Based Import: Supports importing via Laravel queues for background processing or direct imports for smaller datasets(Without Queue/Sync).
    • CSV Data Validation: Validate CSV data before importing to ensure data integrity.
    • Validation Strategies: Choose between different strategies to handle data errors (Stop on Error, Skip Errors).
    • CSV Delimiter Customization: Support for different CSV delimiters.
    • Allowed Errors: Configure the number of allowable errors before the process fails.
    • CRUD Actions: Supports Create, Update, and Delete operations.

    # Usage

    # Importing Data

    The module can import data for Leads, Products, and Persons entities from CSV files. You can run the import with or without Laravel's queue feature, depending on your dataset size.

    # Import without Queue

    If you prefer to import data without utilizing a queue system, you can achieve this by turning off the queue processing functionality.

    # Import with Queue

    If you prefer to import data utilizing a queue system, you can achieve this by turning on the queue processing functionality.

    # Validation

    Before importing the CSV data, the module validates the records based on the rules defined for each entity. There are two validation strategies you can choose from:

    # Validation Strategies

    1. Stop on Errors: This strategy will halt the import process when an error is encountered.
    2. Skip Errors: This strategy skips the rows with errors and continues importing the valid data.

    # CSV Delimiter

    The default delimiter is a comma (,). If your CSV uses a different delimiter, you can specify it during the import:

    # Error Handling

    You can configure the number of allowable errors before the process fails. If the error threshold is met, the import will be terminated and shows to display. Errors during the import process are logged, and a detailed report is generated, showing which rows failed and why.

    # CRUD Actions

    The module supports three main actions during the import process:

    1. Create: Add new records. If records do not exist, new records will be created.

    2. Update: Update existing records if they match based on the identifier. If records exist, they will be updated.

    3. Delete: Remove records based on the provided data. If records exist, they will be deleted, Before importing. If the data does not exist, a validation error will be displayed.

    # Edit Import Data

    Before finalizing the import, you can review and edit the data. The system allows you to preview the imported data and make corrections if needed.

    # Queue Configuration

    If you are using queues for import, make sure your Laravel queue worker is running:

    php artisan queue:work
    -

    You can adjust the queue settings in the config/queue.php file if needed.

    # Conclusion

    The Data Transfer Module provides a robust solution for importing large datasets into your Krayin application, with flexible options for validation, error handling, and queue-based processing. Whether you're importing millions of records or just a few, this module simplifies the process while ensuring data integrity and flexibility.

    You can adjust the queue settings in the config/queue.php file if needed.

    # Conclusion

    The Data Transfer Module provides a robust solution for importing large datasets into your Krayin application, with flexible options for validation, error handling, and queue-based processing. Whether you're importing millions of records or just a few, this module simplifies the process while ensuring data integrity and flexibility.

    - + diff --git a/master/advanced/email-inbound-parse.html b/master/advanced/email-inbound-parse.html index 0ea9b49..80a7060 100644 --- a/master/advanced/email-inbound-parse.html +++ b/master/advanced/email-inbound-parse.html @@ -9,7 +9,7 @@ - + @@ -38,7 +38,7 @@ Replace yourdomain.com with your actual domain and ensure the endpoint matches your Krayin setup.
  • Configure Krayin CRM to Receive Emails

    • Once the webhook is set up in SendGrid, all emails sent to the configured domain will be forwarded to the specified Krayin webhook.
    • Krayin CRM will handle the incoming email data, including:
      • From Address: The sender's email.
      • To Address: The recipient (your configured email).
      • Subject: Email subject.
      • Text/HTML Body: Email content in plain text or HTML.
      • Attachments: Any files attached to the email.
  • Krayin Endpoint for Inbound Parse

    • Ensure that Krayin CRM is set up to receive the POST data from SendGrid. The email content will be sent to the following Krayin endpoint:
      http://yourdomain.com/admin/mail/inbound-parse
       
    • Krayin will parse the data sent by SendGrid, store the email information in the database, and display it in the Mail > Inbox section.
  • # Handling Email Attachments

    Krayin CRM is capable of handling attachments that are sent via email. These attachments will be forwarded from SendGrid to your endpoint as multipart/form-data. Make sure your server can process and store these files for later retrieval in the Mail > Inbox section of the CRM.

    # Security Considerations

    • Verify the Request Origin: Ensure that incoming requests to your webhook are actually coming from SendGrid. You can verify the origin by checking headers or configuring an API key in SendGrid for additional security.
    • HTTPS: Always use an HTTPS endpoint for secure communication between SendGrid and your server.

    # Debugging and Testing

    • SendGrid provides tools to simulate incoming emails, which can be used to test your webhook configuration.
    • Ensure that your server’s response time is efficient. SendGrid expects a response within 20 seconds. If the email processing takes longer (e.g., saving attachments), consider using asynchronous background tasks.

    # Example Workflow

    1. A user sends an email to contact@example.com.
    2. SendGrid captures the email and forwards it to your Krayin webhook (http://yourdomain.com/admin/mail/inbound-parse).
    3. Krayin CRM processes the incoming email, stores the details, and displays the email in the Mail > Inbox section.

    # IMAP Inbound Parse

    Krayin CRM allows you to receive and manage your emails using the IMAP protocol. To integrate IMAP in Krayin CRM, we will use the Webklex-IMAP package as the email receiver driver.

    IMAP (Internet Message Access Protocol) allows you to access your emails from any device without downloading them to your computer. Emails stay on the server, and you view them directly, with attachments only downloaded if needed. IMAP is ideal for accessing email on multiple devices, as any changes (like reading or deleting) are synced across all devices, making email management efficient and ensuring data consistency everywhere.

    # Configuring IMAP Settings

    To properly configure your email service via IMAP, follow the steps below to set up the necessary parameters through the application’s configuration interface.

    # Step 1: Access IMAP Settings

    1. Open Your Application Dashboard:

      • Navigate to the Configuration section in your application.
    2. Select IMAP Settings:

      • Click on IMAP Settings from the menu.

    # Step 2: Enter IMAP Configuration Details

    In the IMAP settings interface, you will find fields to input the following parameters:

    Parameter Description Example
    Host The hostname of your email server. imap.example.com
    Port The port used for IMAP connections. 993 (for SSL)
    Encryption Type The encryption type for the connection (e.g., SSL, TLS). SSL
    Validate SSL Specify whether to validate the SSL certificate. true or false
    IMAP Username Your email account username (usually the full email address). user@example.com
    IMAP Password The password associated with your email account. yourpassword

    # Step 3: Example Configuration

    When filling out the IMAP settings, your input should resemble the following:

    • Host: imap.example.com
    • Port: 993
    • Encryption Type: SSL
    • Validate SSL: true or false
    • IMAP Username: user@example.com
    • IMAP Password: yourpassword

    # Step 4: Save Configuration

    After entering all required fields, click the Save button to store your IMAP configuration. This will ensure your application can connect to the email server using the provided settings.

    # Set IMAP as the Email Receiver Driver

    In the .env file, ensure that the MAIL_RECEIVER_DRIVER is set to webklex-imap:

    MAIL_RECEIVER_DRIVER=webklex-imap
    -

    This tells Krayin CRM to use the Webklex IMAP package to handle incoming emails.

    # Usage of IMAP in Krayin CRM

    Once the IMAP settings are configured in the .env file, Krayin CRM will be able to use IMAP to fetch emails from the specified email account.

    Make sure to check your email provider’s documentation for the correct IMAP settings.

    This tells Krayin CRM to use the Webklex IMAP package to handle incoming emails.

    # Usage of IMAP in Krayin CRM

    Once the IMAP settings are configured in the .env file, Krayin CRM will be able to use IMAP to fetch emails from the specified email account.

    Make sure to check your email provider’s documentation for the correct IMAP settings.

    - + diff --git a/master/advanced/events.html b/master/advanced/events.html index ac5df27..9f1b62b 100644 --- a/master/advanced/events.html +++ b/master/advanced/events.html @@ -9,7 +9,7 @@ - + @@ -117,7 +117,7 @@ } }

    # Events Fired in Krayin

    In Krayin, there are several events fired throughout its operations, allowing developers to hook into specific points in the application's lifecycle to customize behavior or add functionality. Here's a list of events that are fired in Krayin, which you can listen to and handle as needed by creating event listeners:

    Events name Functionality
    activity.create.before This event will be fired before activity gets created.
    activity.create.after This event will be fired after activity gets created.
    activity.update.before This event will be fired before activity gets updated.
    activity.update.after This event will be fired after activity gets updated.
    activities.file.create.before This event will be fired before file gets uploaded.
    activities.file.create.after This event will be fired after file gets uploaded.
    activity.delete.before This event will be fired before activity gets deleted.
    activity.delete.after This event will be fired after activity gets deleted.
    core.configuration.save.before This event will be fired before configuration gets created.
    core.configuration.save.after This event will be fired after configuration gets created.
    contacts.organization.create.before This event will be fired before organization created.
    contacts.organization.create.after This event will be fired after organization created .
    contacts.organization.update.before This event will be fired before organization gets updated.
    contacts.organization.update.after This event will be fired after organization gets updated.
    contact.organization.delete.before This event will be fired before organization get deleted.
    contact.organization.delete.after This event will be fired after organization get deleted.
    contacts.person.create.before This events will be fired before contact person gets created.
    contacts.person.create.after This events will be fired after contact person gets created.
    contacts.person.updated.before This events will be fired before contact person gets updated.
    contacts.person.updated.after This events will be fired after contact person gets updated.
    contacts.person.delete.before This events will be fired before contact person gets deleted.
    contacts.person.delete.after This events will be fired after contact person gets deleted.
    lead.create.before This event will be fired before leads gets created.
    lead.create.after This event will be fired after leads gets created.
    lead.update.before This event will be fired before leads gets updated.
    lead.update.after This event will be fired after leads gets updated.
    lead.delete.before This event will be fired before leads gets deleted.
    lead.delete.after This event will be fired after leads gets deleted.
    leads.quote.create.before This event will be fired before quotes leads gets created
    leads.quote.create.after This event will be fired after quotes leads gets created
    leads.quote.delete.before This event will be fired before quotes leads gets deleted
    leads.quote.delete.after This event will be fired after quotes leads gets deleted
    leads.tag.create.before This event will be fired before tag leads created
    leads.tag.create.after This event will be fired after tag leads created
    leads.tag.delete.before This event will be fired before tag leads deleted
    leads.tag.delete.after This event will be fired after tag leads deleted
    email.create.before This event will be fired before email gets created
    email.create.after This event will be fired after email gets created
    email.update.before This event will be fired before email gets updated
    email.update.after This event will be fired after email gets updated
    email.delete.before This event will be fired before email gets deleted
    email.delete.after This event will be fired after email gets deleted
    product.create.before This event will be fired before products get created
    product.create.after This event will be fired after products get created
    product.update.before This event will be fired before products get updated
    product.update.after This event will be fired after products get updated
    product.delete.before This event will be fired before products get deleted
    product.update.after This event will be fired after products get deleted
    quote.create.before This event will be fired before quote get created
    quote.create.after This event will be fired after quote get created
    quote.update.before This event will be fired before quote get updated
    quote.update.after This event will be fired after quote get updated
    quote.delete.before This event will be fired before quote get deleted
    quote.delete.after This event will be fired after quote get deleted
    settings.attribute.create.before This event will be fired before attribute get created
    settings.attribute.create.after This event will be fired after attribute get created
    settings.attribute.update.before This event will be fired before attribute get updated
    settings.attribute.update.after This event will be fired after attribute get updated
    settings.attribute.delete.before This event will be fired before attribute get deleted
    settings.attribute.delete.after This event will be fired after attribute get deleted
    settings.email_templates.create.before This event will be fired before email template get created
    settings.email_templates.create.after This event will be fired after email template get created
    settings.email_templates.update.before This event will be fired before email template get updated
    settings.email_templates.update.after This event will be fired after email template get updated
    settings.email_templates.delete.before This event will be fired before email template get deleted
    settings.email_templates.delete.after This event will be fired after email template get deleted
    settings.group.create.before This event will be fired before group get created
    settings.group.create.after This event will be fired after group get created
    settings.group.update.before This event will be fired before group get updated
    settings.group.update.after This event will be fired after group get updated
    settings.group.delete.before This event will be fired before group get deleted
    settings.group.delete.after This event will be fired after group get deleted
    settings.pipeline.create.before This event will be fired before pipeline get created
    settings.pipeline.create.after This event will be fired after pipeline get created
    settings.pipeline.update.before This event will be fired before pipeline get updated
    settings.pipeline.update.after This event will be fired after pipeline get updated
    settings.pipeline.delete.before This event will be fired before pipeline get deleted
    settings.pipeline.delete.after This event will be fired after pipeline get deleted
    settings.role.create.before This event will be fired before role get created
    settings.role.create.after This event will be fired after role get created
    settings.role.update.before This event will be fired before role get updated
    settings.role.update.after This event will be fired after role get updated
    settings.role.delete.before This event will be fired before role get deleted
    settings.role.delete.after This event will be fired after role get deleted
    settings.source.create.before This event will be fired before source get created
    settings.source.create.after This event will be fired after source get created
    settings.source.update.before This event will be fired before source get updated
    settings.source.update.after This event will be fired after source get updated
    settings.source.delete.before This event will be fired before source get deleted
    settings.source.delete.after This event will be fired after source get deleted
    settings.source.create.before This event will be fired before source get created
    settings.source.create.after This event will be fired after source get created
    settings.source.update.before This event will be fired before source get updated
    settings.source.update.after This event will be fired after source get updated
    settings.source.delete.before This event will be fired before source get deleted
    settings.source.delete.after This event will be fired after source get deleted
    settings.tag.create.before This event will be fired before tag get created
    settings.tag.create.after This event will be fired after tag get created
    settings.tag.update.before This event will be fired before tag get updated
    settings.tag.update.after This event will be fired after tag get updated
    settings.tag.delete.before This event will be fired before tag get deleted
    settings.tag.delete.after This event will be fired after tag get deleted
    settings.type.create.before This event will be fired before type get created
    settings.type.create.after This event will be fired after type get created
    settings.type.update.before This event will be fired before type get updated
    settings.type.update.after This event will be fired after type get updated
    settings.type.delete.before This event will be fired before type get deleted
    settings.type.delete.after This event will be fired after type get deleted
    settings.user.create.before This event will be fired before user get created
    settings.user.create.after This event will be fired after user get created
    settings.user.update.before This event will be fired before user get updated
    settings.user.update.after This event will be fired after user get updated
    settings.user.delete.before This event will be fired before user get deleted
    settings.user.delete.after This event will be fired after user get deleted
    settings.workflow.create.before This event will be fired before workflow get created
    settings.workflow.create.after This event will be fired after workflow get created
    settings.workflow.update.before This event will be fired before workflow get updated
    settings.workflow.update.after This event will be fired after workflow get updated
    settings.workflow.delete.before This event will be fired before workflow get deleted
    settings.workflow.delete.after This event will be fired after workflow get deleted
    user.account.update-password This event will be fired after user password gets updated
    settings.web_forms.create.before This event will be fired before web form get created
    settings.web_forms.create.after This event will be fired after web form get created
    settings.web_forms.update.before This event will be fired before web form get updated
    settings.web_forms.update.after This event will be fired after web form get updated
    settings.web_forms.delete.before This event will be fired before web form get deleted
    settings.web_forms.delete.after This event will be fired after web form get deleted

    # Listening to Existing Events

    Krayin uses events and listeners to implement the observer pattern, allowing you to respond to various actions and events within the application. You can listen to specific events and execute custom code when those events are triggered.

    # Registering a Listener

    Open the EventServiceProvider.php file located in the Providers directory of your Krayin application. This file is where you register event listeners.

    Inside the boot() method of EventServiceProvider.php, use the Event::listen method to register your listener. This method takes the event name and a callback function or a class method that will handle the event.

    Event::listen('lead.create.before', 'Webkul\Admin\Listeners\Leads@linkToEmail');
    -

    In the example above, we are listening to the lead.create.before event and specifying the createOrder function from the Order listener class in the Webkul\Notification\Listeners namespace.

    Replace 'lead.create.before' with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.

    By registering the listener, you have associated the createOrder function with the lead.create.before event. Whenever this event is triggered, the specified function will be executed.

    You can modify the listener function according to your requirements to perform the desired operation.

    In the example above, we are listening to the lead.create.before event and specifying the createOrder function from the Order listener class in the Webkul\Notification\Listeners namespace.

    Replace 'lead.create.before' with the specific event you want to listen to. In this example, it listens to the event triggered after saving an order during checkout.

    By registering the listener, you have associated the createOrder function with the lead.create.before event. Whenever this event is triggered, the specified function will be executed.

    You can modify the listener function according to your requirements to perform the desired operation.

    - + diff --git a/master/advanced/helpers.html b/master/advanced/helpers.html index 28cb5bf..cde2ce9 100644 --- a/master/advanced/helpers.html +++ b/master/advanced/helpers.html @@ -9,7 +9,7 @@ - + @@ -46,7 +46,7 @@

    # Format base price

    To format the price of provided price you can use the method core()->formatBasePrice()

    core()->formatBasePrice($price);
     

    # Get the config field

    To get the config field you can use the core()->getConfigField($fieldName)

    core()->getConfigField($fieldName);
     

    # Get the config data

    To retrieve the config data you can use the method core()->getConfigData($field)

    core()->getConfigData($field);
    -

    These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.

    These core helper methods provide various functionalities to simplify common tasks and streamline development in Krayin.

    - + diff --git a/master/advanced/index.html b/master/advanced/index.html index 4d0216b..381edc3 100644 --- a/master/advanced/index.html +++ b/master/advanced/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Digging Deeper

    Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.

    We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the Package Development section for a primer on creating and managing packages in Laravel.

    # Events and Event Handlers

    Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.

    # Helpers

    Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.

    # Overriding Core Models

    Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.

    - + (opens new window)

    # Digging Deeper

    Welcome to the "Digging Deeper" section of the Krayin documentation. Here, we will explore various advanced topics related to Krayin, which will enable you to customize and extend your CRM platform to suit your specific needs.

    We expect you to have knowledge of creating packages in Laravel. If you are new to package development, we recommend referring to the Package Development section for a primer on creating and managing packages in Laravel.

    # Events and Event Handlers

    Events and event handlers provide a powerful way to extend the functionality of Krayin by allowing you to react to specific actions or triggers within the application. We will show you how to utilize events and event handlers effectively, enabling you to integrate custom functionalities and automate processes.

    # Helpers

    Krayin includes a comprehensive set of helper functions that simplify common development tasks and enhance productivity. We will explore the various helper functions available, explaining their purpose and usage to assist you in writing clean and efficient code.

    # Overriding Core Models

    Sometimes, you may need to modify or extend the default behavior of Krayin's core models to accommodate your specific business requirements. We will demonstrate how to override core models effectively, enabling you to customize the behavior of Krayin without modifying the underlying codebase.

    + diff --git a/master/advanced/override-core-model.html b/master/advanced/override-core-model.html index c2f358d..374c7ba 100644 --- a/master/advanced/override-core-model.html +++ b/master/advanced/override-core-model.html @@ -9,7 +9,7 @@ - + @@ -65,7 +65,7 @@ { // } -

    Once registered, you can use dependency injection or other Laravel mechanisms to reference the interface(Webkul\Product\Contracts\Product as ProductContract) throughout your application. Laravel's service container will automatically resolve your custom model implementation (Webkul\Category\Models\Product) where the interface is referenced.

    By following this approach, you can effectively extend and override core models within Krayin using Concord, maintaining modularity and flexibility in your application's architecture.

    Once registered, you can use dependency injection or other Laravel mechanisms to reference the interface(Webkul\Product\Contracts\Product as ProductContract) throughout your application. Laravel's service container will automatically resolve your custom model implementation (Webkul\Category\Models\Product) where the interface is referenced.

    By following this approach, you can effectively extend and override core models within Krayin using Concord, maintaining modularity and flexibility in your application's architecture.

    - + diff --git a/master/advanced/render-event.html b/master/advanced/render-event.html index 875c17d..17519c0 100644 --- a/master/advanced/render-event.html +++ b/master/advanced/render-event.html @@ -9,7 +9,7 @@ - + @@ -58,7 +58,7 @@ }); } } -

    Replace 'path/to/before_content_template.blade.php' and 'path/to/after_content_template.blade.php' with the actual paths to the Blade template files you want to inject.

    WARNING

    Make sure that you have registered the EventServiceProvider in your own service provider.

    # Implementation Details

    • $viewRenderEventManager->addTemplate(): This method adds the specified template file to the rendering queue for the corresponding event. When the event is triggered during template rendering, Krayin will include the specified template's content at the designated injection point.

    • Event Handling: Ensure that you properly handle the events within your application’s event flow. This involves registering listeners correctly in EventServiceProvider and ensuring that the templates being injected are structured and formatted according to your application's requirements.

    # Considerations

    • Integration: Integrate this functionality carefully into your Krayin application to maintain coherence and readability of your codebase

    • Customization: Customize event names ('admin.contacts.persons.create.header.before', 'admin.contacts.persons.create.header.after') and template paths according to your specific application needs and structure.

    By following these steps, you can effectively leverage the view_render_event() function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.

    Replace 'path/to/before_content_template.blade.php' and 'path/to/after_content_template.blade.php' with the actual paths to the Blade template files you want to inject.

    WARNING

    Make sure that you have registered the EventServiceProvider in your own service provider.

    # Implementation Details

    • $viewRenderEventManager->addTemplate(): This method adds the specified template file to the rendering queue for the corresponding event. When the event is triggered during template rendering, Krayin will include the specified template's content at the designated injection point.

    • Event Handling: Ensure that you properly handle the events within your application’s event flow. This involves registering listeners correctly in EventServiceProvider and ensuring that the templates being injected are structured and formatted according to your application's requirements.

    # Considerations

    • Integration: Integrate this functionality carefully into your Krayin application to maintain coherence and readability of your codebase

    • Customization: Customize event names ('admin.contacts.persons.create.header.before', 'admin.contacts.persons.create.header.after') and template paths according to your specific application needs and structure.

    By following these steps, you can effectively leverage the view_render_event() function in Krayin to dynamically inject content into template sections, enhancing flexibility and customization options within your application.

    - + diff --git a/master/advanced/security-practice.html b/master/advanced/security-practice.html index 6a4a940..5cc1b97 100644 --- a/master/advanced/security-practice.html +++ b/master/advanced/security-practice.html @@ -9,7 +9,7 @@ - + @@ -51,7 +51,7 @@

    # Cross-Site Scripting Protection (X-XSS Protection)

    Set the X-XSS-Protection response header to enable browsers to detect and prevent cross-site scripting (XSS) attacks:

    X-XSS-Protection: 1; mode=block
     

    # X-Frame-Options​

    The X-Frame-Options response header protects applications against clickjacking. It specifies whether the content can be displayed within frames:

    X-Frame-Options: deny
     

    # X-Content-Type-Options​

    The X-Content-Type-Options response header forces the browser to disable MIME sniffing, preventing MIME sniffing vulnerabilities:

    X-Content-Type-Options: nosniff
    -

    # Content Security Policy (CSP)

    Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.

    # Continuous Logging And Monitoring

    Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.

    By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.

    # Content Security Policy (CSP)

    Implement a Content Security Policy (CSP) response header to control resources that can be loaded in users' browsers. CSP helps detect and mitigate attacks such as XSS and clickjacking.

    # Continuous Logging And Monitoring

    Maintain continuous logging and monitoring of all network access and cardholder data activities. Keep an eye out for large volume orders of a single item from new customers, a series of orders shipped to the same address but using different payment methods.

    By implementing these best security practices, you can enhance the security of your system and protect it from potential threats.

    - + diff --git a/master/api/getting-started-with-the-api.html b/master/api/getting-started-with-the-api.html index c2f4dbb..c428ac4 100644 --- a/master/api/getting-started-with-the-api.html +++ b/master/api/getting-started-with-the-api.html @@ -9,7 +9,7 @@ - + @@ -48,11 +48,11 @@ use HasApiTokens; ... } -
    - + diff --git a/master/api/index.html b/master/api/index.html index 6868316..8b907a8 100644 --- a/master/api/index.html +++ b/master/api/index.html @@ -9,7 +9,7 @@ - + @@ -35,7 +35,7 @@ Contact Us (opens new window)

    # Krayin APIs

    # REST API

    The Krayin REST API enables seamless integration and interaction with the Krayin CRM system. It follows the REST (Representational State Transfer) architecture, providing a robust set of endpoints for managing CRM-related data.

    Key Features

    • CRUD Operations: The API supports all basic CRUD (Create, Read, Update, Delete) operations, allowing for comprehensive management of CRM data including customers, leads, contacts, and more.

    • Pagination: To enhance performance and manage large datasets efficiently, the API includes support for pagination. This helps in retrieving data in chunks rather than loading large volumes of data at once.

    Integration Capabilities: The REST API is designed to integrate seamlessly with various external systems and applications, including:

    • PWA (Progressive Web Applications): Use the API to develop PWAs that interact with the CRM, offering a modern, app-like experience on the web. Mobile Applications: Integrate with mobile apps to enable functionalities such as customer management, lead tracking, and reporting directly from the mobile interface. -Data Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.
    - +Data Access and Manipulation: The API provides endpoints to access, update, and manage CRM data, ensuring that you can build custom solutions and integrations tailored to your specific business needs.
    + diff --git a/master/architecture/index.html b/master/architecture/index.html index 157dc99..d42aaef 100644 --- a/master/architecture/index.html +++ b/master/architecture/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Architecture concepts

    Krayin is very easy framework to understand. The goal of this document to give you overview of how krayin works.

    We love to work with hot Opensource (opens new window) softwares so Krayin is built on technologies such as PHP (opens new window), Laravel (opens new window) and Vue.js (opens new window)

    As Krayin solution for SMEs and Enterprises for complete customer lifecycle management.

    Laravel packages are being used to separate each functionality such as Leads, Quotes, Mail, Activities, Contacts, Products Settings, etc.

    We developed and used built-in components of Vue.js

    Krayin registers useful events that are triggered on most of the pages which could enable to perform some custom operations in the application.

    - + (opens new window)

    # Architecture concepts

    Krayin is very easy framework to understand. The goal of this document to give you overview of how krayin works.

    We love to work with hot Opensource (opens new window) softwares so Krayin is built on technologies such as PHP (opens new window), Laravel (opens new window) and Vue.js (opens new window)

    As Krayin solution for SMEs and Enterprises for complete customer lifecycle management.

    Laravel packages are being used to separate each functionality such as Leads, Quotes, Mail, Activities, Contacts, Products Settings, etc.

    We developed and used built-in components of Vue.js

    Krayin registers useful events that are triggered on most of the pages which could enable to perform some custom operations in the application.

    + diff --git a/master/architecture/modular-design.html b/master/architecture/modular-design.html index bcd1cd2..ba78efc 100644 --- a/master/architecture/modular-design.html +++ b/master/architecture/modular-design.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Modular Design in Krayin

    Krayin is designed with a modular architecture to enhance flexibility, scalability, and maintainability. This approach allows developers to manage and extend the application more efficiently.

    # Key Benefits of Modular Design

    1. Separation of Concerns: Modules encapsulate specific functionality, promoting a clear separation between different parts of the application.
    2. Reusability: Modules can be reused across different projects, reducing duplication of effort and speeding up development.
    3. Maintainability: Isolated modules make it easier to identify and fix bugs, and to implement new features without affecting unrelated parts of the application.
    4. Scalability: Modular design supports scaling the application by enabling the addition of new modules without major changes to the existing codebase.

    # Module Structure in Krayin

    Each module in Krayin is organized into a well-defined structure, ensuring consistency and ease of management. A typical module contains the following directories:

    • Config: Configuration files specific to the module.
    • Database: Migrations, seeders, and factories related to the module.
    • Http: Controllers, middleware, and requests handling HTTP interactions.
    • Models: Eloquent models representing the data structures used by the module.
    • Repositories: Implementation of the Repository pattern for data access.
    • Resources: Views, language files, and other resources.
    • Routes: Module-specific routes.
    • Tests: Unit and feature tests for the module.

    The modular design in Krayin facilitates a clean, organized, and scalable development process. By adhering to the principles of modular architecture, developers can create robust and maintainable applications that are easy to extend and manage.

    - + diff --git a/master/architecture/packages.html b/master/architecture/packages.html index 9b37234..f82b7f5 100644 --- a/master/architecture/packages.html +++ b/master/architecture/packages.html @@ -9,7 +9,7 @@ - + @@ -49,7 +49,7 @@ Scheduled Actions: Set up actions to occur at a later date, such as sending a reminder email after a lead has been idle for a specific number of days. This keeps your team proactive and ensures no lead falls through the cracks.

    1. Webhooks

    Integration with External Systems: Webhooks allow Krayin CRM to communicate with other systems and applications in real-time. When a trigger event occurs, a webhook sends data to an external URL, enabling seamless integration with other tools like marketing platforms, analytics systems, or custom applications. Real-Time Updates: Automate the process of sending real-time updates to external systems when certain events happen within the CRM. For example, when a new contact is added or a deal is closed, the relevant data can be instantly pushed to other systems to keep all your tools in sync. Custom Actions: Utilize webhooks to define custom actions that go beyond the built-in capabilities of Krayin CRM. This flexibility allows you to tailor the CRM to fit the unique needs of your business.

    Service provider enables features such as loading routes, migrations, languages or publishing views, etc so Krayin is developed considering these aspects.

    # Datagrid

    The DataGrid package in Krayin empowers administrators with a versatile solution for displaying and managing tabular data within the admin panel. It incorporates crucial components like models, repositories, and database interactions to streamline data handling and enhance user experience.

    # Dynamic Data Presentation:

    • Dynamic Data Presentation

      • Allows administrators to configure columns, filters, sorting options, and pagination settings for displaying data tables.
    • Advanced Filtering and Sorting

      • Enables administrators to apply filters based on various criteria to refine data views.

      • Supports sorting functionalities to organize data based on specified attributes.

    # Warehouse

    The Warehouse Package in Krayin CRM is designed to manage warehouse information efficiently. It allows users to store and organize key details about each warehouse, including contact information, descriptions, and addresses. This package provides the necessary tools to handle warehouse-related data, which is crucial for managing inventory and logistics operations within the CRM.

    Key Features

    • Warehouse Management:

    The package provides functionalities to create, update, and manage warehouses within the CRM. Each warehouse can be uniquely identified by its name and associated with specific contact information, such as email addresses, phone numbers, and physical addresses. -Contact Information Handling:

    The package supports storing multiple contact details for each warehouse, including names, emails, and phone numbers. This feature ensures that all relevant contact information is easily accessible for communication and coordination.

    • Address Management:

    The package allows you to store and manage the full address details of each warehouse, including street, city, state, and postal code. This is useful for ensuring that all logistical operations are correctly aligned with the physical locations of the warehouses.

    - + diff --git a/master/architecture/repository-pattern.html b/master/architecture/repository-pattern.html index 84d5c73..bf22ac0 100644 --- a/master/architecture/repository-pattern.html +++ b/master/architecture/repository-pattern.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Repository Pattern in Krayin

    Krayin employs the Repository Pattern to further enhance the flexibility and maintainability of its codebase.

    To add an additional layer of abstraction and promote better code organization, Krayin incorporates the Repository Pattern on top of the ORM.

    # Benefits of the Repository Pattern

    • Consistency: Restricts the use of raw queries throughout the application, ensuring a consistent approach to database operations.
    • Maintainability: Enhances code organization, making it easier to manage and maintain.
    • Flexibility: Facilitates the implementation of changes without affecting the rest of the codebase.

    # Implementation in Krayin

    Krayin utilizes the Prettus Repository (opens new window) package to facilitate the implementation of the Repository Pattern. This choice provides several benefits:

    • Standardization: Ensures a standardized approach to repository implementation.
    • Extensibility: Makes it easier to extend and customize the application as needed.
    • Separation of Concerns: Promotes a clear separation between business logic and data access logic.

    By adopting the Repository Pattern with the Prettus Repository package, Krayin enhances the overall architecture of the application, making it more robust and easier to evolve over time.

    # Eloquent ORM

    Eloquent (opens new window), the ORM (Object-Relational Mapping) in Laravel, provides a higher level of abstraction and simplifies database interactions. With Eloquent, developers can focus on manipulating objects rather than dealing with raw SQL queries, making database operations more convenient and intuitive.

    - + diff --git a/master/architecture/theme.html b/master/architecture/theme.html index b76278d..02681e5 100644 --- a/master/architecture/theme.html +++ b/master/architecture/theme.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Theme

    CRM solution for SMEs and Enterprises, themes provides an elegant way to attract users.

    - + (opens new window)

    # Theme

    CRM solution for SMEs and Enterprises, themes provides an elegant way to attract users.

    + diff --git a/master/custom-attributes/custom-attribute.html b/master/custom-attributes/custom-attribute.html index 7c7b0b8..8378da0 100644 --- a/master/custom-attributes/custom-attribute.html +++ b/master/custom-attributes/custom-attribute.html @@ -9,7 +9,7 @@ - + @@ -107,7 +107,7 @@ return $product; } -
    - + diff --git a/master/custom-attributes/index.html b/master/custom-attributes/index.html index 92c86b6..25dc8aa 100644 --- a/master/custom-attributes/index.html +++ b/master/custom-attributes/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Custom Attribute Creation

    Attributes helps you to store data dynamically related to any item while creating such as Person, Organization, Product and Lead creation etc.

    - + (opens new window)

    # Custom Attribute Creation

    Attributes helps you to store data dynamically related to any item while creating such as Person, Organization, Product and Lead creation etc.

    + diff --git a/master/custom-attributes/uses.html b/master/custom-attributes/uses.html index 5a53af7..f8e4d9b 100644 --- a/master/custom-attributes/uses.html +++ b/master/custom-attributes/uses.html @@ -9,7 +9,7 @@ - + @@ -34,7 +34,7 @@ (opens new window) Contact Us (opens new window)

    # Create and using a new attribute

    Krayin CRM is a highly customizable, attribute-based CRM system that allows you to manage various entities such as leads, quotes, contacts, and more through the use of attributes. This flexibility enables you to tailor the system to meet your specific business needs.

    • Creating Attributes

    To create an attribute in Krayin, follow these steps:

    1. Navigate to the Settings:

      • In the main dashboard, go to Settings in the sidebar menu.
    2. Go to Attributes Section:

      • Under the Settings menu, select Attributes to manage existing attributes or create new ones.
    3. Create a New Attribute:

      • Click on the Create Attribute button.
      • Fill out the form with the necessary details, such as the name, code, and type of the attribute.
    4. Entity Type:

      • One of the key fields in the attribute creation form is the Entity Type. The Entity Type determines where the attribute will be applied in the system. The available entity types include: -
        1. Leads: Attributes created under this entity type will be associated with the Leads module.
        2. Person: Use this entity type to create attributes for the Person module, allowing you to manage individual contacts.
        3. Organization: Attributes for managing organizations and companies can be created under this entity type.
        4. Products: Attributes associated with products can be managed under this entity type.
        5. Quotes: If you want to manage quotes with specific attributes, select this entity type.
        6. Warehouses: This entity type is for managing warehouses and their specific attributes.
    5. Save the Attribute:

      • After filling in all the required fields, click Save. The attribute will now be available for the selected entity type.
    • Using Attributes

    Once you have created an attribute, it will appear in the respective module based on the entity type you selected during creation. For example:

    • If you created an attribute for Leads, it will be available when managing or viewing leads.
    • Similarly, attributes for Person, Organization, Products, Quotes, and Warehouses will be accessible within their corresponding entity type

    These attributes allow you to add custom fields, data types, and other specific requirements to the respective entities, making Krayin a powerful and flexible CRM solution for your business.

    • Summary

    Krayin’s attribute system provides extensive customization options, making it easy to manage various CRM entities according to your unique requirements. By selecting the appropriate Entity Type when creating an attribute, you ensure that the attribute is applied to the correct module within the CRM. This approach allows you to build a CRM system tailored to your business needs, with custom fields and data management options for leads, quotes, contacts, and more.

    - + diff --git a/master/introduction/docker.html b/master/introduction/docker.html index ce4b22b..0dbd9a3 100644 --- a/master/introduction/docker.html +++ b/master/introduction/docker.html @@ -9,7 +9,7 @@ - + @@ -85,7 +85,7 @@

    # Accessing Krayin

    • Admin Panel
      Access the admin panel at:
      http(s)://your_server_endpoint/admin/login
      Use the default credentials:

      • Email: admin@example.com
      • Password: admin123
    • Customer Registration
      -Register and log in as a customer at:
      http(s)://your_server_endpoint/customer/register

    - + diff --git a/master/introduction/index.html b/master/introduction/index.html index bec2c2b..7f6e1d7 100644 --- a/master/introduction/index.html +++ b/master/introduction/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Introduction

    Krayin is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window), a PHP (opens new window) framework and Vue.js (opens new window), a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    To learn more about Krayin's features and try a demo (opens new window), check out our website Krayin (opens new window).

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    - + (opens new window)

    # Introduction

    Krayin is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window), a PHP (opens new window) framework and Vue.js (opens new window), a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    To learn more about Krayin's features and try a demo (opens new window), check out our website Krayin (opens new window).

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    + diff --git a/master/introduction/installation.html b/master/introduction/installation.html index 20e4ce1..9a88b65 100644 --- a/master/introduction/installation.html +++ b/master/introduction/installation.html @@ -9,7 +9,7 @@ - + @@ -55,7 +55,7 @@

    # On Your Local Server

    To access Krayin on your local server, follow these steps:

    1. Configure your HTTP server to point to the public/ directory of the project.

    2. Run the following command:

      php artisan serve
       
    3. Open your browser and access the provided local server URL.

    # Login as an Admin

    To log in as an admin, visit https://example.com/admin/. If you used the php artisan krayin-crm:install command, use the following credentials:

    Email: admin@example.com
     Password: admin123
    -

    # Contributing

    Contributions are welcome! Follow the contribution guidelines to get started.

    # License

    Krayin is open-sourced software licensed under the MIT license.

    # Contributing

    Contributions are welcome! Follow the contribution guidelines to get started.

    # License

    Krayin is open-sourced software licensed under the MIT license.

    - + diff --git a/master/introduction/requirements.html b/master/introduction/requirements.html index 4ad327e..1ff61e3 100644 --- a/master/introduction/requirements.html +++ b/master/introduction/requirements.html @@ -9,7 +9,7 @@ - + @@ -36,7 +36,7 @@ (opens new window)

    # Requirements

    Before installing Krayin please make sure your server meets the following requirements,

    # Server configuration

    • SERVER: Apache 2 or NGINX
    • RAM: 4GB or higher
    • Node: v16.16.0 (LTS) or higher
    • PHP: 8.1 or higher
    • Composer: 2.5 or higher

    # PHP Extensions

    Ensure the following extensions are installed and enabled. You can check using the phpinfo() page or the php -m command.

    • php-intl extension: This extension is required for internationalization support in Krayin.

    • php-gd extension: The php-gd extension must be properly installed to ensure correct image functionality in the project. If not installed correctly, image-related features may not work as expected.

      Note

      It is important to ensure proper installation of the php-gd extension to avoid any issues with image manipulation in Krayin.

    # PHP Configuration

    Open your php.ini file and modify the following settings.

    • memory_limit: Set the memory_limit directive to 4G or higher to ensure sufficient memory allocation for the application.

    • max_execution_time: Adjust the max_execution_time directive to 360 or higher. This value determines the maximum time (in seconds) a script is allowed to run. Increasing this value ensures that longer operations, such as import/export processes, can be completed successfully.

    • date.timezone: Set the date.timezone directive to your specific timezone. For example, Asia/Kolkata. This ensures that date and time-related functions work accurately based on the specified timezone.

    memory_limit = 4G
     max_execution_time = 360
     date.timezone = Asia/Kolkata <- Change this to your own timezone.
    -

    Remember to restart your web server

    Whenever you make changes to the PHP configuration file, be sure to restart Apache or NGINX to apply the modifications.

    # Supported Database Servers

    Krayin supports the following database servers:

    • MySQL: Version 8.0.32 or higher is recommended for optimal performance and compatibility.

    • MariaDB: Version 10.3 or higher is recommended for optimal performance and compatibility.

    • Database Collation: The recommended collation for the database is utf8mb4_unicode_ci, which ensures proper handling of Unicode characters and multilingual support.

    Remember to restart your web server

    Whenever you make changes to the PHP configuration file, be sure to restart Apache or NGINX to apply the modifications.

    # Supported Database Servers

    Krayin supports the following database servers:

    • MySQL: Version 8.0.32 or higher is recommended for optimal performance and compatibility.

    • MariaDB: Version 10.3 or higher is recommended for optimal performance and compatibility.

    • Database Collation: The recommended collation for the database is utf8mb4_unicode_ci, which ensures proper handling of Unicode characters and multilingual support.

    - + diff --git a/master/packages/add-menu-in-admin.html b/master/packages/add-menu-in-admin.html index 1518ba8..941c2f7 100644 --- a/master/packages/add-menu-in-admin.html +++ b/master/packages/add-menu-in-admin.html @@ -9,7 +9,7 @@ - + @@ -91,7 +91,7 @@ } }

    # Optimize Application

    Finally, run the following command to optimize your application:

    php artisan optimize:clear
    -

    After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.

    # Level of Menu

    In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:

    # First Level (Sidebar)

    This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.

    # Second Level (Hover Menu)

    When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.

    After completing these steps, your custom menu item (categories) with its associated route and icon should appear within the admin panel of Krayin.

    # Level of Menu

    In Krayin, the menu offers two levels of navigation to organize and access different sections and features efficiently:

    # First Level (Sidebar)

    This level appears in the sidebar and contains the primary menu items. These are the main sections of the admin panel, such as Dashboard, Catalog, and Sales.

    # Second Level (Hover Menu)

    When you hover over an item in the first-level sidebar menu, the second level appears. This level contains sub-items related to the main section, providing more specific options. For example, hovering over "Catalog" might show options like Products, Categories, and Attributes.

    - + diff --git a/master/packages/assets.html b/master/packages/assets.html index 38c1ec1..244bfd5 100644 --- a/master/packages/assets.html +++ b/master/packages/assets.html @@ -9,7 +9,7 @@ - + @@ -161,7 +161,7 @@ <script type="text/javascript" src="{{ asset('vendor/webkul/category/assets/js/category.js') }}"></script> <script type="text/javascript" src="{{ asset('vendor/webkul/ui/assets/js/ui.js') }}"></script> -
    - + diff --git a/master/packages/blade-components.html b/master/packages/blade-components.html index fe22398..0dc1040 100644 --- a/master/packages/blade-components.html +++ b/master/packages/blade-components.html @@ -9,7 +9,7 @@ - + @@ -254,7 +254,7 @@ show-placeholders="true" :uploaded-images="$product->images" /> -
    - + diff --git a/master/packages/controllers.html b/master/packages/controllers.html index 0c8aabc..6229a9c 100644 --- a/master/packages/controllers.html +++ b/master/packages/controllers.html @@ -9,7 +9,7 @@ - + @@ -98,7 +98,7 @@ ├── Controller.php └── Category └── CategoryController.php -

    By following these steps, you will have created the necessary structure and files for handling category within your "Category" package. You can now add the specific logic for each method to handle the functionality required for your category into the admin.

    By following these steps, you will have created the necessary structure and files for handling category within your "Category" package. You can now add the specific logic for each method to handle the functionality required for your category into the admin.

    - + diff --git a/master/packages/create-acl.html b/master/packages/create-acl.html index 72bde72..c846930 100644 --- a/master/packages/create-acl.html +++ b/master/packages/create-acl.html @@ -9,7 +9,7 @@ - + @@ -75,7 +75,7 @@ }

    Ensure that the path specified in mergeConfigFrom matches the location of your acl.php file.

    This will merge the ACL configuration with the existing configuration.

    # Clear Configuration Cache

    After making changes, clear the configuration cache to apply the latest ACL configuration:

    php artisan optimize
     

    # Verify in Admin Panel

    Check the updated ACL configuration within the admin panel to confirm that menu items are correctly displayed and sorted according to your configuration.

    This will ensure that the latest ACL configuration is used.

    # Checking Roles and Permissions

    To manage roles and permissions effectively:

    # Access Roles

    In the Admin model located in Webkul\User\Models, utilize the relationship with the Role model to manage roles associated with users.

    # Permission Checks

    Use the bouncer() helper function to verify if a user has specific permissions. Example usage:

    bouncer()->hasPermission($permission)
    -

    Replace $permission with the actual permission you want to check.

    By following these steps, you can seamlessly configure and manage Access Control List (ACL) settings in Krayin, ensuring secure and controlled access to administrative functionalities.

    Replace $permission with the actual permission you want to check.

    By following these steps, you can seamlessly configure and manage Access Control List (ACL) settings in Krayin, ensuring secure and controlled access to administrative functionalities.

    - + diff --git a/master/packages/create-migrations.html b/master/packages/create-migrations.html index fce9fa7..82c41b7 100644 --- a/master/packages/create-migrations.html +++ b/master/packages/create-migrations.html @@ -9,7 +9,7 @@ - + @@ -97,7 +97,7 @@ } }

    # Creating Tables from Migrations

    Run the following command to create the Category table in your database.

    php artisan migrate
    -
    - + diff --git a/master/packages/create-models.html b/master/packages/create-models.html index 2ba5e75..7134263 100644 --- a/master/packages/create-models.html +++ b/master/packages/create-models.html @@ -9,7 +9,7 @@ - + @@ -138,7 +138,7 @@ \Webkul\Category\Providers\ModuleServiceProvider::class, ] ]; -
    - + diff --git a/master/packages/create-package.html b/master/packages/create-package.html index 85f0fb8..3725a37 100644 --- a/master/packages/create-package.html +++ b/master/packages/create-package.html @@ -9,7 +9,7 @@ - + @@ -123,7 +123,7 @@ // ... ];

    # Run the Commands

    Run the following command to autoload your package:

       composer dump-autoload
    -

    Your package is now ready to use !

    Your package is now ready to use !

    - + diff --git a/master/packages/datagrid.html b/master/packages/datagrid.html index 19e3252..b42aca3 100644 --- a/master/packages/datagrid.html +++ b/master/packages/datagrid.html @@ -9,7 +9,7 @@ - + @@ -215,7 +215,7 @@ ]); } } -
    - + diff --git a/master/packages/index.html b/master/packages/index.html index 062b5e5..09965f7 100644 --- a/master/packages/index.html +++ b/master/packages/index.html @@ -9,7 +9,7 @@ - + @@ -86,7 +86,7 @@ ├── index.blade.php ├── create.blade.php └── edit.blade.php -
    - +
    + diff --git a/master/packages/layouts.html b/master/packages/layouts.html index 227b57c..014682f 100644 --- a/master/packages/layouts.html +++ b/master/packages/layouts.html @@ -9,7 +9,7 @@ - + @@ -56,7 +56,7 @@ // </script> @endpush -
    Prop Name Description
    @extends('category::layouts.master') This @extends Blade directive to specify which layout the child view should "inherit"
    @section('page_title') This is used to define the title of the page.
    @section('content-wrapper') This is used to define the body of the page.
    @push('css') This is used to add additional css.
    @push('scripts') This is used to add additional javascript.

    WARNING

    Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in lang/app.php.

    If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside Resources\Views\Layouts\master.blade.php

    Prop Name Description
    @extends('category::layouts.master') This @extends Blade directive to specify which layout the child view should "inherit"
    @section('page_title') This is used to define the title of the page.
    @section('content-wrapper') This is used to define the body of the page.
    @push('css') This is used to add additional css.
    @push('scripts') This is used to add additional javascript.

    WARNING

    Notice that there are translations used in the blade files, so you will also need to add the corresponding translations in lang/app.php.

    If you don't want to include these layouts, you can create your own master file inside the creation layouts directory inside Resources\Views\Layouts\master.blade.php

    - + diff --git a/master/packages/localization.html b/master/packages/localization.html index 25f880e..a307461 100644 --- a/master/packages/localization.html +++ b/master/packages/localization.html @@ -9,7 +9,7 @@ - + @@ -99,7 +99,7 @@ } }

    # Explanation

    • This code uses $this->loadTranslationsFrom to register translations from the lang directory of your package (packages/ Webkul/Category/src/Resources/lang) under the namespace 'category'.

    • The loadTranslationsFrom method registers translations for the 'category' namespace from the specified path (__DIR__ . '/../Resources/lang').

    • This makes translations accessible throughout your Laravel application using the 'category' namespace prefix.

    # Use Translations in Blade Files

    In your Blade templates (.blade.php files), you can use the @lang helper function to retrieve translations. Use the namespace 'category' followed by the translation key. For example:

    @lang('category::categories.index.title')
    -

    # Explanation

    • The @lang('category::categories.index.title') syntax fetches the translation for for categories > index > title

    • Replace 'categories.index.title' with your actual translation keys to use different translations as needed in your application.

    By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.

    # Explanation

    • The @lang('category::categories.index.title') syntax fetches the translation for for categories > index > title

    • Replace 'categories.index.title' with your actual translation keys to use different translations as needed in your application.

    By following these steps, you've effectively loaded translations from your package and integrated them into your Laravel application's Blade templates. This allows you to maintain language-specific content and support localization within your package.

    - + diff --git a/master/packages/routes.html b/master/packages/routes.html index a4edf45..fa9903a 100644 --- a/master/packages/routes.html +++ b/master/packages/routes.html @@ -9,7 +9,7 @@ - + @@ -91,7 +91,7 @@ Route::delete('categories/{id}', [CategoryController::class, 'destroy']);

    # PATCH

    The PATCH method is similar to PUT, but it is used to make partial updates to data on the server.

    // Define a route that responds to a PATCH request
     Route::patch('categories/{id}', [CategoryController::class, 'partialUpdate']);
    -
    - + diff --git a/master/packages/store-data-through-repositories.html b/master/packages/store-data-through-repositories.html index d6aeaae..f357a1d 100644 --- a/master/packages/store-data-through-repositories.html +++ b/master/packages/store-data-through-repositories.html @@ -9,7 +9,7 @@ - + @@ -76,7 +76,7 @@

    # FindWhere

    The findWhere method is called on the categoryRepository instance. This method adds a query constraint to filter the results based on a specified condition.

    $categories = $this->categoryRepository->findWhere([
         'status' => 'active',
     ]);
    -

    The model() method within CategoryRepository.php returns the path of your contract class (CategoryContract in this example). This method initializes the model instance used throughout the repository for database interactions.

    Your CategoryRepository is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.

    By utilizing the CategoryRepository, you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.

    The model() method within CategoryRepository.php returns the path of your contract class (CategoryContract in this example). This method initializes the model instance used throughout the repository for database interactions.

    Your CategoryRepository is now set up and ready for use within your application. It encapsulates the logic for interacting with category data, following best practices for separation of concerns and promoting clean architecture.

    By utilizing the CategoryRepository, you can efficiently perform database operations related to categorys while maintaining a structured and maintainable codebase.

    - + diff --git a/master/packages/validation.html b/master/packages/validation.html index 012501b..9a68ac0 100644 --- a/master/packages/validation.html +++ b/master/packages/validation.html @@ -9,7 +9,7 @@ - + @@ -97,7 +97,7 @@ <input v-validate="'required|email'" name="email" type="text"> <input v-validate="'required|min:6'" type="password" name="password"> -
    - + diff --git a/master/packages/views.html b/master/packages/views.html index 3aa183a..1ef0cdb 100644 --- a/master/packages/views.html +++ b/master/packages/views.html @@ -9,7 +9,7 @@ - + @@ -103,7 +103,7 @@ return view('category::category.index', compact('categories')); } } -

    # Explanation

    • The view helper function in Laravel is used within the index method of the CategoryController to render the category::category.index view.

    • It accepts two parameters the name of the view (category::category.index) and an array of data (compact('categories')) to pass to the view.

    # Blade File Naming Convention

    Krayin utilizes Blade templates to handle listing, creation, and updating operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.

    # Listing (Index Blade):

    • The index.blade.php template is used to display a list of all records (categories).

    • The controller's index method fetches all categories and passes them to the view.

    # Creation (Create Blade):

    • The create.blade.php template contains a form for creating new records.

    • The controller's create method renders this view.

    # Updating (Edit Blade):

    • The edit.blade.php template contains a form for editing existing records.

    • The controller's edit method fetches the specific categories and passes it to the view.

    By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.

    # Explanation

    • The view helper function in Laravel is used within the index method of the CategoryController to render the category::category.index view.

    • It accepts two parameters the name of the view (category::category.index) and an array of data (compact('categories')) to pass to the view.

    # Blade File Naming Convention

    Krayin utilizes Blade templates to handle listing, creation, and updating operations for resources like products, leads, persons, organizations, and categories. This section provides a detailed guide on how to implement these operations using Blade templates within your Krayin package.

    # Listing (Index Blade):

    • The index.blade.php template is used to display a list of all records (categories).

    • The controller's index method fetches all categories and passes them to the view.

    # Creation (Create Blade):

    • The create.blade.php template contains a form for creating new records.

    • The controller's create method renders this view.

    # Updating (Edit Blade):

    • The edit.blade.php template contains a form for editing existing records.

    • The controller's edit method fetches the specific categories and passes it to the view.

    By following these steps, you can effectively utilize Blade templates in Krayin for listing, creating, and updating resources, ensuring a structured and maintainable approach to managing CRUD operations within your application.

    - + diff --git a/master/prologue/contribution-guide.html b/master/prologue/contribution-guide.html index 1d72555..4e8e46c 100644 --- a/master/prologue/contribution-guide.html +++ b/master/prologue/contribution-guide.html @@ -9,7 +9,7 @@ - + @@ -45,7 +45,7 @@ { // } -
    - + diff --git a/master/prologue/index.html b/master/prologue/index.html index 57bebd8..b438783 100644 --- a/master/prologue/index.html +++ b/master/prologue/index.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

    # Prologue

    # Introduction to Krayin

    Krayin (opens new window) CRM is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window) (a PHP framework), Tailwind Css (opens new window) and Vue.js (opens new window) a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    We also have a forum for any type of concerns, feature requests, or discussions. Try our demo (opens new window) or you can visit: Krayin (opens new window)

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    - + (opens new window)

    # Prologue

    # Introduction to Krayin

    Krayin (opens new window) CRM is a hand tailored CRM framework built on some of the hottest opensource technologies such as Laravel (opens new window) (a PHP framework), Tailwind Css (opens new window) and Vue.js (opens new window) a progressive Javascript framework.

    Free & Opensource Laravel CRM solution for SMEs and Enterprises for complete customer lifecycle management.

    We also have a forum for any type of concerns, feature requests, or discussions. Try our demo (opens new window) or you can visit: Krayin (opens new window)

    # Key Features of Krayin

    Krayin offers a comprehensive suite of features designed to empower developers and companies to effectively engage with both current and potential customers.

    # CRM Dashboard

    Monitor new records in real-time with an intuitive dashboard. Quickly view your leads, activities, customers, and products, all at a glance.

    # Convert Opportunities into Revenue

    Our Open Source CRM equips you with all the tools needed to capture important leads and manage opportunities. Easily mark leads as won or lost and view live updates on your dashboard.

    # Manage Interaction

    Efficient communication with customers is essential for sales success. Seamless interaction with customers increases the likelihood of closing deals faster. Manage and track all your email interactions with customers in one place and stay updated.

    # Access Control List (ACL)

    Assign users to specific roles to ensure they have appropriate access to records. Control who can edit, create, and delete records. As an administrator, you can configure both users and roles to manage access effectively.

    # Activities Management

    Keep track of various sales activities like meetings, calls, and notes with the activities section. View all activities to avoid missing opportunities. Add or delete activities and get real-time insights on the dashboard.

    # Kanban Visual Leads

    The Kanban view organizes data for better understanding. Leads are displayed based on their stages, providing a clear idea of their progress and the expected revenue.

    # Unlimited Custom Fields

    Custom fields are essential for adapting a CRM to any business. Add custom fields as needed for leads, persons, and organizations to tailor the CRM to your specific requirements.

    # Product Creation

    Manage all the products and services your company offers, and keep track of your sales to add value to your leads. Monitor which products and services perform well with customers and identify where sales are lost.

    # Contact Management

    Access comprehensive information about the individuals and organizations you do business with. Manage all your contact information in one place for easy and efficient communication.

    # Modular Design

    Krayin features a modular design, providing developers with the flexibility to customize and extend the platform's functionalities to meet specific company requirements. This allows for precise tailoring of your CRM to suit your unique needs.

    # Community and Support

    Krayin has a vibrant and supportive community of developers and users who actively contribute to its growth and improvement.

    • Explore Krayin: Visit our website at Krayin (opens new window) to discover more about Krayin's features and experience a demo.

    • GitHub Repository: Access the Krayin repository on GitHub (opens new window) with over 8.8K+ stars, reflecting its popularity and community support.

    Join the Krayin community today and manage your customer relationships with ease.

    + diff --git a/master/prologue/upgrade-guide.html b/master/prologue/upgrade-guide.html index 18b3c03..918184d 100644 --- a/master/prologue/upgrade-guide.html +++ b/master/prologue/upgrade-guide.html @@ -9,7 +9,7 @@ - + @@ -44,11 +44,11 @@
  • Copy the contents of the previous version's dictory (e.g., old-project/storage/app/public) to the corresponding dictory in the latest version (e.g., new-project/storage/app/public).

    TIP

    If your existing project depends on local storage, has changed paths, or requires previous logs, ensure to include those as well.

  • Once the copying is complete, publish the new files by running the following command:

    php artisan vendor:publish --all
     

    WARNING

    Avoid using the --force flag, as it will reset all your views. Only use it if you understand the consequences.

  • Congratulations! Your project is now upgraded to the latest version of Krayin. However, keep in mind that if you have made significant customizations, ensure compatibility with the latest version.

  • # Composer Dependencies

    This documentation compares the dependencies between the old and latest versions of a Laravel-based project and provides guidance on the differences and upgrade paths.

    # Differences in Composer Dependencies

    Here’s a detailed comparison between the two projects:

    Dependency Old Project Version Latest Project Version Difference/Notes
    PHP ^8.1 ^8.1 No change
    barryvdh/laravel-dompdf ^master.0 ^master.0 No change
    diglactic/laravel-breadcrumbs ^8.0 ^8.0 No change
    doctrine/dbal ^3.0 ^3.0 No change
    guzzlehttp/guzzle ^7.0.1 ^7.0.1 No change
    khaled.alshamaa/ar-php Not Present ^6.3 Newly added in the latest project.
    konekt/concord ^1.10 ^1.10 No change
    krayin/rest-api dev-master Removed The krayin/rest-api package is not included in the latest project.
    laravel/framework ^10.0 ^10.0 No change
    laravel/sanctum ^3.2 ^3.2 No change
    laravel/tinker ^2.5 ^2.5 No change
    laravel/ui ^4.0 ^4.5 Upgraded from ^4.0 to ^4.5
    maatwebsite/excel ^3.1 ^3.1 No change
    mpdf/mpdf Not Present ^8.2 Newly added in the latest project.
    prettus/l5-repository ^2.7.9 ^2.7.9 No change

    # Differences in Development Dependencies

    Dependency Old Project Version Latest Project Version Difference/Notes
    barryvdh/laravel-debugbar ^3.6 ^3.6 No change
    fakerphp/faker ^1.9.1 ^1.9.1 No change
    krayin/krayin-package-generator dev-master dev-master No change
    laravel/pint Not Present ^1.16 Newly added in the latest project.
    laravel/sail ^1.0.1 ^1.0.1 No change
    mockery/mockery ^1.4.2 ^1.4.2 No change
    nunomaduro/collision ^7.0 ^7.0 No change
    pestphp/pest ^2.6 ^2.6 No change
    pestphp/pest-plugin-laravel ^2.1 ^2.1 No change
    phpunit/phpunit ^10.0 ^10.0 No change
    spatie/laravel-ignition ^master ^master No change

    # Differences in Autoloading

    • New Packages in Latest Project:
      • "Webkul\\Warehouse\\": "packages/Webkul/Warehouse/src",
      • "Webkul\\Automation\\": "packages/Webkul/Automation/src",
      • "Webkul\\DataGrid\\": "packages/Webkul/DataGrid/src"

    # Summary of Changes

    1. Removed Packages:

      • krayin/rest-api has been removed in the latest project.
    2. Added Packages:

      • khaled.alshamaa/ar-php was added in the latest project.
      • mpdf/mpdf was added in the latest project.
      • laravel/pint was added as a new development dependency.
    3. Updated Packages:

      • laravel/ui was upgraded from version ^4.0 to ^4.5.
    4. New Autoloaded Packages:

      • Added new autoload paths for Webkul\\Warehouse, Webkul\\Automation, and Webkul\\DataGrid.

    # Upgrade Instructions

    To upgrade your project to the latest dependencies, follow these steps:

    1. Update composer.json:

      • Replace the old package list with the updated one provided in the latest project.
    2. Run Composer Update:

      • Execute the following command to update your dependencies:
        composer update
         
    3. Verify Autoloading:

      • Ensure that the new autoload paths are properly configured by running:
        composer dump-autoload
        -
    4. Test Your Project:

      • After updating dependencies, thoroughly test your project to ensure that the changes do not introduce any issues.

    # Conclusion

    By following these instructions, your project will be updated to use the latest dependencies and autoload configurations. Ensure that you perform adequate testing after the update to confirm everything is functioning as expected.

  • Test Your Project:

    • After updating dependencies, thoroughly test your project to ensure that the changes do not introduce any issues.
  • # Conclusion

    By following these instructions, your project will be updated to use the latest dependencies and autoload configurations. Ensure that you perform adequate testing after the update to confirm everything is functioning as expected.

    - + diff --git a/service-worker.js b/service-worker.js index 4a77cb8..5260641 100644 --- a/service-worker.js +++ b/service-worker.js @@ -27,307 +27,307 @@ self.addEventListener('message', (event) => { self.__precacheManifest = [ { "url": "1.x/advanced/email-inbound-parse.html", - "revision": "8f886e6b26ee5d837cec7630b4b37e3f" + "revision": "74a4ed72372cda7b2ab3629deb869591" }, { "url": "1.x/advanced/events.html", - "revision": "e7fcfc04dbdc3be51c7fee48f18a8fc7" + "revision": "ee9137bcebcf074d810b1fef826cd9e5" }, { "url": "1.x/advanced/helpers.html", - "revision": "9c9ac6f2aaecd8d8cb94a25cd54f0c9f" + "revision": "349c84044ac4bce307355592648d6021" }, { "url": "1.x/advanced/index.html", - "revision": "cba2013dcf119d14d483a0aa2f400c74" + "revision": "7943d523ada7e846dd0ffa170f0461f8" }, { "url": "1.x/advanced/override-core-model.html", - "revision": "302be104b7b6c711e7e17d2745ec0eca" + "revision": "b24dfef2f0f50edc37b64ac04621b10c" }, { "url": "1.x/advanced/render-event.html", - "revision": "0cc71290c9a6d7dcaa7d538f3b450461" + "revision": "b0a6c7840cc236c5fbf8e1f021bf93e3" }, { "url": "1.x/advanced/security-practice.html", - "revision": "d626d0536d6945bb2663cf1fa9b26ac3" + "revision": "19d3dfb9edbb37d1d5b25733d5e69342" }, { "url": "1.x/api/getting-started-with-the-api.html", - "revision": "f2fa96cd9ee26659c540120d2c146a63" + "revision": "31c2eef4c255a20b9587fa2c63fdff7c" }, { "url": "1.x/api/index.html", - "revision": "bf3d5186c342b61c1e755a3fcf982486" + "revision": "45c9e95eabc10b0064a70412d3b80ea3" }, { "url": "1.x/architecture/index.html", - "revision": "9df5e47256f16e37041b2d5f8cc36594" + "revision": "d99d5f4a57a06f9bca2244633f956f48" }, { "url": "1.x/architecture/modular-design.html", - "revision": "257ba2418da98c8894707508c61fa03e" + "revision": "e05e7d37f5663c03a0587f3bd96ddbb0" }, { "url": "1.x/architecture/packages.html", - "revision": "c91c60bed477b53fc68a3102e7bd2478" + "revision": "e378c3382e795fbb942e358ee344e32d" }, { "url": "1.x/architecture/repository-pattern.html", - "revision": "6e5de6fd402cd0d3cdba8a8e10121f8c" + "revision": "1f3ee750d5ff634ff0bffbe592550b37" }, { "url": "1.x/architecture/theme.html", - "revision": "85faaa8812a7c5547a012011db914563" + "revision": "2497abd28af17b344dfe878af89111d1" }, { "url": "1.x/custom-attributes/custom-attribute.html", - "revision": "3bc359299559d1c0459dd00b55f3ac6c" + "revision": "a4b0166cf9ec8a8739cf383dd80f7d3e" }, { "url": "1.x/custom-attributes/index.html", - "revision": "42c8247f552c9d3dcb477d7ef4180e45" + "revision": "a8e18822867346761f316f87b789ff91" }, { "url": "1.x/custom-attributes/uses.html", - "revision": "ce4d27bc8081c679df92290800d5cb73" + "revision": "5f0270872eaf854e4a10e6cb6e604bb3" }, { "url": "1.x/introduction/index.html", - "revision": "c17b235c2487020a70f7ff51aa7c8c05" + "revision": "8e14e9537758aaf61a34e4d1b961e3cb" }, { "url": "1.x/introduction/installation.html", - "revision": "172854c0724ca0d5ffac5acf72fb1ea3" + "revision": "71f0fff7d0f3aae8125bb699aefd2efb" }, { "url": "1.x/introduction/requirements.html", - "revision": "9198ba33c1517034ed7f577668934f50" + "revision": "13c6a352368151b7f730f1bb9f9250f3" }, { "url": "1.x/packages/add-menu-in-admin.html", - "revision": "fa7c84f92f0ef70628f01d2df1ab0aa5" + "revision": "4979262977096c72b0b5dd2fdd091696" }, { "url": "1.x/packages/assets.html", - "revision": "9444fe83a48794ac8c2edc1acce66d6e" + "revision": "a3bc0c9103c9eef27a743de111639526" }, { "url": "1.x/packages/controllers.html", - "revision": "f697a7be2aa33b62ee5bb811941945c2" + "revision": "35d0a5a5907b668ab024afee84bbaed8" }, { "url": "1.x/packages/create-acl.html", - "revision": "190a7f12b162d6fdb8a23a6b30b496b8" + "revision": "069be0f669a8d1a2f09546fdc33ba187" }, { "url": "1.x/packages/create-migrations.html", - "revision": "c03f9eb742c86bbed80781e34f56a2bc" + "revision": "ebd0229124902b3c9985c603cdbcfa66" }, { "url": "1.x/packages/create-models.html", - "revision": "a05f1a8e92262b6c947cb0f6c86232bb" + "revision": "60ab51b71c7028ca873428eb5cc4a426" }, { "url": "1.x/packages/create-package.html", - "revision": "f259e46b56ecd71f78c98150a85dae7d" + "revision": "d9a2905c041ce897f5d086da4b9f6611" }, { "url": "1.x/packages/datagrid.html", - "revision": "dbc15ecf98c3e8615f20492dc46b8261" + "revision": "473a0288fc1841c23859d172c7a521b0" }, { "url": "1.x/packages/index.html", - "revision": "7bbdc248eac2fd7a929b6ac807ce56c5" + "revision": "2080e72bda15b604eb3188e9c5399c6e" }, { "url": "1.x/packages/layouts.html", - "revision": "d7b99fd9a07c5c9840369b5ae969a0ea" + "revision": "6a17bcb37acfac76e78fc0cac21cb022" }, { "url": "1.x/packages/localization.html", - "revision": "96ca848db0d6d44cdd17e71c235bebc0" + "revision": "90eb8b07c11843337d5e928d4269551c" }, { "url": "1.x/packages/routes.html", - "revision": "daa05557e12f73a45f0ebdf126f93391" + "revision": "0dc0bd158702c23577e268296255ff05" }, { "url": "1.x/packages/store-data-through-repositories.html", - "revision": "f22e391595bd70a78346b26143eee5b0" + "revision": "27425656ca892ee7ce3f0a4602aad59c" }, { "url": "1.x/packages/validation.html", - "revision": "bf20aab28405b13b373b0f053cc6c130" + "revision": "a208d7406876403664b21f5d51978393" }, { "url": "1.x/packages/views.html", - "revision": "fe632c10eed7e65f8a0103249d538fae" + "revision": "7cd498bf16aa04606d329a07780f3541" }, { "url": "2.0/advanced/email-inbound-parse.html", - "revision": "cd486fdd3117ab9aa1fc925cbdcf46cb" + "revision": "1d65f5942ea7cae299a8339fb5622103" }, { "url": "2.0/advanced/events.html", - "revision": "80e2a1802c5ffffafb2ce344bbb9488c" + "revision": "4c71e1ea52c3db03f2f72dce334e01c3" }, { "url": "2.0/advanced/helpers.html", - "revision": "11982d0860e3a02235c6f7937d186c17" + "revision": "d4da79567ab73956210a44e288e09392" }, { "url": "2.0/advanced/index.html", - "revision": "189155747ee48c81f388eb423bd3f25d" + "revision": "6f1e13558e4df988914f2c234bf61749" }, { "url": "2.0/advanced/override-core-model.html", - "revision": "17ba754ba64493d6dcaa8f113a7f92d6" + "revision": "fc4d43fe8f43eae1348ac9df3d913ace" }, { "url": "2.0/advanced/render-event.html", - "revision": "f6758dfb1320cb387cd1c2a882e826f4" + "revision": "d9962dd1c1ba17f3dbd554785e121f4e" }, { "url": "2.0/advanced/security-practice.html", - "revision": "c813ec83d948ab38312e14845040aa7d" + "revision": "627745fb674edd60fe1c8b0db65fc6d0" }, { "url": "2.0/api/getting-started-with-the-api.html", - "revision": "81d45b5f349dba41e896ac898bedbae1" + "revision": "6bdb9d1f59b489177b9113d8c34f83cc" }, { "url": "2.0/api/index.html", - "revision": "2c1ebdfa8aad8d745a251f163953f74f" + "revision": "488753e1d250dab8806ffcc1d62ce2fc" }, { "url": "2.0/architecture/index.html", - "revision": "4a24fc7f1172ec96cc1473677d41aa97" + "revision": "8462a1602ef01e11e21e7b8e2b9d6207" }, { "url": "2.0/architecture/modular-design.html", - "revision": "476eafe35029c7f8c08b2215a7afc283" + "revision": "b63f695e095b1629631e1c7e15dc0635" }, { "url": "2.0/architecture/packages.html", - "revision": "34afb65f4ad40fe4dd85bdaea62eaf6f" + "revision": "626d3fb05c57e85e6ededcbc31d3e3bf" }, { "url": "2.0/architecture/repository-pattern.html", - "revision": "b21b938c553b3720cc17d151ae29f8a2" + "revision": "3918c166bf12d28af4aa84e5da6eee41" }, { "url": "2.0/architecture/theme.html", - "revision": "93a0463ff82f82447ae459df5e376e79" + "revision": "18c3f46679e33c434a6608239f37e0bb" }, { "url": "2.0/custom-attributes/custom-attribute.html", - "revision": "f46cbdd576b6260043e043fa8b979443" + "revision": "5e6ed7a23058f46ecd59ae728a2d84e9" }, { "url": "2.0/custom-attributes/index.html", - "revision": "49e4c769e13e038ad382f17cbe4a6c08" + "revision": "643d12d7aa76624e058354a756097f58" }, { "url": "2.0/custom-attributes/uses.html", - "revision": "072cf8c1273fba2a7557cbdba5a1dd88" + "revision": "48ac9b5614de67fa6eb10e18384e5ccb" }, { "url": "2.0/introduction/docker.html", - "revision": "9d4ef205558ab240aaed787ef923b95e" + "revision": "e52527ec5bf41e7e80c11710dd66de7e" }, { "url": "2.0/introduction/index.html", - "revision": "bacf640ebe24512556d0d08b37ab947e" + "revision": "7747c463a678ff1cebd4764601e93248" }, { "url": "2.0/introduction/installation.html", - "revision": "0cac80432e46c94acfaa109f35529cf8" + "revision": "7f68cf9f0824101684d35ffe15e4b36c" }, { "url": "2.0/introduction/requirements.html", - "revision": "eccf7a52f33337651eb593cc4d209c54" + "revision": "141d1994a884b3f46dc6c9ba6858d3e6" }, { "url": "2.0/packages/add-menu-in-admin.html", - "revision": "7c7a72a7aff30705a1d5c46604df6e78" + "revision": "76fe26c55cc886e0728c65ae8da38411" }, { "url": "2.0/packages/assets.html", - "revision": "cba82020f9a8a2d45888964fd03eff83" + "revision": "5da63334715a13d72ddd74896abf303f" }, { "url": "2.0/packages/blade-components.html", - "revision": "59be2da370c53ae20ab5842af71bcac1" + "revision": "50bd6fc215252ae9fe21dd14792c43f9" }, { "url": "2.0/packages/controllers.html", - "revision": "9c9294f2342218d83bfbd95862d46ef2" + "revision": "ee73855ce63ddd4488bf00b54389e574" }, { "url": "2.0/packages/create-acl.html", - "revision": "a63164a602a6d1238bec317845266451" + "revision": "9615f37f1bc23628699240c0a1174034" }, { "url": "2.0/packages/create-migrations.html", - "revision": "6e61d3a43e0c85585af2796ad31e474e" + "revision": "dc7634d5549d8d9d9bf6843e881a7da0" }, { "url": "2.0/packages/create-models.html", - "revision": "37c49d14b8707b773f5860ee48e25252" + "revision": "80454d22d386ea824b6a78fe2ce95ed5" }, { "url": "2.0/packages/create-package.html", - "revision": "b6cef4e8d055c7ddac4608ac997f23ba" + "revision": "fbfc897ed2c25583799b00e9e7a3fa10" }, { "url": "2.0/packages/datagrid.html", - "revision": "5d6a1f7b6950b6a9e7fbded927b1e151" + "revision": "f1da0c362a5ebe27ee389433baaaa18d" }, { "url": "2.0/packages/index.html", - "revision": "5c948581bbc109af695f1cb7f3145f6d" + "revision": "3a8406d9ccc2ef8f881e6c6890b41e18" }, { "url": "2.0/packages/layouts.html", - "revision": "e7b73b22f138583d24ccd9e66776150a" + "revision": "16bf7f372f4bd26c8308f7ac2a3d2238" }, { "url": "2.0/packages/localization.html", - "revision": "5aaf6d3ef1173df36da42930905d5a97" + "revision": "1e6f6e3d984876be7101fd19d6a74c5e" }, { "url": "2.0/packages/routes.html", - "revision": "27317b9ab53b2302e9cf2abecb495a19" + "revision": "fb3e4183cf5e1ea429bcfdbfa42c27a7" }, { "url": "2.0/packages/store-data-through-repositories.html", - "revision": "7299b3007ef774ff7c14de8a3ac29acf" + "revision": "154e272ede8597a5bbb7d4b9e3bf388b" }, { "url": "2.0/packages/validation.html", - "revision": "ac1b03339ff02195b4be8b96f2115704" + "revision": "91a2f93462b8335cc512647963233990" }, { "url": "2.0/packages/views.html", - "revision": "c3768f2eac40707a9f78e18859aef242" + "revision": "ba766fe194399331e6fd3a06f95e4e68" }, { "url": "2.0/prologue/contribution-guide.html", - "revision": "68a7b5fa50916f73c952a939150e88a5" + "revision": "89f009f465f3c1b6b1f11dac63293d56" }, { "url": "2.0/prologue/index.html", - "revision": "3689b31727ded018b5ebe3a4c3a734cf" + "revision": "bcfc7f0f0562f2f8f41a3f672ebf66bb" }, { "url": "2.0/prologue/upgrade-guide.html", - "revision": "778a89c5cc29a522df0ff288b32a3711" + "revision": "e3677e7d62e1a0044176d16606214dfa" }, { "url": "404.html", - "revision": "f91eb4bf09000a5543733b6153b6762b" + "revision": "c1dbb54457bb7096b0d65406715dd575" }, { "url": "assets/css/0.styles.1ed5ee10.css", @@ -374,28 +374,28 @@ self.__precacheManifest = [ "revision": "7f86662807ecaefc47aa6637ec6fa8e9" }, { - "url": "assets/js/101.ccf514f9.js", - "revision": "741057b0bc75375ad43ee6e62ed1c263" + "url": "assets/js/101.77311efb.js", + "revision": "6279e5804ecf379cc32d18cc6eef5252" }, { - "url": "assets/js/102.2c20d1a1.js", - "revision": "461ea903afd15617ef10541ed86d36a4" + "url": "assets/js/102.e1553a76.js", + "revision": "756b1f99665caa33b04ae6daea36e801" }, { - "url": "assets/js/103.fa757a15.js", - "revision": "237d8278cf848cf67db0acf6caf36503" + "url": "assets/js/103.5fdc006a.js", + "revision": "cd5bca31d298903b1fd592f15c910d23" }, { - "url": "assets/js/104.60bbc19f.js", - "revision": "eea461e52f6e2f53b39623ccb7b813d4" + "url": "assets/js/104.443c33a8.js", + "revision": "a9506f1e92824e3525fd4d82ef20a558" }, { - "url": "assets/js/105.3c2413ea.js", - "revision": "8dc60755e301f794674290bd81365228" + "url": "assets/js/105.f3225838.js", + "revision": "019e5bed30a58638a7a1c8c20dea974b" }, { - "url": "assets/js/106.d7ca6d28.js", - "revision": "3f67abc2b4b5dbf9f0ca1448431d4bf0" + "url": "assets/js/106.a874ea9f.js", + "revision": "7206eab9802fe7d177396144152898cd" }, { "url": "assets/js/107.f2199c48.js", @@ -406,132 +406,132 @@ self.__precacheManifest = [ "revision": "b64822608b8ccbbb89c3a545860d0395" }, { - "url": "assets/js/109.4302de35.js", - "revision": "a12397bb7f01eaa6cb83434cf94e71c3" + "url": "assets/js/109.c1095c4b.js", + "revision": "b34e84821c6a0ec774c2cb026b1f6f88" }, { "url": "assets/js/11.920fa691.js", "revision": "b6f6fecb7cb62f567c9c2bf4afc8ff8e" }, { - "url": "assets/js/110.a0acb63a.js", - "revision": "f8b19e4403983e60565f21d03156c8c9" + "url": "assets/js/110.ff4f253d.js", + "revision": "a51a53b1218b185c58ddb17d12ac3172" }, { "url": "assets/js/111.c95fe5f2.js", "revision": "36ecb209b1a92d946f5d884e7c441269" }, { - "url": "assets/js/112.060eb159.js", - "revision": "f37c7612294d1a730b94b89c72dbf066" + "url": "assets/js/112.96c922c5.js", + "revision": "84e4d043e6aa911c504cfd14e5a3ed47" }, { - "url": "assets/js/113.1952d0bb.js", - "revision": "6aa94074f89f53a846633be08c78958e" + "url": "assets/js/113.06871f12.js", + "revision": "f88637c52ae5ec076dcfa7a0cab6f7f5" }, { - "url": "assets/js/114.906f86a5.js", - "revision": "b4b957853cd4a9518e41086c77f32c9e" + "url": "assets/js/114.9c404adf.js", + "revision": "0173374172c7933ece76817e0f2eddba" }, { - "url": "assets/js/115.603d5a7e.js", - "revision": "00d2304fcb3eecfecfed85d8ad164c05" + "url": "assets/js/115.4b20159c.js", + "revision": "f96f14b3ccbec227ccea3cf2daafc581" }, { - "url": "assets/js/116.0128b721.js", - "revision": "6c7ea766984afe120ca219251d1b2162" + "url": "assets/js/116.cae4d1e4.js", + "revision": "b00abc88e68258b6043cda26179ed305" }, { "url": "assets/js/117.9b61c54d.js", "revision": "c85cb3f4396fb4f6a1f4cc913496daa1" }, { - "url": "assets/js/118.fd058827.js", - "revision": "bcdb107c0ab3fc7a20947a83772c45cb" + "url": "assets/js/118.06a3a421.js", + "revision": "2786fde4bdbe28006f910577a7c3f7b0" }, { - "url": "assets/js/119.b7dd1a03.js", - "revision": "9f19a91a3db0f962e71fcfd383b391a2" + "url": "assets/js/119.28d77664.js", + "revision": "3fa0662a67cb22685ccb90a8073fde61" }, { "url": "assets/js/12.cfe5c744.js", "revision": "81158559aa0dbec306495dd38d3fbe83" }, { - "url": "assets/js/120.71f16f74.js", - "revision": "1f9bf9af6ed36a4f20329cc41a13f5cd" + "url": "assets/js/120.5c6d5bdd.js", + "revision": "f1355cf6c87548017945d94d9a47e2e2" }, { - "url": "assets/js/121.3f79ddd5.js", - "revision": "6777c1fc92272f4b10545ebbbe5ff277" + "url": "assets/js/121.90e73262.js", + "revision": "979ff7463b0e5d77e88206cf2b194805" }, { - "url": "assets/js/122.3bc5152f.js", - "revision": "6fdf54e20476aefabf8945004494e0f6" + "url": "assets/js/122.aa694a53.js", + "revision": "c3a1202c6760cbfc1e3c96458ccf6641" }, { "url": "assets/js/123.6d5ab6a2.js", "revision": "7b1a17bc437e763147646b6052951e16" }, { - "url": "assets/js/124.bedc3890.js", - "revision": "f9a5ff7c073b11b9e5d9d0df44e6e385" + "url": "assets/js/124.15cf7ffc.js", + "revision": "7063eff3498437d7f360d9dbeaa51e96" }, { - "url": "assets/js/125.7f3b45f6.js", - "revision": "e422a2252911d47e3d819079bb7f495f" + "url": "assets/js/125.467e2c39.js", + "revision": "b81ee955a6b1e2e279da931680ddb340" }, { - "url": "assets/js/126.aaf2e112.js", - "revision": "b77aa85d2a6e8db1a1d8868627e02177" + "url": "assets/js/126.59293cc7.js", + "revision": "6e1bbdbcd779e49b86e1cac214c30aa3" }, { "url": "assets/js/127.e6610815.js", "revision": "9a06f07ca9bad102567e6ee641af77c1" }, { - "url": "assets/js/128.fa93a2fc.js", - "revision": "ab93f26a4816fd6f073b3b89be58eec7" + "url": "assets/js/128.2273311e.js", + "revision": "06af6cd48acbfb4f74eac96e0507ad2f" }, { - "url": "assets/js/129.b9e06943.js", - "revision": "0d72158183e336d0504ed5e013d65a4e" + "url": "assets/js/129.a9d67c77.js", + "revision": "20133cf3b9f2624fbc1c9e4c3ac6ab85" }, { "url": "assets/js/13.c6897281.js", "revision": "0d8fe72c7bb650013a699ec1bc4adfb6" }, { - "url": "assets/js/130.7de71edb.js", - "revision": "817fd1e4f801473dd01dcb3ab75b41c4" + "url": "assets/js/130.ce891b0c.js", + "revision": "35ebf55a904f9f7e99f253b6c8426d3f" }, { - "url": "assets/js/131.79f85e75.js", - "revision": "952ca0830eb3f431e9e8296b6cb3745a" + "url": "assets/js/131.3f4fa5bd.js", + "revision": "44a16bc5b3cecdad4c8d109d57a1c329" }, { - "url": "assets/js/132.c68df1dc.js", - "revision": "12094b020bc0e04960ba50a415ddc355" + "url": "assets/js/132.da6ced46.js", + "revision": "bc160070b4c198c968197e3718dc9cae" }, { - "url": "assets/js/133.29a043da.js", - "revision": "638213b8d6e3581b94a686e64ba59db9" + "url": "assets/js/133.d09bb0e6.js", + "revision": "31596834b317fd1954d0e1f8539dec0d" }, { - "url": "assets/js/134.e2bdba24.js", - "revision": "fc4eed1bbe920f5d7d941ebaa7987f60" + "url": "assets/js/134.4af1c4e7.js", + "revision": "3aa6bb8eec6982e1afd71e299bafbb39" }, { - "url": "assets/js/135.c50bd19f.js", - "revision": "c1d6051c417132f7ceba1ee743cdc39c" + "url": "assets/js/135.86b91b5b.js", + "revision": "c64f885b4eed624af13d0914bc187ab2" }, { - "url": "assets/js/136.397269c4.js", - "revision": "43756baeeb3c9085cbb8821c26af4674" + "url": "assets/js/136.8bf40b8d.js", + "revision": "ad800a3bfeec75a71cd5b63191afb3b9" }, { - "url": "assets/js/137.91fb202f.js", - "revision": "c3b091504a204b1b3017b72bf5ceb25d" + "url": "assets/js/137.6b578a62.js", + "revision": "c3d224eb2e81e004cc34f36fa4a4c4a2" }, { "url": "assets/js/138.1e58f9fb.js", @@ -574,28 +574,28 @@ self.__precacheManifest = [ "revision": "a44fb054d27148f9294e7218c19b0076" }, { - "url": "assets/js/22.31867b2d.js", - "revision": "2ecae84933233d6b6e585e58123fee8a" + "url": "assets/js/22.ca1708f8.js", + "revision": "f37ce97970a133595215008b31d312b5" }, { "url": "assets/js/23.2c37a436.js", "revision": "996491f8dd9262adb8dfddf78b540471" }, { - "url": "assets/js/24.1f970c73.js", - "revision": "b35b3490e11f5c03ef74c42687c19042" + "url": "assets/js/24.b07e5381.js", + "revision": "f828996bc2645094f7834746a9c16856" }, { - "url": "assets/js/25.1eadac28.js", - "revision": "2254009e711c374ddf10718e80c250eb" + "url": "assets/js/25.c26ea879.js", + "revision": "832843904c3d294d630788923b896cdc" }, { - "url": "assets/js/26.5a2fc6eb.js", - "revision": "5d7a7e0c5cc21cda1980e0d6fd0a4ffa" + "url": "assets/js/26.2fb60aac.js", + "revision": "f87cc22f1885186f8b86e86fa04fc577" }, { - "url": "assets/js/27.17d4b244.js", - "revision": "340e7aff712c0633167549252865d941" + "url": "assets/js/27.96e132ef.js", + "revision": "038543a0c798739ec2b93bbb49afeebb" }, { "url": "assets/js/28.82630ea0.js", @@ -610,40 +610,40 @@ self.__precacheManifest = [ "revision": "173fe2f7d1a76268b054d5fd65970f5b" }, { - "url": "assets/js/30.c60eef57.js", - "revision": "b38ef1aa07f7432ee3fc64b67890dc04" + "url": "assets/js/30.a55bd7ed.js", + "revision": "51a39a38c880259d0d799d68f0b4375c" }, { "url": "assets/js/31.06176105.js", "revision": "db1842348f9646ab87217113946f8a6c" }, { - "url": "assets/js/32.1d6f5457.js", - "revision": "42cfcc71d55e6d483c6c1973eb4ce9ad" + "url": "assets/js/32.75d1191b.js", + "revision": "bff07da400dcaeac3355ae36f9ae74b3" }, { - "url": "assets/js/33.0c49f96e.js", - "revision": "bf27c32795159ab1a81c44dac732acd1" + "url": "assets/js/33.14770f0d.js", + "revision": "5b1db6332e348a9493a47178edec494c" }, { - "url": "assets/js/34.53cfff09.js", - "revision": "a809ab02704da367b64794111fb01e8d" + "url": "assets/js/34.020bbe1f.js", + "revision": "ac89bf2b7747bbeefbbdc17bddfd26de" }, { - "url": "assets/js/35.3a0a62f7.js", - "revision": "4496309104a2513ead4b5aff2d71b907" + "url": "assets/js/35.3c934e4c.js", + "revision": "2fdbc48e0307ea1e6fd01f7e590ce0bb" }, { - "url": "assets/js/36.9ed4a8da.js", - "revision": "d6e1b48136282c080b1795e6d7d3d446" + "url": "assets/js/36.eada2958.js", + "revision": "b4f6c361fda61d019c1a74b7f846ce08" }, { - "url": "assets/js/37.535f0081.js", - "revision": "03d96bc4813a37732a51490a18a8462a" + "url": "assets/js/37.7bcf94b4.js", + "revision": "5709590cdf3d59cda5c8cdd529f8b136" }, { - "url": "assets/js/38.090e1365.js", - "revision": "c326e644c7e5e39db638ab0b735bc826" + "url": "assets/js/38.096775e1.js", + "revision": "77087dfc4302ada62c970e92e3e2a108" }, { "url": "assets/js/39.380879af.js", @@ -654,16 +654,16 @@ self.__precacheManifest = [ "revision": "cfbc81bd40bccbcd3f7a21904988b247" }, { - "url": "assets/js/40.d825ba44.js", - "revision": "b7bd4608f8a60eea14fa318019a168eb" + "url": "assets/js/40.766df907.js", + "revision": "50d5ff7f2f5ec89963b8b0ef656af008" }, { - "url": "assets/js/41.5fc35e6c.js", - "revision": "3cb79faf15666808bc1f6fe06878b887" + "url": "assets/js/41.2ea7de2b.js", + "revision": "6e1bc187daaed6e07183b8a2a95cc341" }, { - "url": "assets/js/42.7fa39424.js", - "revision": "faaa808aa9c42007a62284339e16bb3b" + "url": "assets/js/42.fd442319.js", + "revision": "69208b8f06cbed259129125c6bc78b6c" }, { "url": "assets/js/43.0a1c60c8.js", @@ -686,80 +686,80 @@ self.__precacheManifest = [ "revision": "acb21de7672afc387c08a547db865796" }, { - "url": "assets/js/48.49f3055a.js", - "revision": "5718f35b61de633a56f5caea1edabad2" + "url": "assets/js/48.f053d15c.js", + "revision": "560ec9829cf30e1c9c8dc87d29484b00" }, { - "url": "assets/js/49.f1928147.js", - "revision": "07fc82283891cb355a56c3c1d05ee290" + "url": "assets/js/49.f5d98cf0.js", + "revision": "0d08632f92e4b6e36526844a3ead34de" }, { "url": "assets/js/5.68738fb1.js", "revision": "605af8409dca53abdc9a8a4891affdb0" }, { - "url": "assets/js/50.6c157082.js", - "revision": "e3bc9ce2556ce95b1ce46288520a20cd" + "url": "assets/js/50.a2610b5b.js", + "revision": "123004124ad77dbaf7ce7eefd626d299" }, { "url": "assets/js/51.35d64192.js", "revision": "0398188086a5598c376ecc2af94506df" }, { - "url": "assets/js/52.d94ee6e4.js", - "revision": "a678538344fcd985ca77612f574db93f" + "url": "assets/js/52.6d72598d.js", + "revision": "772b47137e8dc08f2f9274e3bdd9b1ab" }, { - "url": "assets/js/53.ee0b5001.js", - "revision": "5873fd895b64af655bb29b7ec3a158dc" + "url": "assets/js/53.7d71b23e.js", + "revision": "7c72a1b560bd73f02b8a5358d2664548" }, { "url": "assets/js/54.7d1d3406.js", "revision": "e2db5f006871e78ef51cdb75215e4d64" }, { - "url": "assets/js/55.aece2883.js", - "revision": "9e32297466d27c03be3356b526ed6a79" + "url": "assets/js/55.8f737083.js", + "revision": "c89ee7c55acedf179dd8c5f5d60f7708" }, { - "url": "assets/js/56.af355d1f.js", - "revision": "c82b273eb910cc7e7dc258715e61aae2" + "url": "assets/js/56.f124d80f.js", + "revision": "aecab69110fedc06d6b1878562fdc451" }, { - "url": "assets/js/57.d6e07b44.js", - "revision": "7fae9a690c24a9c361f58eb394e5e7dc" + "url": "assets/js/57.b6a66119.js", + "revision": "e66ad9df2de90bc5cfbf29f83b55b2b3" }, { - "url": "assets/js/58.8682472a.js", - "revision": "285129d0d34c6e8f78c7f5fa34e295e4" + "url": "assets/js/58.93cb57f4.js", + "revision": "15f7ef55e7691b2fbf6a80a3abcfe0a7" }, { - "url": "assets/js/59.75e6dc8a.js", - "revision": "1af20a6f8a030815061d8793c71930d8" + "url": "assets/js/59.263f9a81.js", + "revision": "149f9ef3d4d25130013ac48a615c35b2" }, { - "url": "assets/js/60.33991b7f.js", - "revision": "e0f3f599f0029ff23d2f5ee8b37d3629" + "url": "assets/js/60.77d06899.js", + "revision": "491c96b405904be9427e1c10c42dd0c9" }, { - "url": "assets/js/61.f5c51a34.js", - "revision": "871f5904bac6de2eb6ab99063dda545e" + "url": "assets/js/61.1f35a85e.js", + "revision": "fdb74b15e5c0758cc8cb71ee79d22933" }, { - "url": "assets/js/62.95404c2c.js", - "revision": "f73315e3044c93748ef098d6da00bca0" + "url": "assets/js/62.b74fca29.js", + "revision": "63e1b58cc1dfc473dd3dc4223b3b590d" }, { - "url": "assets/js/63.c0682281.js", - "revision": "7bd8492ad2695526e426b98d7758a677" + "url": "assets/js/63.54f8fae5.js", + "revision": "40ff6655acdc33a2f77b3847b7b6fa6e" }, { - "url": "assets/js/64.125f82aa.js", - "revision": "21d0ff19abeb1ddb8353c6400f6ae0a7" + "url": "assets/js/64.718ed29b.js", + "revision": "0a8a30fe2adc539a7cad5db3c24ef893" }, { - "url": "assets/js/65.87bd1508.js", - "revision": "cfd93dcb18f1593d338e07309a6815a3" + "url": "assets/js/65.b66a97a3.js", + "revision": "fbf598e6f6a9b4d1f34614df3fd1863d" }, { "url": "assets/js/66.b4b118a3.js", @@ -770,104 +770,104 @@ self.__precacheManifest = [ "revision": "fed0cb25f637a0239b13054a4c2f0bff" }, { - "url": "assets/js/68.9fe6752f.js", - "revision": "22a5fbafdb2133d56345890357595c83" + "url": "assets/js/68.f2e0e0a4.js", + "revision": "8b6a35ec40472475185a70bf60e7ce5b" }, { - "url": "assets/js/69.ec41dd9b.js", - "revision": "76c89b16df4fffe99550235201c80160" + "url": "assets/js/69.b403f4b3.js", + "revision": "475a19f39571c3b926a2473a9be45b0a" }, { "url": "assets/js/70.0564fde4.js", "revision": "da35a4fa1c3f09f2690b59864cdd65a2" }, { - "url": "assets/js/71.46ad926a.js", - "revision": "96ba59dbc4b6702939e9e7ca41779fa6" + "url": "assets/js/71.4791ea33.js", + "revision": "3aebba8737f9664f4ae1c5c54519c125" }, { - "url": "assets/js/72.cc46b533.js", - "revision": "9c2665b68ec035082050f3a3ee99b580" + "url": "assets/js/72.5203476d.js", + "revision": "6e7e494871701febacc848fa27deb4a5" }, { - "url": "assets/js/73.f8bfbb5f.js", - "revision": "3d6944dbc7d7607639098b114bbf3b30" + "url": "assets/js/73.b5e98758.js", + "revision": "e9325cf610dab4729f46797f0232db60" }, { "url": "assets/js/74.b8130776.js", "revision": "9186ac9239a0a0fc4384cc3b258250a0" }, { - "url": "assets/js/75.6cea3a14.js", - "revision": "0393d25e574e82c133b13a8607879bc8" + "url": "assets/js/75.c829b61b.js", + "revision": "8b85c7a6c3e84fb576d8f2014665fdf7" }, { - "url": "assets/js/76.4f1c67f7.js", - "revision": "f652a523c93b553d6d63555ec66305e6" + "url": "assets/js/76.9092b0de.js", + "revision": "a20c616dee617e18f0e6ef14e94d6974" }, { - "url": "assets/js/77.fd54eac8.js", - "revision": "1711ddbea28cf384b93c2c8a0f298d6e" + "url": "assets/js/77.0970e185.js", + "revision": "059743822a5a83cd557008948ea6ba45" }, { - "url": "assets/js/78.77d81075.js", - "revision": "04001f533df673870d8ed93cb198525e" + "url": "assets/js/78.0be53998.js", + "revision": "226ef46e779c7433da560f2764a79b43" }, { - "url": "assets/js/79.535aa00d.js", - "revision": "70197603a6af823a90a4540a42404b7e" + "url": "assets/js/79.bba635c4.js", + "revision": "95bea3be8abd5d2c917b1863d9e87e2c" }, { "url": "assets/js/8.6d36ae63.js", "revision": "614d9ec1b9cc47e313809368802568b9" }, { - "url": "assets/js/80.9636be31.js", - "revision": "46503d9dd70691f9f4b2c34f72434088" + "url": "assets/js/80.0a433807.js", + "revision": "13286273f1a98840927465d205739b41" }, { "url": "assets/js/81.f700092d.js", "revision": "3946ab34a42dea38f095e69bc0786449" }, { - "url": "assets/js/82.830c1ccd.js", - "revision": "38fe9e188e6929d50467d10700cad83f" + "url": "assets/js/82.d05c3f26.js", + "revision": "4c0c379a5910ee6129eaf574d1d578b5" }, { "url": "assets/js/83.12a18938.js", "revision": "0d59730d4013a83fc0f54272e8478f63" }, { - "url": "assets/js/84.4f0b2bb7.js", - "revision": "d494d58fe02b995746f24f39942eaaa7" + "url": "assets/js/84.54b6f5a1.js", + "revision": "1441c2cedb650377171fe127f8183f5e" }, { - "url": "assets/js/85.a920e252.js", - "revision": "0a5bdff754f5775ccd7758bda0c4f5ea" + "url": "assets/js/85.2a3d5a8a.js", + "revision": "6fd2603c461a27b607697dc2a06dfa79" }, { - "url": "assets/js/86.bb5486b6.js", - "revision": "044060bee2f78bddfd86caf43346a089" + "url": "assets/js/86.f56488fd.js", + "revision": "e81fd9c78db05746600078375e9be269" }, { - "url": "assets/js/87.6edfe556.js", - "revision": "f30f3118eeca6a424c4a5f9d72990f08" + "url": "assets/js/87.91be584e.js", + "revision": "762e8e0b35e13666be9ef0a795f44d1c" }, { - "url": "assets/js/88.4bab3fd2.js", - "revision": "4768fcc6b57409edbeeb6da06e3443d6" + "url": "assets/js/88.317319ac.js", + "revision": "0ab5e0208a43112dc60dbdbc4855e99d" }, { - "url": "assets/js/89.f3215088.js", - "revision": "238180a6df04c99146e60b667e8190e1" + "url": "assets/js/89.8f0dc9b2.js", + "revision": "a648c3ef5bee0b907873aae9d9199437" }, { "url": "assets/js/9.b16f1b7c.js", "revision": "07c4d0e89b85d769e0624c73e295bff6" }, { - "url": "assets/js/90.da3b29cf.js", - "revision": "435b04ae68a7cdccfe2ce2b03c18805b" + "url": "assets/js/90.5199bce8.js", + "revision": "cae88e57e46889893f9dfee4fc6ba66c" }, { "url": "assets/js/91.48772564.js", @@ -878,12 +878,12 @@ self.__precacheManifest = [ "revision": "4af6e8ebea257a3721e97c153cbbf6a9" }, { - "url": "assets/js/93.e70b4764.js", - "revision": "4b6aa3551d7910ce3c6da80c9b553fcb" + "url": "assets/js/93.f9bd3968.js", + "revision": "e9ba26b887ae2ae633d5b2d673a7e9c2" }, { - "url": "assets/js/94.711741af.js", - "revision": "de265da22f0eff7ecbc9e840cb8165a8" + "url": "assets/js/94.3ca207f4.js", + "revision": "a7d20ef4d62c287536eb4965917696b7" }, { "url": "assets/js/95.5c7f7a38.js", @@ -906,8 +906,8 @@ self.__precacheManifest = [ "revision": "7010fa939abe4c98ffe9b01a1a8f6be7" }, { - "url": "assets/js/app.630c4e21.js", - "revision": "f1b8200bad278e7398f1cd9c12404d94" + "url": "assets/js/app.3c95b0aa.js", + "revision": "af2afa4b16ecef47b4eabafa784f2d4b" }, { "url": "assets/js/vendors~docsearch.853f9491.js", @@ -915,7 +915,7 @@ self.__precacheManifest = [ }, { "url": "index.html", - "revision": "f5450780c78ecc20b896d3e3615b757f" + "revision": "55922014be6b31158d32b7cebda63941" }, { "url": "logo.svg", @@ -923,167 +923,167 @@ self.__precacheManifest = [ }, { "url": "master/advanced/data-transfer.html", - "revision": "a97b1d1cc6c83d6b7810c29022745acd" + "revision": "6d09c25f27a8e2c5d6169ef92974b58e" }, { "url": "master/advanced/email-inbound-parse.html", - "revision": "f0b41202aa4484e643e95ef24f2612cb" + "revision": "6be6bf8f1373d4d8058dc9ebca565fa7" }, { "url": "master/advanced/events.html", - "revision": "4aee8054c78298b6bbc82279713b0976" + "revision": "4b097214c6c3813f8d0518c5fc886e3e" }, { "url": "master/advanced/helpers.html", - "revision": "ec2378374dafb8de6dfd25a8c1eb394f" + "revision": "d37ef2f086c5b37d166d408d89dd1bfd" }, { "url": "master/advanced/index.html", - "revision": "b23cfbf494dacdeb9afd6b859c12ad7b" + "revision": "52d2a75b53346373260a3a7f738e472e" }, { "url": "master/advanced/override-core-model.html", - "revision": "5c782647fd1e8fed79a6128bb7c11d6d" + "revision": "e2021725b539ad47bc6dc5982dc4446e" }, { "url": "master/advanced/render-event.html", - "revision": "ddc8df43d6fa371b9477bb4d7eec7fad" + "revision": "c15361d459dcd7919f66a3fc2fb05648" }, { "url": "master/advanced/security-practice.html", - "revision": "c4270005bc57aafea5a71d538cee793e" + "revision": "96e129c52482cb7486b5e4d5a07f6ed2" }, { "url": "master/api/getting-started-with-the-api.html", - "revision": "5a7ebcbf74f457c01b4d2f375aed539d" + "revision": "ee242bac87c4047077fec43479e4d660" }, { "url": "master/api/index.html", - "revision": "9584b8414a115c4dd4f63607c80e5229" + "revision": "3f027f236b8386f06cf3e52262ee8a10" }, { "url": "master/architecture/index.html", - "revision": "f45ded29cbf72ca3ffaa7078b4879fda" + "revision": "2b0a64f3541fe732bab5b448c5d3dd9d" }, { "url": "master/architecture/modular-design.html", - "revision": "d0d504d786b0c9c5b09673374bff0f30" + "revision": "0aaf7f1c4acf33eb19ec34231a5a23e6" }, { "url": "master/architecture/packages.html", - "revision": "ca00ec327b5848df3139d7fe4db2a3de" + "revision": "109498e41729e385d2fcdfdde6712d6c" }, { "url": "master/architecture/repository-pattern.html", - "revision": "ac359a40d914dd7554aa720a925ca91a" + "revision": "29da77329a97642b6a058cc4dd93f15b" }, { "url": "master/architecture/theme.html", - "revision": "3a0e98f47df279509985e677059bbea7" + "revision": "16e5c9d0b26edf3424b899e010c23750" }, { "url": "master/custom-attributes/custom-attribute.html", - "revision": "2c6ea89be442d5a9b1c27462923b1d92" + "revision": "d4da8f4b46896b36c6c30c987119f634" }, { "url": "master/custom-attributes/index.html", - "revision": "9d43c94ff1ac2bae9887099d3f01a623" + "revision": "b9962bcd29a37673659988f98060eb85" }, { "url": "master/custom-attributes/uses.html", - "revision": "f24f2bafd2252eb931699cc5c40144d2" + "revision": "5fc294ab6ad9a61352280ed4ee24decf" }, { "url": "master/introduction/docker.html", - "revision": "c5ebd02380528829e30a7602d21e6363" + "revision": "215913320f9645c134eac43d9de16be8" }, { "url": "master/introduction/index.html", - "revision": "b960fab9e3af5ee7689461aa08ca0afc" + "revision": "2599143ef37a686b4d167ea454b90ea2" }, { "url": "master/introduction/installation.html", - "revision": "c7234e60364a5410bfa7e3eab79e47b9" + "revision": "320bfd88e4b3ce5446978e9d6c9b6c68" }, { "url": "master/introduction/requirements.html", - "revision": "3dd490fc86751e72501dc90912845f50" + "revision": "061db9759885f4eab0a88ba11caee3cf" }, { "url": "master/packages/add-menu-in-admin.html", - "revision": "4c8187a9f3e97e38acbf6545091beb86" + "revision": "9558a4271dcbfdff18376f541c025b0b" }, { "url": "master/packages/assets.html", - "revision": "a86b1bcaca3939939706917ddf30002c" + "revision": "1afb8ba913fac576a16c4e724dc34c27" }, { "url": "master/packages/blade-components.html", - "revision": "aaeee704ba684a0781e852ea4b9c3048" + "revision": "f38045775838a8c3b415b0731978a3a9" }, { "url": "master/packages/controllers.html", - "revision": "0f08fec4bfb31480ac1e887604cd76d3" + "revision": "f53bb6be6b2ff3bb567a701e39b8c7a9" }, { "url": "master/packages/create-acl.html", - "revision": "ee72389b67951bb37b3a96e1e5c4ae5d" + "revision": "04f4c0385235bbf710aad22c82d6be40" }, { "url": "master/packages/create-migrations.html", - "revision": "395c2f35abf6bcd054cd3db024804978" + "revision": "b998f18f89e0a74b45f9e9f7239658fd" }, { "url": "master/packages/create-models.html", - "revision": "67700be26d9e27f2e059fdf4de30a756" + "revision": "e95c346b6e0743b61b1c79a439ee1e22" }, { "url": "master/packages/create-package.html", - "revision": "3048caf0c3ecd8186a51f8dd200b6de8" + "revision": "93af65f276e434d2bbb58fc4122b4cf7" }, { "url": "master/packages/datagrid.html", - "revision": "d3c10a36dc5f93937d80bf8e8f5e27d7" + "revision": "63bb662baa39876f3de18c8d34e9c110" }, { "url": "master/packages/index.html", - "revision": "5c916da42712a5375f27ebdbe6986803" + "revision": "b33adb067072e8f70ac16c44fc358fa6" }, { "url": "master/packages/layouts.html", - "revision": "39dbf69ea96ba7cb7e43476594154fca" + "revision": "87273f03e42163f4820290bfdf7718af" }, { "url": "master/packages/localization.html", - "revision": "756ffcf0eb3af99472a669d230216e52" + "revision": "d2bb3043aa5da66694f32a3abe0f3b8a" }, { "url": "master/packages/routes.html", - "revision": "3b19222befb19712f2ce61dd71e937b8" + "revision": "8580098ac64f9a8fa51e2d9475d8bcaf" }, { "url": "master/packages/store-data-through-repositories.html", - "revision": "35a2daaea55f8bc3dd58f74428ae3cfb" + "revision": "6afcd96f4668f75f9293034dbd7dba78" }, { "url": "master/packages/validation.html", - "revision": "9963a72f7402477f2e4a17a1a59eb97e" + "revision": "bf79db5d678a22d03302d522c48bf77d" }, { "url": "master/packages/views.html", - "revision": "3c55126d27490233fbfe31a3c002f719" + "revision": "a94244ac63d6910c4f820a241c091726" }, { "url": "master/prologue/contribution-guide.html", - "revision": "e33e1b36b4fd6aac732f730b64d6ba59" + "revision": "46dc36b7abd2ee041f56e9624c4351ce" }, { "url": "master/prologue/index.html", - "revision": "6c8810727847ba6eda70cd54fa27e3a8" + "revision": "1400d19f712a521412b70ab2e83c942f" }, { "url": "master/prologue/upgrade-guide.html", - "revision": "5a3e16acec9aa6adc567442d79e8fb23" + "revision": "29d2d017cca5b2892833c26987ceca77" } ].concat(self.__precacheManifest || []); workbox.precaching.precacheAndRoute(self.__precacheManifest, {});