From 7b3309c9d4446e5f1593a99e0ee33fcbd3c5df7f Mon Sep 17 00:00:00 2001 From: devansh-webkul Date: Fri, 9 Aug 2024 06:14:48 +0000 Subject: [PATCH] deploy: ecf5433e4dc086de93b9dee7583cee3a3513060d --- 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/docker.html | 6 +- 1.x/introduction/index.html | 6 +- 1.x/introduction/installation.html | 6 +- 1.x/introduction/requirements.html | 6 +- .../upgrade-to-latest-bagisto.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 +- 404.html | 6 +- assets/js/{14.e72960fa.js => 14.9fe61dd3.js} | 2 +- assets/js/{21.5b6eadf2.js => 21.22b0536d.js} | 2 +- assets/js/{25.b13100a3.js => 25.3abc1e83.js} | 2 +- assets/js/{26.fdef7c6a.js => 26.fa7a70ef.js} | 2 +- assets/js/{27.53f5eed3.js => 27.5887633f.js} | 2 +- assets/js/{28.f9d5b92f.js => 28.bdd80b37.js} | 2 +- assets/js/{29.192a8672.js => 29.4b08399e.js} | 2 +- assets/js/{33.b3c0de1f.js => 33.9816133b.js} | 2 +- assets/js/{34.6cb9f5e1.js => 34.e36dc895.js} | 2 +- assets/js/{35.c544496e.js => 35.54f27612.js} | 2 +- assets/js/{36.650631ed.js => 36.7999bc44.js} | 2 +- assets/js/{38.3bbdeecf.js => 38.804ded6f.js} | 2 +- assets/js/{39.6f2f06d0.js => 39.f2e156ac.js} | 2 +- assets/js/{40.3c777840.js => 40.bad1cd62.js} | 2 +- assets/js/{41.7c677cd8.js => 41.528a517a.js} | 2 +- assets/js/{42.9745a024.js => 42.1fbc1407.js} | 2 +- assets/js/{43.fd1dad19.js => 43.bb5be4b5.js} | 2 +- assets/js/{44.aecf5f79.js => 44.84e2eb55.js} | 2 +- assets/js/{46.709a3041.js => 46.8385a633.js} | 2 +- assets/js/{47.1ec640e9.js => 47.6a8acc46.js} | 2 +- assets/js/{48.fabb7629.js => 48.60a37f0b.js} | 2 +- assets/js/{49.4787fee0.js => 49.0ce5ac3f.js} | 2 +- assets/js/{51.551531a2.js => 51.529357c2.js} | 2 +- assets/js/{52.c4db90f6.js => 52.da80d54a.js} | 2 +- assets/js/{55.fb5ba6ab.js => 55.2a96f054.js} | 2 +- assets/js/{56.f5780b89.js => 56.6a018368.js} | 2 +- .../js/{app.255df903.js => app.6fd5b9b0.js} | 6 +- index.html | 4 +- service-worker.js | 184 +++++++++--------- 66 files changed, 234 insertions(+), 234 deletions(-) rename assets/js/{14.e72960fa.js => 14.9fe61dd3.js} (96%) rename assets/js/{21.5b6eadf2.js => 21.22b0536d.js} (99%) rename assets/js/{25.b13100a3.js => 25.3abc1e83.js} (99%) rename assets/js/{26.fdef7c6a.js => 26.fa7a70ef.js} (99%) rename assets/js/{27.53f5eed3.js => 27.5887633f.js} (94%) rename assets/js/{28.f9d5b92f.js => 28.bdd80b37.js} (98%) rename assets/js/{29.192a8672.js => 29.4b08399e.js} (96%) rename assets/js/{33.b3c0de1f.js => 33.9816133b.js} (87%) rename assets/js/{34.6cb9f5e1.js => 34.e36dc895.js} (90%) rename assets/js/{35.c544496e.js => 35.54f27612.js} (99%) rename assets/js/{36.650631ed.js => 36.7999bc44.js} (99%) rename assets/js/{38.3bbdeecf.js => 38.804ded6f.js} (98%) rename assets/js/{39.6f2f06d0.js => 39.f2e156ac.js} (98%) rename assets/js/{40.3c777840.js => 40.bad1cd62.js} (98%) rename assets/js/{41.7c677cd8.js => 41.528a517a.js} (98%) rename assets/js/{42.9745a024.js => 42.1fbc1407.js} (99%) rename assets/js/{43.fd1dad19.js => 43.bb5be4b5.js} (99%) rename assets/js/{44.aecf5f79.js => 44.84e2eb55.js} (99%) rename assets/js/{46.709a3041.js => 46.8385a633.js} (99%) rename assets/js/{47.1ec640e9.js => 47.6a8acc46.js} (99%) rename assets/js/{48.fabb7629.js => 48.60a37f0b.js} (99%) rename assets/js/{49.4787fee0.js => 49.0ce5ac3f.js} (99%) rename assets/js/{51.551531a2.js => 51.529357c2.js} (99%) rename assets/js/{52.c4db90f6.js => 52.da80d54a.js} (99%) rename assets/js/{55.fb5ba6ab.js => 55.2a96f054.js} (99%) rename assets/js/{56.f5780b89.js => 56.6a018368.js} (77%) rename assets/js/{app.255df903.js => app.6fd5b9b0.js} (76%) diff --git a/1.x/advanced/events.html b/1.x/advanced/events.html index fdb6495..2404c51 100644 --- a/1.x/advanced/events.html +++ b/1.x/advanced/events.html @@ -9,7 +9,7 @@ - + @@ -113,7 +113,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 15507c4..44ba820 100644 --- a/1.x/advanced/helpers.html +++ b/1.x/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/1.x/advanced/index.html b/1.x/advanced/index.html index 46df3db..004d3b0 100644 --- a/1.x/advanced/index.html +++ b/1.x/advanced/index.html @@ -9,7 +9,7 @@ - + @@ -29,7 +29,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 e-commerce 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 e-commerce 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 fa7cd03..3b157d2 100644 --- a/1.x/advanced/override-core-model.html +++ b/1.x/advanced/override-core-model.html @@ -9,7 +9,7 @@ - + @@ -61,7 +61,7 @@ { // } -

Once registered, you can use dependency injection or other Laravel mechanisms to reference the interface(\Webkul\Product\Contracts\Product::class) throughout your application. Laravel's service container will automatically resolve your custom model implementation (\App\Http\Product::class) 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::class) throughout your application. Laravel's service container will automatically resolve your custom model implementation (\App\Http\Product::class) 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 1277eec..1798fc1 100644 --- a/1.x/advanced/render-event.html +++ b/1.x/advanced/render-event.html @@ -9,7 +9,7 @@ - + @@ -54,7 +54,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 3c0ac60..7c8c63b 100644 --- a/1.x/advanced/security-practice.html +++ b/1.x/advanced/security-practice.html @@ -9,7 +9,7 @@ - + @@ -47,7 +47,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 5ccaf57..12bdd05 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 @@ - + @@ -44,11 +44,11 @@ use HasApiTokens; ... } -
- + diff --git a/1.x/api/index.html b/1.x/api/index.html index c852dde..d241d31 100644 --- a/1.x/api/index.html +++ b/1.x/api/index.html @@ -9,7 +9,7 @@ - + @@ -29,7 +29,7 @@ Contribute to Krayin CRM (opens new window) Contact Us - (opens new window)

# Krayin APIs

# REST API

The Krayin REST API supports REST (Representational State Transfer) and provides access to CRUD (Create, Read, Update, Delete) operations. It also supports pagination to increase the performance of the application. The Krayin REST API can be used to build a PWA (Progressive Web Application) application, integrate an online shopping mobile application with the Krayin store.

- + (opens new window)

# Krayin APIs

# REST API

The Krayin REST API supports REST (Representational State Transfer) and provides access to CRUD (Create, Read, Update, Delete) operations. It also supports pagination to increase the performance of the application. The Krayin REST API can be used to build a PWA (Progressive Web Application) application, integrate an online shopping mobile application with the Krayin store.

+ diff --git a/1.x/architecture/index.html b/1.x/architecture/index.html index 80db220..470b413 100644 --- a/1.x/architecture/index.html +++ b/1.x/architecture/index.html @@ -9,7 +9,7 @@ - + @@ -29,7 +29,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 23503d1..65093e5 100644 --- a/1.x/architecture/modular-design.html +++ b/1.x/architecture/modular-design.html @@ -9,7 +9,7 @@ - + @@ -29,7 +29,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 636ebc8..8ed0e68 100644 --- a/1.x/architecture/packages.html +++ b/1.x/architecture/packages.html @@ -9,7 +9,7 @@ - + @@ -39,7 +39,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 be19912..1ee3c33 100644 --- a/1.x/architecture/repository-pattern.html +++ b/1.x/architecture/repository-pattern.html @@ -9,7 +9,7 @@ - + @@ -29,7 +29,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 66cdb16..b62fd87 100644 --- a/1.x/architecture/theme.html +++ b/1.x/architecture/theme.html @@ -9,7 +9,7 @@ - + @@ -29,7 +29,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 0d52551..7bf7b44 100644 --- a/1.x/custom-attributes/custom-attribute.html +++ b/1.x/custom-attributes/custom-attribute.html @@ -9,7 +9,7 @@ - + @@ -103,7 +103,7 @@ return $product; } -
    - + diff --git a/1.x/custom-attributes/index.html b/1.x/custom-attributes/index.html index 4fa2000..e37fe98 100644 --- a/1.x/custom-attributes/index.html +++ b/1.x/custom-attributes/index.html @@ -9,7 +9,7 @@ - + @@ -29,7 +29,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 79f5447..0ee2ca4 100644 --- a/1.x/custom-attributes/uses.html +++ b/1.x/custom-attributes/uses.html @@ -9,7 +9,7 @@ - + @@ -33,7 +33,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/docker.html b/1.x/introduction/docker.html index 9148f13..c06085f 100644 --- a/1.x/introduction/docker.html +++ b/1.x/introduction/docker.html @@ -9,7 +9,7 @@ - + @@ -121,7 +121,7 @@ We need to create a symlink of Krayin/public in app directory to /var/www/html/public_html.

    Run the following command on Linux or MacOS

    cd app; ln -snf Krayin/public public_html
     

    Run the following command on Windows

    cd app
     mklink Krayin/public public_html
    -

    # Ready

    # Login as a administrator:

    You can directly visit the admin interface http://your_server_endpoint/admin (opens new window) and authenticate with the following credentials.

    Email Password
    admin@example.com admin123

    # Login as a customer

    You can directly visit your store on http://your_server_endpoint/ (opens new window).

    - +

    # Ready

    # Login as a administrator:

    You can directly visit the admin interface http://your_server_endpoint/admin (opens new window) and authenticate with the following credentials.

    Email Password
    admin@example.com admin123

    # Login as a customer

    You can directly visit your store on http://your_server_endpoint/ (opens new window).

    + diff --git a/1.x/introduction/index.html b/1.x/introduction/index.html index 97fd015..ff3889f 100644 --- a/1.x/introduction/index.html +++ b/1.x/introduction/index.html @@ -9,7 +9,7 @@ - + @@ -29,7 +29,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, check out our website https://devdocs.krayincrm.com/ (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.

    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, check out our website https://devdocs.krayincrm.com/ (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.

    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 7b5f076..af216d1 100644 --- a/1.x/introduction/installation.html +++ b/1.x/introduction/installation.html @@ -9,7 +9,7 @@ - + @@ -47,7 +47,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.sir mujhe

    # 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 92406bc..952e252 100644 --- a/1.x/introduction/requirements.html +++ b/1.x/introduction/requirements.html @@ -9,7 +9,7 @@ - + @@ -32,11 +32,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/introduction/upgrade-to-latest-bagisto.html b/1.x/introduction/upgrade-to-latest-bagisto.html index 6f93ea5..1019ffa 100644 --- a/1.x/introduction/upgrade-to-latest-bagisto.html +++ b/1.x/introduction/upgrade-to-latest-bagisto.html @@ -9,7 +9,7 @@ - + @@ -38,7 +38,7 @@
  • Now, your new changes have been cached and now your project is ready to run the migrate command,

    php artisan migrate
     

    WARNING

    Here we have not provided you the seeder command because the seeder command always resets all the settings, categories and etc. If some tables need default settings then we advise you to add manually.

  • Now, its time to create a symlink so that public assets can be linked to storage,

    php artisan storage:link
     
  • Copy all the content of the previous version's directory (e.g. old-project/storage/app/public) to the latest version's directory (e.g. new-project/storage/app/public).

    TIP

    If your existing project also depends on some local storage, or you have changed some paths, or you want previous logs also then make sure you add all those also.

  • Once this is finished run the following command to publish your new files,

    php artisan vendor:publish --all
    -

    WARNING

    Don't use the --force flag, this will reset all your views. Use only when you know what you are doing.

  • You are now at the latest version. Still, we want to mention that if you have done a lot of customizations then that portion of compatibility should be handled at your end.

    - +

    WARNING

    Don't use the --force flag, this will reset all your views. Use only when you know what you are doing.

    You are now at the latest version. Still, we want to mention that if you have done a lot of customizations then that portion of compatibility should be handled at your end.

    + diff --git a/1.x/packages/add-menu-in-admin.html b/1.x/packages/add-menu-in-admin.html index 0916916..5599771 100644 --- a/1.x/packages/add-menu-in-admin.html +++ b/1.x/packages/add-menu-in-admin.html @@ -9,7 +9,7 @@ - + @@ -88,7 +88,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 b03a220..a3bb211 100644 --- a/1.x/packages/assets.html +++ b/1.x/packages/assets.html @@ -9,7 +9,7 @@ - + @@ -157,7 +157,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 80af0c3..54bff6c 100644 --- a/1.x/packages/controllers.html +++ b/1.x/packages/controllers.html @@ -9,7 +9,7 @@ - + @@ -94,7 +94,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 8cb1e09..c04aa34 100644 --- a/1.x/packages/create-acl.html +++ b/1.x/packages/create-acl.html @@ -9,7 +9,7 @@ - + @@ -71,7 +71,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 14e140c..545d9aa 100644 --- a/1.x/packages/create-migrations.html +++ b/1.x/packages/create-migrations.html @@ -9,7 +9,7 @@ - + @@ -93,7 +93,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 e6eedb0..4eee001 100644 --- a/1.x/packages/create-models.html +++ b/1.x/packages/create-models.html @@ -9,7 +9,7 @@ - + @@ -134,7 +134,7 @@ \Webkul\Category\Providers\ModuleServiceProvider::class, ] ]; -
    - + diff --git a/1.x/packages/create-package.html b/1.x/packages/create-package.html index bcdf735..23b1bb8 100644 --- a/1.x/packages/create-package.html +++ b/1.x/packages/create-package.html @@ -9,7 +9,7 @@ - + @@ -119,7 +119,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 5897f7f..f88b816 100644 --- a/1.x/packages/datagrid.html +++ b/1.x/packages/datagrid.html @@ -9,7 +9,7 @@ - + @@ -211,7 +211,7 @@ ]); } } -
    - + diff --git a/1.x/packages/index.html b/1.x/packages/index.html index 1b675ef..a5db051 100644 --- a/1.x/packages/index.html +++ b/1.x/packages/index.html @@ -9,7 +9,7 @@ - + @@ -89,7 +89,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 be59de6..4797abd 100644 --- a/1.x/packages/layouts.html +++ b/1.x/packages/layouts.html @@ -9,7 +9,7 @@ - + @@ -52,7 +52,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 0f58348..6b073ca 100644 --- a/1.x/packages/localization.html +++ b/1.x/packages/localization.html @@ -9,7 +9,7 @@ - + @@ -95,7 +95,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 5247d51..73ecf2e 100644 --- a/1.x/packages/routes.html +++ b/1.x/packages/routes.html @@ -9,7 +9,7 @@ - + @@ -87,7 +87,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 1f0d5be..4395ee2 100644 --- a/1.x/packages/store-data-through-repositories.html +++ b/1.x/packages/store-data-through-repositories.html @@ -9,7 +9,7 @@ - + @@ -72,7 +72,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 c528eba..823306f 100644 --- a/1.x/packages/validation.html +++ b/1.x/packages/validation.html @@ -9,7 +9,7 @@ - + @@ -93,7 +93,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 10f28a4..9287432 100644 --- a/1.x/packages/views.html +++ b/1.x/packages/views.html @@ -9,7 +9,7 @@ - + @@ -98,7 +98,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/404.html b/404.html index e95be44..e11c151 100644 --- a/404.html +++ b/404.html @@ -9,13 +9,13 @@ - + -

    404

    How did we get here?
    + - + diff --git a/assets/js/14.e72960fa.js b/assets/js/14.9fe61dd3.js similarity index 96% rename from assets/js/14.e72960fa.js rename to assets/js/14.9fe61dd3.js index 253cb86..3390ab2 100644 --- a/assets/js/14.e72960fa.js +++ b/assets/js/14.9fe61dd3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{297:function(t,e,s){t.exports=s.p+"assets/img/attribute-list.89e3b2c1.png"},298:function(t,e,s){t.exports=s.p+"assets/img/attribute-step-1.6974bd2d.png"},299:function(t,e,s){t.exports=s.p+"assets/img/attribute-step-2.dc4d7a75.png"},300:function(t,e,s){t.exports=s.p+"assets/img/attribute-step-3.c8ca7729.png"},301:function(t,e,s){t.exports=s.p+"assets/img/attribute-step-4.95b43fb7.png"},326:function(t,e,s){"use strict";s.r(e);var a=s(10),i=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("Here is the list of all attributes")]),t._v(" "),e("p",[e("img",{attrs:{src:s(297),alt:"attribute-list"}})]),t._v(" "),e("ul",[e("li",[t._v("Step-1:\nNavigate to "),e("code",[t._v("Settings")]),t._v(" menu and search about "),e("code",[t._v("Attributes")]),t._v(" click on it.")])]),t._v(" "),e("p",[e("img",{attrs:{src:s(298),alt:"attribute-list"}})]),t._v(" "),e("ul",[e("li",[t._v("Step-2:\nNow click on "),e("code",[t._v("Create Attribute")]),t._v(" button.")])]),t._v(" "),e("p",[e("img",{attrs:{src:s(299),alt:"attribute-list"}})]),t._v(" "),e("ul",[e("li",[t._v("Step-3:\nFill all the inputs field as your requirement the hit the "),e("code",[t._v("Save as Attribute")]),t._v(" button.")])]),t._v(" "),e("p",[e("img",{attrs:{src:s(300),alt:"attribute-list"}})]),t._v(" "),e("ul",[e("li",[t._v("Step-4:\nYour custom attribute is created now and visible into "),e("code",[t._v("Leads")]),t._v(" create page when you create "),e("code",[t._v("Leads")]),t._v(".")])]),t._v(" "),e("p",[e("img",{attrs:{src:s(301),alt:"attribute-list"}})])])}),[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{297:function(t,e,s){t.exports=s.p+"assets/img/attribute-list.89e3b2c1.png"},298:function(t,e,s){t.exports=s.p+"assets/img/attribute-step-1.6974bd2d.png"},299:function(t,e,s){t.exports=s.p+"assets/img/attribute-step-2.dc4d7a75.png"},300:function(t,e,s){t.exports=s.p+"assets/img/attribute-step-3.c8ca7729.png"},301:function(t,e,s){t.exports=s.p+"assets/img/attribute-step-4.95b43fb7.png"},325:function(t,e,s){"use strict";s.r(e);var a=s(10),i=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("Here is the list of all attributes")]),t._v(" "),e("p",[e("img",{attrs:{src:s(297),alt:"attribute-list"}})]),t._v(" "),e("ul",[e("li",[t._v("Step-1:\nNavigate to "),e("code",[t._v("Settings")]),t._v(" menu and search about "),e("code",[t._v("Attributes")]),t._v(" click on it.")])]),t._v(" "),e("p",[e("img",{attrs:{src:s(298),alt:"attribute-list"}})]),t._v(" "),e("ul",[e("li",[t._v("Step-2:\nNow click on "),e("code",[t._v("Create Attribute")]),t._v(" button.")])]),t._v(" "),e("p",[e("img",{attrs:{src:s(299),alt:"attribute-list"}})]),t._v(" "),e("ul",[e("li",[t._v("Step-3:\nFill all the inputs field as your requirement the hit the "),e("code",[t._v("Save as Attribute")]),t._v(" button.")])]),t._v(" "),e("p",[e("img",{attrs:{src:s(300),alt:"attribute-list"}})]),t._v(" "),e("ul",[e("li",[t._v("Step-4:\nYour custom attribute is created now and visible into "),e("code",[t._v("Leads")]),t._v(" create page when you create "),e("code",[t._v("Leads")]),t._v(".")])]),t._v(" "),e("p",[e("img",{attrs:{src:s(301),alt:"attribute-list"}})])])}),[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/21.5b6eadf2.js b/assets/js/21.22b0536d.js similarity index 99% rename from assets/js/21.5b6eadf2.js rename to assets/js/21.22b0536d.js index 994bacd..97c6c62 100644 --- a/assets/js/21.5b6eadf2.js +++ b/assets/js/21.22b0536d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{296:function(t,e,s){t.exports=s.p+"assets/img/limiting-error-messages.36e9c79d.jpg"},315: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(296),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([[21],{296:function(t,e,s){t.exports=s.p+"assets/img/limiting-error-messages.36e9c79d.jpg"},318: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(296),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.b13100a3.js b/assets/js/25.3abc1e83.js similarity index 99% rename from assets/js/25.b13100a3.js rename to assets/js/25.3abc1e83.js index daaa4f0..d53546d 100644 --- a/assets/js/25.b13100a3.js +++ b/assets/js/25.3abc1e83.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{313: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:"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("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Webkul"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Product"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Contracts"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),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(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("App"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Http"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),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("ul",[e("li",[t._v("Replace "),e("code",[t._v("\\Webkul\\Product\\Contracts\\Product::class")]),t._v(" with the interface you wish to override.")]),t._v(" "),e("li",[t._v("Replace "),e("code",[t._v("\\App\\Http\\Product::class")]),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("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Webkul"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Product"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Contracts"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),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(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name class-name-fully-qualified static-context"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("App"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Http"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("Product")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),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("ul",[e("li",[t._v("Replace "),e("code",[t._v("\\Webkul\\Product\\Contracts\\Product::class")]),t._v(" with the interface you wish to override.")]),t._v(" "),e("li",[t._v("Replace "),e("code",[t._v("\\App\\Http\\Product::class")]),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([[26],{313: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/27.53f5eed3.js b/assets/js/27.5887633f.js similarity index 94% rename from assets/js/27.53f5eed3.js rename to assets/js/27.5887633f.js index 13ae38c..83791db 100644 --- a/assets/js/27.53f5eed3.js +++ b/assets/js/27.5887633f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{314:function(t,a,e){"use strict";e.r(a);var s=e(10),i=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"krayin-apis"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#krayin-apis"}},[t._v("#")]),t._v(" Krayin APIs")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#rest-api"}},[t._v("REST API")])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"rest-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rest-api"}},[t._v("#")]),t._v(" REST API")]),t._v(" "),a("p",[t._v("The Krayin REST API supports REST (Representational State Transfer) and provides access to CRUD (Create, Read, Update, Delete) operations. It also supports pagination to increase the performance of the application. The Krayin REST API can be used to build a PWA (Progressive Web Application) application, integrate an online shopping mobile application with the Krayin store.")])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{315:function(t,a,e){"use strict";e.r(a);var s=e(10),i=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"krayin-apis"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#krayin-apis"}},[t._v("#")]),t._v(" Krayin APIs")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#rest-api"}},[t._v("REST API")])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"rest-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rest-api"}},[t._v("#")]),t._v(" REST API")]),t._v(" "),a("p",[t._v("The Krayin REST API supports REST (Representational State Transfer) and provides access to CRUD (Create, Read, Update, Delete) operations. It also supports pagination to increase the performance of the application. The Krayin REST API can be used to build a PWA (Progressive Web Application) application, integrate an online shopping mobile application with the Krayin store.")])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/28.f9d5b92f.js b/assets/js/28.bdd80b37.js similarity index 98% rename from assets/js/28.f9d5b92f.js rename to assets/js/28.bdd80b37.js index 6a68c7d..da87194 100644 --- a/assets/js/28.f9d5b92f.js +++ b/assets/js/28.bdd80b37.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{317: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.krayin.com/krayin-api-demo-common",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.krayin.com/krayin-api-demo-common/api/admin/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._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([[35],{324: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/36.650631ed.js b/assets/js/36.7999bc44.js similarity index 99% rename from assets/js/36.650631ed.js rename to assets/js/36.7999bc44.js index 8e68b7b..53e7cbb 100644 --- a/assets/js/36.650631ed.js +++ b/assets/js/36.7999bc44.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{325: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 demo, check out our website "),t("a",{attrs:{href:"https://devdocs.krayincrm.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://devdocs.krayincrm.com/"),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("https://krayincrm.com"),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("Stay Updated")]),e._v(": Refer to the "),t("a",{attrs:{href:"https://krayincrm.com/roadmap",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin roadmap"),t("OutboundLink")],1),e._v(" for the latest version and recently added features.")])]),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/krayin",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub"),t("OutboundLink")],1),e._v(" with over 10.6K+ 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([[36],{326: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 demo, check out our website "),t("a",{attrs:{href:"https://devdocs.krayincrm.com",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://devdocs.krayincrm.com/"),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("https://krayincrm.com"),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("Stay Updated")]),e._v(": Refer to the "),t("a",{attrs:{href:"https://krayincrm.com/roadmap",target:"_blank",rel:"noopener noreferrer"}},[e._v("Krayin roadmap"),t("OutboundLink")],1),e._v(" for the latest version and recently added features.")])]),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/krayin",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub"),t("OutboundLink")],1),e._v(" with over 10.6K+ 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/38.3bbdeecf.js b/assets/js/38.804ded6f.js similarity index 98% rename from assets/js/38.3bbdeecf.js rename to assets/js/38.804ded6f.js index 3140b3c..744d599 100644 --- a/assets/js/38.3bbdeecf.js +++ b/assets/js/38.804ded6f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{328:function(a,s,e){"use strict";e.r(s);var t=e(10),n=Object(t.a)({},(function(){var a=this,s=a._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[s("h1",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[a._v("#")]),a._v(" Installation")]),a._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#install-using-composer"}},[a._v("Install Using Composer")])]),s("li",[s("a",{attrs:{href:"#start-using-krayin"}},[a._v("Start Using Krayin")]),s("ul",[s("li",[s("a",{attrs:{href:"#on-a-production-server"}},[a._v("On a Production Server")])]),s("li",[s("a",{attrs:{href:"#on-your-local-server"}},[a._v("On Your Local Server")])]),s("li",[s("a",{attrs:{href:"#login-as-an-admin"}},[a._v("Login as an Admin")])]),s("li",[s("a",{attrs:{href:"#contributing"}},[a._v("Contributing")])]),s("li",[s("a",{attrs:{href:"#license"}},[a._v("License")])])])])])]),s("p"),a._v(" "),s("h2",{attrs:{id:"install-using-composer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#install-using-composer"}},[a._v("#")]),a._v(" Install Using Composer")]),a._v(" "),s("p",[a._v("To install Krayin using Composer, use the following steps:")]),a._v(" "),s("ul",[s("li",[s("p",[a._v("Choose the directory where you want to install Krayin. Open your terminal and navigate to this directory.")])]),a._v(" "),s("li",[s("p",[a._v("Once you are in the desired directory, run the following command in your terminal to install Krayin:")])]),a._v(" "),s("li",[s("p",[a._v("Run the following command:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("composer")]),a._v(" create-project krayin/laravel-crm\n")])])])]),a._v(" "),s("li",[s("p",[a._v("Run the following command:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("php artisan krayin-crm:install\n")])])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[a._v("WARNING")]),a._v(" "),s("p",[a._v("During the installation process, if the "),s("strong",[s("code",[a._v(".env")])]),a._v(" file doesn't exist, the installer will prompt you to provide the necessary information.")])])]),a._v(" "),s("li",[s("p",[a._v("Follow the prompts during the installation process to provide the following details:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("- Please enter the application name "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter the application URL "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the default application locale "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the default currency "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database connection "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("host")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database name "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter your database username "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter your database password "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n")])])])]),a._v(" "),s("li",[s("p",[a._v("For Create your admin credentials")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("- Enter the name of the admin user "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n- Enter the email address of the admin user "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n- Configure the password "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("for")]),a._v(" the admin user "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n")])])])])]),a._v(" "),s("h2",{attrs:{id:"start-using-krayin"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#start-using-krayin"}},[a._v("#")]),a._v(" Start Using Krayin")]),a._v(" "),s("h3",{attrs:{id:"on-a-production-server"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#on-a-production-server"}},[a._v("#")]),a._v(" On a Production Server")]),a._v(" "),s("p",[a._v("To access Krayin on a production server, open your domain in a web browser. For example:")]),a._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[a._v("https://example.com/\n")])])]),s("h3",{attrs:{id:"on-your-local-server"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#on-your-local-server"}},[a._v("#")]),a._v(" On Your Local Server")]),a._v(" "),s("p",[a._v("To access Krayin on your local server, follow these steps:")]),a._v(" "),s("ol",[s("li",[s("p",[a._v("Configure your HTTP server to point to the "),s("strong",[s("code",[a._v("public/")])]),a._v(" directory of the project.")])]),a._v(" "),s("li",[s("p",[a._v("Run the following command:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("php artisan serve\n")])])])]),a._v(" "),s("li",[s("p",[a._v("Open your browser and access the provided local server URL.")])])]),a._v(" "),s("h3",{attrs:{id:"login-as-an-admin"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#login-as-an-admin"}},[a._v("#")]),a._v(" Login as an Admin")]),a._v(" "),s("p",[a._v("To log in as an admin, visit "),s("strong",[s("code",[a._v("https://example.com/admin/")])]),a._v(". If you used the "),s("strong",[s("code",[a._v("php artisan krayin-crm:install")])]),a._v(" command, use the following credentials:")]),a._v(" "),s("div",{staticClass:"language-text extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[a._v("Email: admin@example.com\nPassword: admin123\n")])])]),s("h3",{attrs:{id:"contributing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributing"}},[a._v("#")]),a._v(" Contributing")]),a._v(" "),s("p",[a._v("Contributions are welcome! Follow the contribution guidelines to get started.")]),a._v(" "),s("h3",{attrs:{id:"license"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#license"}},[a._v("#")]),a._v(" License")]),a._v(" "),s("p",[a._v("Krayin is open-sourced software licensed under the MIT license.sir mujhe")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{331:function(a,s,e){"use strict";e.r(s);var t=e(10),n=Object(t.a)({},(function(){var a=this,s=a._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[s("h1",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[a._v("#")]),a._v(" Installation")]),a._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#install-using-composer"}},[a._v("Install Using Composer")])]),s("li",[s("a",{attrs:{href:"#start-using-krayin"}},[a._v("Start Using Krayin")]),s("ul",[s("li",[s("a",{attrs:{href:"#on-a-production-server"}},[a._v("On a Production Server")])]),s("li",[s("a",{attrs:{href:"#on-your-local-server"}},[a._v("On Your Local Server")])]),s("li",[s("a",{attrs:{href:"#login-as-an-admin"}},[a._v("Login as an Admin")])]),s("li",[s("a",{attrs:{href:"#contributing"}},[a._v("Contributing")])]),s("li",[s("a",{attrs:{href:"#license"}},[a._v("License")])])])])])]),s("p"),a._v(" "),s("h2",{attrs:{id:"install-using-composer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#install-using-composer"}},[a._v("#")]),a._v(" Install Using Composer")]),a._v(" "),s("p",[a._v("To install Krayin using Composer, use the following steps:")]),a._v(" "),s("ul",[s("li",[s("p",[a._v("Choose the directory where you want to install Krayin. Open your terminal and navigate to this directory.")])]),a._v(" "),s("li",[s("p",[a._v("Once you are in the desired directory, run the following command in your terminal to install Krayin:")])]),a._v(" "),s("li",[s("p",[a._v("Run the following command:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("composer")]),a._v(" create-project krayin/laravel-crm\n")])])])]),a._v(" "),s("li",[s("p",[a._v("Run the following command:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("php artisan krayin-crm:install\n")])])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[a._v("WARNING")]),a._v(" "),s("p",[a._v("During the installation process, if the "),s("strong",[s("code",[a._v(".env")])]),a._v(" file doesn't exist, the installer will prompt you to provide the necessary information.")])])]),a._v(" "),s("li",[s("p",[a._v("Follow the prompts during the installation process to provide the following details:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("- Please enter the application name "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter the application URL "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the default application locale "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the default currency "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database connection "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("host")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("select")]),a._v(" the database name "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter your database username "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n- Please enter your database password "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" \n")])])])]),a._v(" "),s("li",[s("p",[a._v("For Create your admin credentials")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("- Enter the name of the admin user "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n- Enter the email address of the admin user "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n- Configure the password "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("for")]),a._v(" the admin user "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v("\n")])])])])]),a._v(" "),s("h2",{attrs:{id:"start-using-krayin"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#start-using-krayin"}},[a._v("#")]),a._v(" Start Using Krayin")]),a._v(" "),s("h3",{attrs:{id:"on-a-production-server"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#on-a-production-server"}},[a._v("#")]),a._v(" On a Production Server")]),a._v(" "),s("p",[a._v("To access Krayin on a production server, open your domain in a web browser. For example:")]),a._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[a._v("https://example.com/\n")])])]),s("h3",{attrs:{id:"on-your-local-server"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#on-your-local-server"}},[a._v("#")]),a._v(" On Your Local Server")]),a._v(" "),s("p",[a._v("To access Krayin on your local server, follow these steps:")]),a._v(" "),s("ol",[s("li",[s("p",[a._v("Configure your HTTP server to point to the "),s("strong",[s("code",[a._v("public/")])]),a._v(" directory of the project.")])]),a._v(" "),s("li",[s("p",[a._v("Run the following command:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("php artisan serve\n")])])])]),a._v(" "),s("li",[s("p",[a._v("Open your browser and access the provided local server URL.")])])]),a._v(" "),s("h3",{attrs:{id:"login-as-an-admin"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#login-as-an-admin"}},[a._v("#")]),a._v(" Login as an Admin")]),a._v(" "),s("p",[a._v("To log in as an admin, visit "),s("strong",[s("code",[a._v("https://example.com/admin/")])]),a._v(". If you used the "),s("strong",[s("code",[a._v("php artisan krayin-crm:install")])]),a._v(" command, use the following credentials:")]),a._v(" "),s("div",{staticClass:"language-text extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[a._v("Email: admin@example.com\nPassword: admin123\n")])])]),s("h3",{attrs:{id:"contributing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributing"}},[a._v("#")]),a._v(" Contributing")]),a._v(" "),s("p",[a._v("Contributions are welcome! Follow the contribution guidelines to get started.")]),a._v(" "),s("h3",{attrs:{id:"license"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#license"}},[a._v("#")]),a._v(" License")]),a._v(" "),s("p",[a._v("Krayin is open-sourced software licensed under the MIT license.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/39.6f2f06d0.js b/assets/js/39.f2e156ac.js similarity index 98% rename from assets/js/39.6f2f06d0.js rename to assets/js/39.f2e156ac.js index 107d3ed..6297fde 100644 --- a/assets/js/39.6f2f06d0.js +++ b/assets/js/39.f2e156ac.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{329: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([[39],{328: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/40.3c777840.js b/assets/js/40.bad1cd62.js similarity index 98% rename from assets/js/40.3c777840.js rename to assets/js/40.bad1cd62.js index a9d5f38..4aaec19 100644 --- a/assets/js/40.3c777840.js +++ b/assets/js/40.bad1cd62.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{330: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-to-the-latest-version-of-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrade-to-the-latest-version-of-krayin"}},[e._v("#")]),e._v(" Upgrade to the latest version of Krayin")]),e._v(" "),t("p",[e._v("To upgrade your current version to the latest version of Krayin, you need to follow some steps,")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("First, you need to download the latest version of Krayin.")])]),e._v(" "),t("li",[t("p",[e._v("You can download Krayin from the following links,")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://Krayin.com/en/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/Krayin",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download From Github"),t("OutboundLink")],1)])])]),e._v(" "),t("li",[t("p",[e._v("After downloading the latest version, run the specified commands 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")])])])]),e._v(" "),t("li",[t("p",[e._v("After the command has been executed, now go to your "),t("code",[e._v(".env")]),e._v(" file, provide your old project database credentials for which you want to upgrade Krayin, and run 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 optimize\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# -- OR")]),e._v("\n\nphp artisan config:cache\n")])])])]),e._v(" "),t("li",[t("p",[e._v("Now, your new changes have been cached and now your project is ready to run the migrate command,")]),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("Here we have not provided you the seeder command because the seeder command always resets all the settings, categories and etc. If some tables need default settings then we advise you to add manually.")])])]),e._v(" "),t("li",[t("p",[e._v("Now, its time to create a symlink so that public assets can be linked to storage,")]),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 all the content of the previous version's directory (e.g. "),t("code",[e._v("old-project/storage/app/public")]),e._v(") to the latest version's directory (e.g. "),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 also depends on some local storage, or you have changed some paths, or you want previous logs also then make sure you add all those also.")])])]),e._v(" "),t("li",[t("p",[e._v("Once this is finished run the following command to publish your new files,")]),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("Don't use the "),t("code",[e._v("--force")]),e._v(" flag, this will reset all your views. Use only when you know what you are doing.")])])])]),e._v(" "),t("p",[e._v("You are now at the latest version. Still, we want to mention that if you have done a lot of customizations then that portion of compatibility should be handled at your end.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{329: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-to-the-latest-version-of-krayin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upgrade-to-the-latest-version-of-krayin"}},[e._v("#")]),e._v(" Upgrade to the latest version of Krayin")]),e._v(" "),t("p",[e._v("To upgrade your current version to the latest version of Krayin, you need to follow some steps,")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("First, you need to download the latest version of Krayin.")])]),e._v(" "),t("li",[t("p",[e._v("You can download Krayin from the following links,")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://Krayin.com/en/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/Krayin",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download From Github"),t("OutboundLink")],1)])])]),e._v(" "),t("li",[t("p",[e._v("After downloading the latest version, run the specified commands 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")])])])]),e._v(" "),t("li",[t("p",[e._v("After the command has been executed, now go to your "),t("code",[e._v(".env")]),e._v(" file, provide your old project database credentials for which you want to upgrade Krayin, and run 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 optimize\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# -- OR")]),e._v("\n\nphp artisan config:cache\n")])])])]),e._v(" "),t("li",[t("p",[e._v("Now, your new changes have been cached and now your project is ready to run the migrate command,")]),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("Here we have not provided you the seeder command because the seeder command always resets all the settings, categories and etc. If some tables need default settings then we advise you to add manually.")])])]),e._v(" "),t("li",[t("p",[e._v("Now, its time to create a symlink so that public assets can be linked to storage,")]),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 all the content of the previous version's directory (e.g. "),t("code",[e._v("old-project/storage/app/public")]),e._v(") to the latest version's directory (e.g. "),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 also depends on some local storage, or you have changed some paths, or you want previous logs also then make sure you add all those also.")])])]),e._v(" "),t("li",[t("p",[e._v("Once this is finished run the following command to publish your new files,")]),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("Don't use the "),t("code",[e._v("--force")]),e._v(" flag, this will reset all your views. Use only when you know what you are doing.")])])])]),e._v(" "),t("p",[e._v("You are now at the latest version. Still, we want to mention that if you have done a lot of customizations then that portion of compatibility should be handled at your end.")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/41.7c677cd8.js b/assets/js/41.528a517a.js similarity index 98% rename from assets/js/41.7c677cd8.js rename to assets/js/41.528a517a.js index 7886231..925e5d7 100644 --- a/assets/js/41.7c677cd8.js +++ b/assets/js/41.528a517a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{331:function(e,n,a){"use strict";a.r(n);var t=a(10),s=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 eCommerce 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 ├── publishable\n │ └── assets\n │ ├── css\n │ │ └── admin.css\n │ ├── images\n │ │ └── category-icon.png\n │ └── js\n │ └── app.js\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 │ └── sass\n │ └── admin.scss\n ├── lang\n │ └── app.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=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{333:function(e,n,a){"use strict";a.r(n);var t=a(10),s=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 eCommerce 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 ├── publishable\n │ └── assets\n │ ├── css\n │ │ └── admin.css\n │ ├── images\n │ │ └── category-icon.png\n │ └── js\n │ └── app.js\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 │ └── sass\n │ └── admin.scss\n ├── lang\n │ └── app.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=s.exports}}]); \ No newline at end of file diff --git a/assets/js/42.9745a024.js b/assets/js/42.1fbc1407.js similarity index 99% rename from assets/js/42.9745a024.js rename to assets/js/42.1fbc1407.js index 9d05b98..55b2fe1 100644 --- a/assets/js/42.9745a024.js +++ b/assets/js/42.1fbc1407.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{332: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 ├── sass\n │ ├── icon"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("scss\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("sass\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([[42],{330: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 ├── sass\n │ ├── icon"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("scss\n │ └── app"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("sass\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/43.fd1dad19.js b/assets/js/43.bb5be4b5.js similarity index 99% rename from assets/js/43.fd1dad19.js rename to assets/js/43.bb5be4b5.js index 18c08e0..61a2286 100644 --- a/assets/js/43.fd1dad19.js +++ b/assets/js/43.bb5be4b5.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{334: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 folders 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 ├── sass\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("scss\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([[43],{332: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 folders 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 ├── sass\n │ └── app"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(".")]),t._v("scss\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/44.aecf5f79.js b/assets/js/44.84e2eb55.js similarity index 99% rename from assets/js/44.aecf5f79.js rename to assets/js/44.84e2eb55.js index 89efdac..70ef9a1 100644 --- a/assets/js/44.aecf5f79.js +++ b/assets/js/44.84e2eb55.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{333: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([[44],{334: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/46.709a3041.js b/assets/js/46.8385a633.js similarity index 99% rename from assets/js/46.709a3041.js rename to assets/js/46.8385a633.js index 3255e95..605082e 100644 --- a/assets/js/46.709a3041.js +++ b/assets/js/46.8385a633.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{336: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(" folders.")]),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([[46],{339: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(" folders.")]),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/47.1ec640e9.js b/assets/js/47.6a8acc46.js similarity index 99% rename from assets/js/47.1ec640e9.js rename to assets/js/47.6a8acc46.js index 6301092..08471d3 100644 --- a/assets/js/47.1ec640e9.js +++ b/assets/js/47.6a8acc46.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{337: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([[47],{336: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/48.fabb7629.js b/assets/js/48.60a37f0b.js similarity index 99% rename from assets/js/48.fabb7629.js rename to assets/js/48.60a37f0b.js index 116489a..ca135e7 100644 --- a/assets/js/48.fabb7629.js +++ b/assets/js/48.60a37f0b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{338: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/krayin-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([[48],{337: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/krayin-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/49.4787fee0.js b/assets/js/49.0ce5ac3f.js similarity index 99% rename from assets/js/49.4787fee0.js rename to assets/js/49.0ce5ac3f.js index 0a10d93..46481f3 100644 --- a/assets/js/49.4787fee0.js +++ b/assets/js/49.0ce5ac3f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{339: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([[49],{338: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/51.551531a2.js b/assets/js/51.529357c2.js similarity index 99% rename from assets/js/51.551531a2.js rename to assets/js/51.529357c2.js index ec1d50e..a84bc14 100644 --- a/assets/js/51.551531a2.js +++ b/assets/js/51.529357c2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{340: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 folders 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 folders for each language you want to support. For example, you can create folders 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([[51],{342: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 folders 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 folders for each language you want to support. For example, you can create folders 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/52.c4db90f6.js b/assets/js/52.da80d54a.js similarity index 99% rename from assets/js/52.c4db90f6.js rename to assets/js/52.da80d54a.js index a1d258a..7a2cc94 100644 --- a/assets/js/52.c4db90f6.js +++ b/assets/js/52.da80d54a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{342: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([[52],{340: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/55.fb5ba6ab.js b/assets/js/55.2a96f054.js similarity index 99% rename from assets/js/55.fb5ba6ab.js rename to assets/js/55.2a96f054.js index b61e684..b7ab8f9 100644 --- a/assets/js/55.fb5ba6ab.js +++ b/assets/js/55.2a96f054.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{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:"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([[55],{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:"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/56.f5780b89.js b/assets/js/56.6a018368.js similarity index 77% rename from assets/js/56.f5780b89.js rename to assets/js/56.6a018368.js index a3cee68..07a9c46 100644 --- a/assets/js/56.f5780b89.js +++ b/assets/js/56.6a018368.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{346:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{345:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/app.255df903.js b/assets/js/app.6fd5b9b0.js similarity index 76% rename from assets/js/app.255df903.js rename to assets/js/app.6fd5b9b0.js index c5f4427..c87270d 100644 --- a/assets/js/app.255df903.js +++ b/assets/js/app.6fd5b9b0.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var r,a,s=e[0],c=e[1],l=e[2],f=0,p=[];f=e||n<0||m&&t-l>=i}function _(){var t=d();if(x(t))return w(t);s=setTimeout(_,function(t){var n=e-(t-c);return m?p(n,i-(t-l)):n}(t))}function w(t){return s=void 0,g&&r?y(t):(r=o=void 0,a)}function k(){var t=d(),n=x(t);if(r=arguments,o=this,c=t,n){if(void 0===s)return b(c);if(m)return s=setTimeout(_,e),y(c)}return void 0===s&&(s=setTimeout(_,e)),a}return e=v(e)||0,h(n)&&(u=!!n.leading,i=(m="maxWait"in n)?f(v(n.maxWait)||0,e):i,g="trailing"in n?!!n.trailing:g),k.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=o=s=void 0},k.flush=function(){return void 0===s?a:w(d())},k}},function(t,e,n){var r,o; +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var r,a,s=e[0],c=e[1],l=e[2],f=0,p=[];f=e||n<0||m&&t-l>=i}function _(){var t=d();if(x(t))return w(t);s=setTimeout(_,function(t){var n=e-(t-c);return m?p(n,i-(t-l)):n}(t))}function w(t){return s=void 0,g&&r?y(t):(r=o=void 0,a)}function k(){var t=d(),n=x(t);if(r=arguments,o=this,c=t,n){if(void 0===s)return b(c);if(m)return s=setTimeout(_,e),y(c)}return void 0===s&&(s=setTimeout(_,e)),a}return e=v(e)||0,h(n)&&(u=!!n.leading,i=(m="maxWait"in n)?f(v(n.maxWait)||0,e):i,g="trailing"in n?!!n.trailing:g),k.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=o=s=void 0},k.flush=function(){return void 0===s?a:w(d())},k}},function(t,e,n){var r,o; /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */void 0===(o="function"==typeof(r=function(){var t,e,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 o(t,e,n){return tn?n:t}function i(t){return 100*(-1+t)}n.configure=function(t){var e,n;for(e in t)void 0!==(n=t[e])&&t.hasOwnProperty(e)&&(r[e]=n);return this},n.status=null,n.set=function(t){var e=n.isStarted();t=o(t,r.minimum,1),n.status=1===t?null:t;var c=n.render(!e),l=c.querySelector(r.barSelector),u=r.speed,f=r.easing;return c.offsetWidth,a((function(e){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(l,function(t,e,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+i(t)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+i(t)+"%,0)"}:{"margin-left":i(t)+"%"}).transition="all "+e+"ms "+n,o}(t,u,f)),1===t?(s(c,{transition:"none",opacity:1}),c.offsetWidth,setTimeout((function(){s(c,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),e()}),u)}),u)):setTimeout(e,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var t=function(){setTimeout((function(){n.status&&(n.trickle(),t())}),r.trickleSpeed)};return r.trickle&&t(),this},n.done=function(t){return t||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(t){var e=n.status;return e?("number"!=typeof t&&(t=(1-e)*o(Math.random()*e,.1,.95)),e=o(e+t,0,.994),n.set(e)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},t=0,e=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===e&&n.start(),t++,e++,r.always((function(){0==--e?(t=0,n.done()):n.set((t-e)/t)})),this):this},n.render=function(t){if(n.isRendered())return document.getElementById("nprogress");l(document.documentElement,"nprogress-busy");var e=document.createElement("div");e.id="nprogress",e.innerHTML=r.template;var o,a=e.querySelector(r.barSelector),c=t?"-100":i(n.status||0),u=document.querySelector(r.parent);return s(a,{transition:"all 0 linear",transform:"translate3d("+c+"%,0,0)"}),r.showSpinner||(o=e.querySelector(r.spinnerSelector))&&p(o),u!=document.body&&l(u,"nprogress-custom-parent"),u.appendChild(e),e},n.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(r.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&p(t)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var a=function(){var t=[];function e(){var n=t.shift();n&&n(e)}return function(n){t.push(n),1==t.length&&e()}}(),s=function(){var t=["Webkit","O","Moz","ms"],e={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,e){return e.toUpperCase()})),e[n]||(e[n]=function(e){var n=document.body.style;if(e in n)return e;for(var r,o=t.length,i=e.charAt(0).toUpperCase()+e.slice(1);o--;)if((r=t[o]+i)in n)return r;return e}(n))}function r(t,e,r){e=n(e),t.style[e]=r}return function(t,e){var n,o,i=arguments;if(2==i.length)for(n in e)void 0!==(o=e[n])&&e.hasOwnProperty(n)&&r(t,n,o);else r(t,i[1],i[2])}}();function c(t,e){return("string"==typeof t?t:f(t)).indexOf(" "+e+" ")>=0}function l(t,e){var n=f(t),r=n+e;c(n,e)||(t.className=r.substring(1))}function u(t,e){var n,r=f(t);c(t,e)&&(n=r.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))}function f(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function p(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return n})?r.call(e,n,e,t):r)||(t.exports=o)},function(t,e,n){"use strict";var r=n(0),o=n(46).f,i=n(13),a=n(93),s=n(34),c=n(61),l=n(121);t.exports=function(t,e){var n,u,f,p,d,h=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[h]||s(h,{}):r[h]&&r[h].prototype)for(u in e){if(p=e[u],f=t.dontCallGetSet?(d=o(n,u))&&d.value:n[u],!l(v?u:h+(m?".":"#")+u,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;c(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),a(n,u,p,t)}}},function(t,e,n){"use strict";var r=n(26),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},function(t,e,n){"use strict";var r=n(3);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},function(t,e,n){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var r=n(47),o=n(29);t.exports=function(t){return r(o(t))}},function(t,e,n){"use strict";var r=n(48),o=TypeError;t.exports=function(t){if(r(t))throw new o("Can't call method on "+t);return t}},function(t,e,n){"use strict";var r=n(0),o=n(1),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},function(t,e,n){"use strict";var r=n(1),o=n(103),i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(o(t)+" is not a function")}},function(t,e,n){"use strict";var r=n(0),o=n(55),i=n(8),a=n(57),s=n(53),c=n(52),l=r.Symbol,u=o("wks"),f=c?l.for||l:l&&l.withoutSetter||a;t.exports=function(t){return i(u,t)||(u[t]=s&&i(l,t)?l[t]:f("Symbol."+t)),u[t]}},function(t,e,n){"use strict";var r=n(56),o=n(0),i=n(34),a=t.exports=o["__core-js_shared__"]||i("__core-js_shared__",{});(a.versions||(a.versions=[])).push({version:"3.37.1",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"})},function(t,e,n){"use strict";var r=n(0),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},function(t,e,n){"use strict";var r=n(29),o=Object;t.exports=function(t){return o(r(t))}},function(t,e,n){"use strict";var r=n(118);t.exports=function(t){return r(t.length)}},function(t,e,n){var r=n(145),o=n(11),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=c},function(t,e,n){var r=n(9)(n(7),"Map");t.exports=r},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(165),o=n(172),i=n(174),a=n(175),s=n(176);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(4),o=n(44),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||(a.test(t)||!i.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var r=n(12),o=n(11);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){"use strict";var r=n(5),o=n(25),i=n(99),a=n(27),s=n(28),c=n(49),l=n(8),u=n(58),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=s(t),e=c(e),u)try{return f(t,e)}catch(t){}if(l(t,e))return a(!o(i.f,t,e),t[e])}},function(t,e,n){"use strict";var r=n(2),o=n(3),i=n(16),a=Object,s=r("".split);t.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"===i(t)?s(t,""):a(t)}:a},function(t,e,n){"use strict";t.exports=function(t){return null==t}},function(t,e,n){"use strict";var r=n(100),o=n(50);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},function(t,e,n){"use strict";var r=n(30),o=n(1),i=n(51),a=n(52),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,s(t))}},function(t,e,n){"use strict";var r=n(2);t.exports=r({}.isPrototypeOf)},function(t,e,n){"use strict";var r=n(53);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){"use strict";var r=n(54),o=n(3),i=n(0).String;t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},function(t,e,n){"use strict";var r,o,i=n(0),a=n(101),s=i.process,c=i.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},function(t,e,n){"use strict";var r=n(33);t.exports=function(t,e){return r[t]||(r[t]=e||{})}},function(t,e,n){"use strict";t.exports=!1},function(t,e,n){"use strict";var r=n(2),o=0,i=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},function(t,e,n){"use strict";var r=n(5),o=n(3),i=n(105);t.exports=!r&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){"use strict";var r=n(6),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(o(t)+" is not an object")}},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var r=n(8),o=n(112),i=n(46),a=n(15);t.exports=function(t,e,n){for(var s=o(e),c=a.f,l=i.f,u=0;uu))return!1;var p=c.get(t),d=c.get(e);if(p&&d)return p==e&&d==t;var h=-1,v=!0,m=2&n?new r:void 0;for(c.set(t,e),c.set(e,t);++h-1&&t%1==0&&t]/;t.exports=function(t){var e,n=""+t,o=r.exec(n);if(!o)return n;var i="",a=0,s=0;for(a=o.index;a1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=e.startX+(e.x-e.startX)*n,o=e.startY+(e.y-e.startY)*n,e.method.call(e.scrollable,r,o),r===e.x&&o===e.y||t.requestAnimationFrame(d.bind(t,e))}function h(n,r,a){var c,l,u,f,p=i();n===e.body?(c=t,l=t.scrollX||t.pageXOffset,u=t.scrollY||t.pageYOffset,f=o.scroll):(c=n,l=n.scrollLeft,u=n.scrollTop,f=s),d({scrollable:c,method:f,startTime:p,startX:l,startY:u,x:r,y:a})}}}}()},function(t,e,n){"use strict";var r=n(24),o=n(35),i=n(36),a=n(140),s=n(142);r({target:"Array",proto:!0,arity:1,forced:n(3)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=o(this),n=i(e),r=arguments.length;s(n+r);for(var c=0;c79&&a<83||!i("reduce")},{reduce:function(t){var e=arguments.length;return o(this,t,e,e>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},function(t,e,n){"use strict";var r=n(25),o=n(6),i=n(50),a=n(102),s=n(104),c=n(32),l=TypeError,u=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,c=a(t,u);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!o(n)||i(n))return n;throw new l("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},function(t,e,n){"use strict";t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},function(t,e,n){"use strict";var r=n(31),o=n(48);t.exports=function(t,e){var n=t[e];return o(n)?void 0:r(n)}},function(t,e,n){"use strict";var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},function(t,e,n){"use strict";var r=n(25),o=n(1),i=n(6),a=TypeError;t.exports=function(t,e){var n,s;if("string"===e&&o(n=t.toString)&&!i(s=r(n,t)))return s;if(o(n=t.valueOf)&&!i(s=r(n,t)))return s;if("string"!==e&&o(n=t.toString)&&!i(s=r(n,t)))return s;throw new a("Can't convert object to primitive value")}},function(t,e,n){"use strict";var r=n(0),o=n(6),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},function(t,e,n){"use strict";var r=n(5),o=n(3);t.exports=r&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(t,e,n){"use strict";var r=n(5),o=n(8),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&a(i,"name").configurable);t.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},function(t,e,n){"use strict";var r=n(2),o=n(1),i=n(33),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},function(t,e,n){"use strict";var r,o,i,a=n(110),s=n(0),c=n(6),l=n(13),u=n(8),f=n(33),p=n(111),d=n(60),h=s.TypeError,v=s.WeakMap;if(a||f.state){var m=f.state||(f.state=new v);m.get=m.get,m.has=m.has,m.set=m.set,r=function(t,e){if(m.has(t))throw new h("Object already initialized");return e.facade=t,m.set(t,e),e},o=function(t){return m.get(t)||{}},i=function(t){return m.has(t)}}else{var g=p("state");d[g]=!0,r=function(t,e){if(u(t,g))throw new h("Object already initialized");return e.facade=t,l(t,g,e),e},o=function(t){return u(t,g)?t[g]:{}},i=function(t){return u(t,g)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=o(e)).type!==t)throw new h("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){"use strict";var r=n(0),o=n(1),i=r.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},function(t,e,n){"use strict";var r=n(55),o=n(57),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e,n){"use strict";var r=n(30),o=n(2),i=n(113),a=n(120),s=n(59),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(s(t)),n=a.f;return n?c(e,n(t)):e}},function(t,e,n){"use strict";var r=n(114),o=n(119).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){"use strict";var r=n(2),o=n(8),i=n(28),a=n(115).indexOf,s=n(60),c=r([].push);t.exports=function(t,e){var n,r=i(t),l=0,u=[];for(n in r)!o(s,n)&&o(r,n)&&c(u,n);for(;e.length>l;)o(r,n=e[l++])&&(~a(u,n)||c(u,n));return u}},function(t,e,n){"use strict";var r=n(28),o=n(116),i=n(36),a=function(t){return function(e,n,a){var s=r(e),c=i(s);if(0===c)return!t&&-1;var l,u=o(a,c);if(t&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((t||u in s)&&s[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e,n){"use strict";var r=n(62),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},function(t,e,n){"use strict";var r=Math.ceil,o=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?o:r)(e)}},function(t,e,n){"use strict";var r=n(62),o=Math.min;t.exports=function(t){var e=r(t);return e>0?o(e,9007199254740991):0}},function(t,e,n){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){"use strict";e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";var r=n(3),o=n(1),i=/#|\.prototype\./,a=function(t,e){var n=c[s(t)];return n===u||n!==l&&(o(e)?r(e):!!e)},s=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";t.exports=a},function(t,e,n){"use strict";var r=n(31),o=n(35),i=n(47),a=n(36),s=TypeError,c="Reduce of empty array with no initial value",l=function(t){return function(e,n,l,u){var f=o(e),p=i(f),d=a(f);if(r(n),0===d&&l<2)throw new s(c);var h=t?d-1:0,v=t?-1:1;if(l<2)for(;;){if(h in p){u=p[h],h+=v;break}if(h+=v,t?h<0:d<=h)throw new s(c)}for(;t?h>=0:d>h;h+=v)h in p&&(u=n(u,p[h],h,f));return u}};t.exports={left:l(!1),right:l(!0)}},function(t,e,n){"use strict";var r=n(3);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){return 1},1)}))}},function(t,e,n){"use strict";var r=n(0),o=n(16);t.exports="process"===o(r.process)},function(t,e,n){"use strict";var r=n(24),o=n(0),i=n(126),a=n(127),s=o.WebAssembly,c=7!==new Error("e",{cause:7}).cause,l=function(t,e){var n={};n[t]=a(t,e,c),r({global:!0,constructor:!0,arity:1,forced:c},n)},u=function(t,e){if(s&&s[t]){var n={};n[t]=a("WebAssembly."+t,e,c),r({target:"WebAssembly",stat:!0,constructor:!0,arity:1,forced:c},n)}};l("Error",(function(t){return function(e){return i(t,this,arguments)}})),l("EvalError",(function(t){return function(e){return i(t,this,arguments)}})),l("RangeError",(function(t){return function(e){return i(t,this,arguments)}})),l("ReferenceError",(function(t){return function(e){return i(t,this,arguments)}})),l("SyntaxError",(function(t){return function(e){return i(t,this,arguments)}})),l("TypeError",(function(t){return function(e){return i(t,this,arguments)}})),l("URIError",(function(t){return function(e){return i(t,this,arguments)}})),u("CompileError",(function(t){return function(e){return i(t,this,arguments)}})),u("LinkError",(function(t){return function(e){return i(t,this,arguments)}})),u("RuntimeError",(function(t){return function(e){return i(t,this,arguments)}}))},function(t,e,n){"use strict";var r=n(26),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},function(t,e,n){"use strict";var r=n(30),o=n(8),i=n(13),a=n(51),s=n(63),c=n(61),l=n(131),u=n(132),f=n(133),p=n(136),d=n(137),h=n(5),v=n(56);t.exports=function(t,e,n,m){var g=m?2:1,y=t.split("."),b=y[y.length-1],x=r.apply(null,y);if(x){var _=x.prototype;if(!v&&o(_,"cause")&&delete _.cause,!n)return x;var w=r("Error"),k=e((function(t,e){var n=f(m?e:t,void 0),r=m?new x(t):new x;return void 0!==n&&i(r,"message",n),d(r,k,r.stack,2),this&&a(_,this)&&u(r,this,k),arguments.length>g&&p(r,arguments[g]),r}));if(k.prototype=_,"Error"!==b?s?s(k,w):c(k,w,{name:!0}):h&&"stackTraceLimit"in x&&(l(k,x,"stackTraceLimit"),l(k,x,"prepareStackTrace")),c(k,x),!v)try{_.name!==b&&i(_,"name",b),_.constructor=k}catch(t){}return k}}},function(t,e,n){"use strict";var r=n(2),o=n(31);t.exports=function(t,e,n){try{return r(o(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},function(t,e,n){"use strict";var r=n(130),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw new i("Can't set "+o(t)+" as a prototype")}},function(t,e,n){"use strict";var r=n(6);t.exports=function(t){return r(t)||null===t}},function(t,e,n){"use strict";var r=n(15).f;t.exports=function(t,e,n){n in t||r(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},function(t,e,n){"use strict";var r=n(1),o=n(6),i=n(63);t.exports=function(t,e,n){var a,s;return i&&r(a=e.constructor)&&a!==n&&o(s=a.prototype)&&s!==n.prototype&&i(t,s),t}},function(t,e,n){"use strict";var r=n(94);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:r(t)}},function(t,e,n){"use strict";var r=n(135),o=n(1),i=n(16),a=n(32)("toStringTag"),s=Object,c="Arguments"===i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=s(t),a))?n:c?i(e):"Object"===(r=i(e))&&o(e.callee)?"Arguments":r}},function(t,e,n){"use strict";var r={};r[n(32)("toStringTag")]="z",t.exports="[object z]"===String(r)},function(t,e,n){"use strict";var r=n(6),o=n(13);t.exports=function(t,e){r(e)&&"cause"in e&&o(t,"cause",e.cause)}},function(t,e,n){"use strict";var r=n(13),o=n(138),i=n(139),a=Error.captureStackTrace;t.exports=function(t,e,n,s){i&&(a?a(t,e):r(t,"stack",o(n,s)))}},function(t,e,n){"use strict";var r=n(2),o=Error,i=r("".replace),a=String(new o("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(a);t.exports=function(t,e){if(c&&"string"==typeof t&&!o.prepareStackTrace)for(;e--;)t=i(t,s,"");return t}},function(t,e,n){"use strict";var r=n(3),o=n(27);t.exports=!r((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)}))},function(t,e,n){"use strict";var r=n(5),o=n(141),i=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(o(t)&&!a(t,"length").writable)throw new i("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},function(t,e,n){"use strict";var r=n(16);t.exports=Array.isArray||function(t){return"Array"===r(t)}},function(t,e,n){"use strict";var r=TypeError;t.exports=function(t){if(t>9007199254740991)throw r("Maximum allowed index exceeded");return t}},function(t,e,n){var r=n(64),o=n(144);t.exports=function t(e,n,i,a,s){var c=-1,l=e.length;for(i||(i=o),s||(s=[]);++c0&&i(u)?n>1?t(u,n-1,i,a,s):r(s,u):a||(s[s.length]=u)}return s}},function(t,e,n){var r=n(14),o=n(37),i=n(4),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},function(t,e,n){var r=n(12),o=n(11);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},function(t,e,n){var r=n(14),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[s]=n:delete t[s]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(149),o=n(205),i=n(45),a=n(4),s=n(215);t.exports=function(t){return"function"==typeof t?t:null==t?i:"object"==typeof t?a(t)?o(t[0],t[1]):r(t):s(t)}},function(t,e,n){var r=n(150),o=n(204),i=n(82);t.exports=function(t){var e=o(t);return 1==e.length&&e[0][2]?i(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(66),o=n(70);t.exports=function(t,e,n,i){var a=n.length,s=a,c=!i;if(null==t)return!s;for(t=Object(t);a--;){var l=n[a];if(c&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++a-1}},function(t,e,n){var r=n(18);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(17);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(17),o=n(38),i=n(40);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(68),o=n(162),i=n(39),a=n(69),s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,f=l.hasOwnProperty,p=RegExp("^"+u.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?p:s).test(a(t))}},function(t,e,n){var r,o=n(163),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var r=n(7)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(166),o=n(17),i=n(38);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(t,e,n){var r=n(167),o=n(168),i=n(169),a=n(170),s=n(171);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(72),o=n(227),i=n(232),a=n(73),s=n(233),c=n(41);t.exports=function(t,e,n){var l=-1,u=o,f=t.length,p=!0,d=[],h=d;if(n)p=!1,u=i;else if(f>=200){var v=e?null:s(t);if(v)return c(v);p=!1,u=a,h=new r}else h=e?[]:d;t:for(;++l-1}},function(t,e,n){var r=n(229),o=n(230),i=n(231);t.exports=function(t,e,n){return e==e?i(t,e,n):r(t,o,n)}},function(t,e){t.exports=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i]/;t.exports=function(t){var e,n=""+t,o=r.exec(n);if(!o)return n;var i="",a=0,s=0;for(a=o.index;a1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=e.startX+(e.x-e.startX)*n,o=e.startY+(e.y-e.startY)*n,e.method.call(e.scrollable,r,o),r===e.x&&o===e.y||t.requestAnimationFrame(d.bind(t,e))}function h(n,r,a){var c,l,u,f,p=i();n===e.body?(c=t,l=t.scrollX||t.pageXOffset,u=t.scrollY||t.pageYOffset,f=o.scroll):(c=n,l=n.scrollLeft,u=n.scrollTop,f=s),d({scrollable:c,method:f,startTime:p,startX:l,startY:u,x:r,y:a})}}}}()},function(t,e,n){"use strict";var r=n(24),o=n(35),i=n(36),a=n(140),s=n(142);r({target:"Array",proto:!0,arity:1,forced:n(3)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=o(this),n=i(e),r=arguments.length;s(n+r);for(var c=0;c79&&a<83||!i("reduce")},{reduce:function(t){var e=arguments.length;return o(this,t,e,e>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},function(t,e,n){"use strict";var r=n(25),o=n(6),i=n(50),a=n(102),s=n(104),c=n(32),l=TypeError,u=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,c=a(t,u);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!o(n)||i(n))return n;throw new l("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},function(t,e,n){"use strict";t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},function(t,e,n){"use strict";var r=n(31),o=n(48);t.exports=function(t,e){var n=t[e];return o(n)?void 0:r(n)}},function(t,e,n){"use strict";var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},function(t,e,n){"use strict";var r=n(25),o=n(1),i=n(6),a=TypeError;t.exports=function(t,e){var n,s;if("string"===e&&o(n=t.toString)&&!i(s=r(n,t)))return s;if(o(n=t.valueOf)&&!i(s=r(n,t)))return s;if("string"!==e&&o(n=t.toString)&&!i(s=r(n,t)))return s;throw new a("Can't convert object to primitive value")}},function(t,e,n){"use strict";var r=n(0),o=n(6),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},function(t,e,n){"use strict";var r=n(5),o=n(3);t.exports=r&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(t,e,n){"use strict";var r=n(5),o=n(8),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&a(i,"name").configurable);t.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},function(t,e,n){"use strict";var r=n(2),o=n(1),i=n(33),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},function(t,e,n){"use strict";var r,o,i,a=n(110),s=n(0),c=n(6),l=n(13),u=n(8),f=n(33),p=n(111),d=n(60),h=s.TypeError,v=s.WeakMap;if(a||f.state){var m=f.state||(f.state=new v);m.get=m.get,m.has=m.has,m.set=m.set,r=function(t,e){if(m.has(t))throw new h("Object already initialized");return e.facade=t,m.set(t,e),e},o=function(t){return m.get(t)||{}},i=function(t){return m.has(t)}}else{var g=p("state");d[g]=!0,r=function(t,e){if(u(t,g))throw new h("Object already initialized");return e.facade=t,l(t,g,e),e},o=function(t){return u(t,g)?t[g]:{}},i=function(t){return u(t,g)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=o(e)).type!==t)throw new h("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){"use strict";var r=n(0),o=n(1),i=r.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},function(t,e,n){"use strict";var r=n(55),o=n(57),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e,n){"use strict";var r=n(30),o=n(2),i=n(113),a=n(120),s=n(59),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(s(t)),n=a.f;return n?c(e,n(t)):e}},function(t,e,n){"use strict";var r=n(114),o=n(119).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){"use strict";var r=n(2),o=n(8),i=n(28),a=n(115).indexOf,s=n(60),c=r([].push);t.exports=function(t,e){var n,r=i(t),l=0,u=[];for(n in r)!o(s,n)&&o(r,n)&&c(u,n);for(;e.length>l;)o(r,n=e[l++])&&(~a(u,n)||c(u,n));return u}},function(t,e,n){"use strict";var r=n(28),o=n(116),i=n(36),a=function(t){return function(e,n,a){var s=r(e),c=i(s);if(0===c)return!t&&-1;var l,u=o(a,c);if(t&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((t||u in s)&&s[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e,n){"use strict";var r=n(62),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},function(t,e,n){"use strict";var r=Math.ceil,o=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?o:r)(e)}},function(t,e,n){"use strict";var r=n(62),o=Math.min;t.exports=function(t){var e=r(t);return e>0?o(e,9007199254740991):0}},function(t,e,n){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){"use strict";e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";var r=n(3),o=n(1),i=/#|\.prototype\./,a=function(t,e){var n=c[s(t)];return n===u||n!==l&&(o(e)?r(e):!!e)},s=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";t.exports=a},function(t,e,n){"use strict";var r=n(31),o=n(35),i=n(47),a=n(36),s=TypeError,c="Reduce of empty array with no initial value",l=function(t){return function(e,n,l,u){var f=o(e),p=i(f),d=a(f);if(r(n),0===d&&l<2)throw new s(c);var h=t?d-1:0,v=t?-1:1;if(l<2)for(;;){if(h in p){u=p[h],h+=v;break}if(h+=v,t?h<0:d<=h)throw new s(c)}for(;t?h>=0:d>h;h+=v)h in p&&(u=n(u,p[h],h,f));return u}};t.exports={left:l(!1),right:l(!0)}},function(t,e,n){"use strict";var r=n(3);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){return 1},1)}))}},function(t,e,n){"use strict";var r=n(0),o=n(16);t.exports="process"===o(r.process)},function(t,e,n){"use strict";var r=n(24),o=n(0),i=n(126),a=n(127),s=o.WebAssembly,c=7!==new Error("e",{cause:7}).cause,l=function(t,e){var n={};n[t]=a(t,e,c),r({global:!0,constructor:!0,arity:1,forced:c},n)},u=function(t,e){if(s&&s[t]){var n={};n[t]=a("WebAssembly."+t,e,c),r({target:"WebAssembly",stat:!0,constructor:!0,arity:1,forced:c},n)}};l("Error",(function(t){return function(e){return i(t,this,arguments)}})),l("EvalError",(function(t){return function(e){return i(t,this,arguments)}})),l("RangeError",(function(t){return function(e){return i(t,this,arguments)}})),l("ReferenceError",(function(t){return function(e){return i(t,this,arguments)}})),l("SyntaxError",(function(t){return function(e){return i(t,this,arguments)}})),l("TypeError",(function(t){return function(e){return i(t,this,arguments)}})),l("URIError",(function(t){return function(e){return i(t,this,arguments)}})),u("CompileError",(function(t){return function(e){return i(t,this,arguments)}})),u("LinkError",(function(t){return function(e){return i(t,this,arguments)}})),u("RuntimeError",(function(t){return function(e){return i(t,this,arguments)}}))},function(t,e,n){"use strict";var r=n(26),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},function(t,e,n){"use strict";var r=n(30),o=n(8),i=n(13),a=n(51),s=n(63),c=n(61),l=n(131),u=n(132),f=n(133),p=n(136),d=n(137),h=n(5),v=n(56);t.exports=function(t,e,n,m){var g=m?2:1,y=t.split("."),b=y[y.length-1],x=r.apply(null,y);if(x){var _=x.prototype;if(!v&&o(_,"cause")&&delete _.cause,!n)return x;var w=r("Error"),k=e((function(t,e){var n=f(m?e:t,void 0),r=m?new x(t):new x;return void 0!==n&&i(r,"message",n),d(r,k,r.stack,2),this&&a(_,this)&&u(r,this,k),arguments.length>g&&p(r,arguments[g]),r}));if(k.prototype=_,"Error"!==b?s?s(k,w):c(k,w,{name:!0}):h&&"stackTraceLimit"in x&&(l(k,x,"stackTraceLimit"),l(k,x,"prepareStackTrace")),c(k,x),!v)try{_.name!==b&&i(_,"name",b),_.constructor=k}catch(t){}return k}}},function(t,e,n){"use strict";var r=n(2),o=n(31);t.exports=function(t,e,n){try{return r(o(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},function(t,e,n){"use strict";var r=n(130),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw new i("Can't set "+o(t)+" as a prototype")}},function(t,e,n){"use strict";var r=n(6);t.exports=function(t){return r(t)||null===t}},function(t,e,n){"use strict";var r=n(15).f;t.exports=function(t,e,n){n in t||r(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},function(t,e,n){"use strict";var r=n(1),o=n(6),i=n(63);t.exports=function(t,e,n){var a,s;return i&&r(a=e.constructor)&&a!==n&&o(s=a.prototype)&&s!==n.prototype&&i(t,s),t}},function(t,e,n){"use strict";var r=n(94);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:r(t)}},function(t,e,n){"use strict";var r=n(135),o=n(1),i=n(16),a=n(32)("toStringTag"),s=Object,c="Arguments"===i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=s(t),a))?n:c?i(e):"Object"===(r=i(e))&&o(e.callee)?"Arguments":r}},function(t,e,n){"use strict";var r={};r[n(32)("toStringTag")]="z",t.exports="[object z]"===String(r)},function(t,e,n){"use strict";var r=n(6),o=n(13);t.exports=function(t,e){r(e)&&"cause"in e&&o(t,"cause",e.cause)}},function(t,e,n){"use strict";var r=n(13),o=n(138),i=n(139),a=Error.captureStackTrace;t.exports=function(t,e,n,s){i&&(a?a(t,e):r(t,"stack",o(n,s)))}},function(t,e,n){"use strict";var r=n(2),o=Error,i=r("".replace),a=String(new o("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(a);t.exports=function(t,e){if(c&&"string"==typeof t&&!o.prepareStackTrace)for(;e--;)t=i(t,s,"");return t}},function(t,e,n){"use strict";var r=n(3),o=n(27);t.exports=!r((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)}))},function(t,e,n){"use strict";var r=n(5),o=n(141),i=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(o(t)&&!a(t,"length").writable)throw new i("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},function(t,e,n){"use strict";var r=n(16);t.exports=Array.isArray||function(t){return"Array"===r(t)}},function(t,e,n){"use strict";var r=TypeError;t.exports=function(t){if(t>9007199254740991)throw r("Maximum allowed index exceeded");return t}},function(t,e,n){var r=n(64),o=n(144);t.exports=function t(e,n,i,a,s){var c=-1,l=e.length;for(i||(i=o),s||(s=[]);++c0&&i(u)?n>1?t(u,n-1,i,a,s):r(s,u):a||(s[s.length]=u)}return s}},function(t,e,n){var r=n(14),o=n(37),i=n(4),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},function(t,e,n){var r=n(12),o=n(11);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},function(t,e,n){var r=n(14),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[s]=n:delete t[s]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(149),o=n(205),i=n(45),a=n(4),s=n(215);t.exports=function(t){return"function"==typeof t?t:null==t?i:"object"==typeof t?a(t)?o(t[0],t[1]):r(t):s(t)}},function(t,e,n){var r=n(150),o=n(204),i=n(82);t.exports=function(t){var e=o(t);return 1==e.length&&e[0][2]?i(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(66),o=n(70);t.exports=function(t,e,n,i){var a=n.length,s=a,c=!i;if(null==t)return!s;for(t=Object(t);a--;){var l=n[a];if(c&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++a-1}},function(t,e,n){var r=n(18);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(17);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(17),o=n(38),i=n(40);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(68),o=n(162),i=n(39),a=n(69),s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,f=l.hasOwnProperty,p=RegExp("^"+u.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?p:s).test(a(t))}},function(t,e,n){var r,o=n(163),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var r=n(7)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(166),o=n(17),i=n(38);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(t,e,n){var r=n(167),o=n(168),i=n(169),a=n(170),s=n(171);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(72),o=n(227),i=n(232),a=n(73),s=n(233),c=n(41);t.exports=function(t,e,n){var l=-1,u=o,f=t.length,p=!0,d=[],h=d;if(n)p=!1,u=i;else if(f>=200){var v=e?null:s(t);if(v)return c(v);p=!1,u=a,h=new r}else h=e?[]:d;t:for(;++l-1}},function(t,e,n){var r=n(229),o=n(230),i=n(231);t.exports=function(t,e,n){return e==e?i(t,e,n):r(t,o,n)}},function(t,e){t.exports=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i=0&&Math.floor(e)===e&&isFinite(t)}function v(t){return a(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function m(t){return null==t?"":Array.isArray(t)||p(t)&&t.toString===f?JSON.stringify(t,g,2):String(t)}function g(t,e){return e&&e.__v_isRef?e.value:e}function y(t){var e=parseFloat(t);return isNaN(e)?t:e}function b(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(r,1)}}var w=Object.prototype.hasOwnProperty;function k(t,e){return w.call(t,e)}function C(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var P=/-(\w)/g,S=C((function(t){return t.replace(P,(function(t,e){return e?e.toUpperCase():""}))})),O=C((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),$=/\B([A-Z])/g,E=C((function(t){return t.replace($,"-$1").toLowerCase()}));var j=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function T(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function A(t,e){for(var n in e)t[n]=e[n];return t}function L(t){for(var e={},n=0;n0,Z=Y&&Y.indexOf("edge/")>0;Y&&Y.indexOf("android");var tt=Y&&/iphone|ipad|ipod|ios/.test(Y);Y&&/chrome\/\d+/.test(Y),Y&&/phantomjs/.test(Y);var et,nt=Y&&Y.match(/firefox\/(\d+)/),rt={}.watch,ot=!1;if(X)try{var it={};Object.defineProperty(it,"passive",{get:function(){ot=!0}}),window.addEventListener("test-passive",null,it)}catch(t){}var at=function(){return void 0===et&&(et=!X&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),et},st=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ct(t){return"function"==typeof t&&/native code/.test(t.toString())}var lt,ut="undefined"!=typeof Symbol&&ct(Symbol)&&"undefined"!=typeof Reflect&&ct(Reflect.ownKeys);lt="undefined"!=typeof Set&&ct(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ft=null;function pt(t){void 0===t&&(t=null),t||ft&&ft._scope.off(),ft=t,t&&t._scope.on()}var dt=function(){function t(t,e,n,r,o,i,a,s){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,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=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),ht=function(t){void 0===t&&(t="");var e=new dt;return e.text=t,e.isComment=!0,e};function vt(t){return new dt(void 0,void 0,void 0,String(t))}function mt(t){var e=new dt(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}"function"==typeof SuppressedError&&SuppressedError;var gt=0,yt=[],bt=function(){function t(){this._pending=!1,this.id=gt++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,yt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));for(var n=0,r=e.length;n0&&(Yt((l=t(l,"".concat(n||"","_").concat(r)))[0])&&Yt(f)&&(p[u]=vt(f.text+l[0].text),l.shift()),p.push.apply(p,l)):c(l)?Yt(f)?p[u]=vt(f.text+l):""!==l&&p.push(vt(l)):Yt(l)&&Yt(f)?p[u]=vt(f.text+l.text):(s(e._isVList)&&a(l.tag)&&i(l.key)&&a(n)&&(l.key="__vlist".concat(n,"_").concat(r,"__")),p.push(l)));return p}(t):void 0}function Yt(t){return a(t)&&a(t.text)&&!1===t.isComment}function Jt(t,e){var n,r,i,s,c=null;if(o(t)||"string"==typeof t)for(c=new Array(t.length),n=0,r=t.length;n0,s=e?!!e.$stable:!a,c=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&o&&o!==r&&c===o.$key&&!a&&!o.$hasNormal)return o;for(var l in i={},e)e[l]&&"$"!==l[0]&&(i[l]=me(t,n,l,e[l]))}else i={};for(var u in n)u in i||(i[u]=ge(n,u));return e&&Object.isExtensible(e)&&(e._normalized=i),K(i,"$stable",s),K(i,"$key",c),K(i,"$hasNormal",a),i}function me(t,e,n,r){var i=function(){var e=ft;pt(t);var n=arguments.length?r.apply(null,arguments):r({}),i=(n=n&&"object"==typeof n&&!o(n)?[n]:Xt(n))&&n[0];return pt(e),n&&(!i||1===n.length&&i.isComment&&!he(i))?void 0:n};return r.proxy&&Object.defineProperty(e,n,{get:i,enumerable:!0,configurable:!0}),i}function ge(t,e){return function(){return t[e]}}function ye(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};K(e,"_v_attr_proxy",!0),be(e,t.$attrs,r,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||be(t._listenersProxy={},t.$listeners,r,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||_e(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:j(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach((function(n){return Ft(t,e,n)}))}}}function be(t,e,n,r,o){var i=!1;for(var a in e)a in t?e[a]!==n[a]&&(i=!0):(i=!0,xe(t,a,r,o));for(var a in t)a in e||(i=!0,delete t[a]);return i}function xe(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function _e(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var we=null;function ke(t,e){return(t.__esModule||ut&&"Module"===t[Symbol.toStringTag])&&(t=t.default),u(t)?e.extend(t):t}function Ce(t){if(o(t))for(var e=0;edocument.createEvent("Event").timeStamp&&(ln=function(){return un.now()})}var fn=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function pn(){var t,e;for(cn=ln(),an=!0,en.sort(fn),sn=0;snsn&&en[n].id>t.id;)n--;en.splice(n+1,0,t)}else en.push(t);on||(on=!0,Ne(pn))}}function hn(t,e){if(t){for(var n=Object.create(null),r=ut?Reflect.ownKeys(t):Object.keys(t),o=0;o-1)if(i&&!k(o,"default"))a=!1;else if(""===a||a===E(t)){var c=Un(String,o.type);(c<0||s-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!d(t)&&t.test(e)}function Jn(t,e){var n=t.cache,r=t.keys,o=t._vnode,i=t.$vnode;for(var a in n){var s=n[a];if(s){var c=s.name;c&&!e(c)&&Qn(n,a,r,o)}}i.componentOptions.children=void 0}function Qn(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,_(n,e)}Wn.prototype._init=function(t){var e=this;e._uid=qn++,e._isVue=!0,e.__v_skip=!0,e._scope=new zt(!0),e._scope.parent=void 0,e._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=jn(Kn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Xe(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=pe(e._renderChildren,o),t.$scopedSlots=n?ve(t.$parent,n.data.scopedSlots,t.$slots):r,t._c=function(e,n,r,o){return Pe(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return Pe(t,e,n,r,o,!0)};var i=n&&n.data;At(t,"$attrs",i&&i.attrs||r,null,!0),At(t,"$listeners",e._parentListeners||r,null,!0)}(e),tn(e,"beforeCreate",void 0,!1),function(t){var e=hn(t.$options.inject,t);e&&($t(!1),Object.keys(e).forEach((function(n){At(t,n,e[n])})),$t(!0))}(e),Nn(e),function(t){var e=t.$options.provide;if(e){var n=l(e)?e.call(t):e;if(!u(n))return;for(var r=Vt(t),o=ut?Reflect.ownKeys(n):Object.keys(n),i=0;i1?T(n):n;for(var r=T(arguments,1),o='event handler for "'.concat(t,'"'),i=0,a=n.length;iparseInt(this.max)&&Qn(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Qn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Jn(t,(function(t){return Yn(e,t)}))})),this.$watch("exclude",(function(e){Jn(t,(function(t){return!Yn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Ce(t),n=e&&e.componentOptions;if(n){var r=Xn(n),o=this.include,i=this.exclude;if(o&&(!r||!Yn(o,r))||i&&r&&Yn(i,r))return e;var a=this.cache,s=this.keys,c=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;a[c]?(e.componentInstance=a[c].componentInstance,_(s,c),s.push(c)):(this.vnodeToCache=e,this.keyToCache=c),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return V}};Object.defineProperty(t,"config",e),t.util={warn:kn,extend:A,mergeOptions:jn,defineReactive:At},t.set=Lt,t.delete=Mt,t.nextTick=Ne,t.observable=function(t){return Tt(t),t},t.options=Object.create(null),B.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,A(t.options.components,tr),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=T(arguments,1);return n.unshift(this),l(t.install)?t.install.apply(t,n):l(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=jn(this.options,t),this}}(t),Gn(t),function(t){B.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&p(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&l(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Wn),Object.defineProperty(Wn.prototype,"$isServer",{get:at}),Object.defineProperty(Wn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Wn,"FunctionalRenderContext",{value:vn}),Wn.version="2.7.16";var er=b("style,class"),nr=b("input,textarea,option,select,progress"),rr=b("contenteditable,draggable,spellcheck"),or=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"),ar="http://www.w3.org/1999/xlink",sr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},cr=function(t){return sr(t)?t.slice(6,t.length):""},lr=function(t){return null==t||!1===t};function ur(t){for(var e=t.data,n=t,r=t;a(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=fr(r.data,e));for(;a(n=n.parent);)n&&n.data&&(e=fr(e,n.data));return function(t,e){if(a(t)||a(e))return pr(t,dr(e));return""}(e.staticClass,e.class)}function fr(t,e){return{staticClass:pr(t.staticClass,e.staticClass),class:a(t.class)?[t.class,e.class]:e.class}}function pr(t,e){return t?e?t+" "+e:t:e||""}function dr(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r-1?Ir(t,e,n):ir(e)?lr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):rr(e)?t.setAttribute(e,function(t,e){return lr(e)||"false"===e?"false":"contenteditable"===t&&or(e)?e:"true"}(e,n)):sr(e)?lr(n)?t.removeAttributeNS(ar,cr(e)):t.setAttributeNS(ar,e,n):Ir(t,e,n)}function Ir(t,e,n){if(lr(n))t.removeAttribute(e);else{if(J&&!Q&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Dr={create:Rr,update:Rr};function Nr(t,e){var n=e.elm,r=e.data,o=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(o)||i(o.staticClass)&&i(o.class)))){var s=ur(e),c=n._transitionClasses;a(c)&&(s=pr(s,dr(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Fr,Br={create:Nr,update:Nr};function zr(t,e,n){var r=Fr;return function o(){var i=e.apply(null,arguments);null!==i&&qr(t,o,n,r)}}var Vr=Te&&!(nt&&Number(nt[1])<=53);function Hr(t,e,n,r){if(Vr){var o=cn,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}Fr.addEventListener(t,e,ot?{capture:n,passive:r}:n)}function qr(t,e,n,r){(r||Fr).removeEventListener(t,e._wrapper||e,n)}function Kr(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Fr=e.elm||t.elm,function(t){if(a(t.__r)){var e=J?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}a(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),Kt(n,r,Hr,qr,zr,e.context),Fr=void 0}}var Wr,Gr={create:Kr,update:Kr,destroy:function(t){return Kr(t,Cr)}};function Xr(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,o=e.elm,c=t.data.domProps||{},l=e.data.domProps||{};for(n in(a(l.__ob__)||s(l._v_attr_proxy))&&(l=e.data.domProps=A({},l)),c)n in l||(o[n]="");for(n in l){if(r=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===c[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=r;var u=i(r)?"":String(r);Yr(o,u)&&(o.value=u)}else if("innerHTML"===n&&mr(o.tagName)&&i(o.innerHTML)){(Wr=Wr||document.createElement("div")).innerHTML="".concat(r,"");for(var f=Wr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;f.firstChild;)o.appendChild(f.firstChild)}else if(r!==c[n])try{o[n]=r}catch(t){}}}}function Yr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(a(r)){if(r.number)return y(n)!==y(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Jr={create:Xr,update:Xr},Qr=C((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Zr(t){var e=to(t.style);return t.staticStyle?A(t.staticStyle,e):e}function to(t){return Array.isArray(t)?L(t):"string"==typeof t?Qr(t):t}var eo,no=/^--/,ro=/\s*!important$/,oo=function(t,e,n){if(no.test(e))t.style.setProperty(e,n);else if(ro.test(n))t.style.setProperty(E(e),n.replace(ro,""),"important");else{var r=ao(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(lo).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function fo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(lo).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function po(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&A(e,ho(t.name||"v")),A(e,t),e}return"string"==typeof t?ho(t):void 0}}var ho=C((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),vo=X&&!Q,mo="transition",go="transitionend",yo="animation",bo="animationend";vo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(mo="WebkitTransition",go="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(yo="WebkitAnimation",bo="webkitAnimationEnd"));var xo=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function _o(t){xo((function(){xo(t)}))}function wo(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),uo(t,e))}function ko(t,e){t._transitionClasses&&_(t._transitionClasses,e),fo(t,e)}function Co(t,e,n){var r=So(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s="transition"===o?go:bo,c=0,l=function(){t.removeEventListener(s,u),n()},u=function(e){e.target===t&&++c>=a&&l()};setTimeout((function(){c0&&(n="transition",u=a,f=i.length):"animation"===e?l>0&&(n="animation",u=l,f=c.length):f=(n=(u=Math.max(a,l))>0?a>l?"transition":"animation":null)?"transition"===n?i.length:c.length:0,{type:n,timeout:u,propCount:f,hasTransform:"transition"===n&&Po.test(r[mo+"Property"])}}function Oo(t,e){for(;t.length1}function Lo(t,e){!0!==e.data.show&&Eo(e)}var Mo=function(t){var e,n,r={},l=t.modules,u=t.nodeOps;for(e=0;eh?x(t,i(n[g+1])?null:n[g+1].elm,n,d,g,r):d>g&&w(e,f,h)}(f,v,g,n,l):a(g)?(a(t.text)&&u.setTextContent(f,""),x(f,null,g,0,g.length-1,n)):a(v)?w(v,0,v.length-1):a(t.text)&&u.setTextContent(f,""):t.text!==e.text&&u.setTextContent(f,e.text),a(h)&&a(d=h.hook)&&a(d=d.postpatch)&&d(t,e)}}}function S(t,e,n){if(s(n)&&a(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==i&&(a.selected=i);else if(I(No(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function Do(t,e){return e.every((function(e){return!I(e,t)}))}function No(t){return"_value"in t?t._value:t.value}function Fo(t){t.target.composing=!0}function Bo(t){t.target.composing&&(t.target.composing=!1,zo(t.target,"input"))}function zo(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Vo(t){return!t.componentInstance||t.data&&t.data.transition?t:Vo(t.componentInstance._vnode)}var Ho={model:Ro,show:{bind:function(t,e,n){var r=e.value,o=(n=Vo(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,Eo(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Vo(n)).data&&n.data.transition?(n.data.show=!0,r?Eo(n,(function(){t.style.display=t.__vOriginalDisplay})):jo(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},qo={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 Ko(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ko(Ce(e.children)):t}function Wo(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[S(r)]=o[r];return e}function Go(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Xo=function(t){return t.tag||he(t)},Yo=function(t){return"show"===t.name},Jo={name:"transition",props:qo,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Xo)).length){0;var r=this.mode;0;var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=Ko(o);if(!i)return o;if(this._leaving)return Go(t,o);var a="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?a+"comment":a+i.tag:c(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var s=(i.data||(i.data={})).transition=Wo(this),l=this._vnode,u=Ko(l);if(i.data.directives&&i.data.directives.some(Yo)&&(i.data.show=!0),u&&u.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,u)&&!he(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var f=u.data.transition=A({},s);if("out-in"===r)return this._leaving=!0,Wt(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Go(t,o);if("in-out"===r){if(he(i))return l;var p,d=function(){p()};Wt(s,"afterEnter",d),Wt(s,"enterCancelled",d),Wt(f,"delayLeave",(function(t){p=t}))}}return o}}},Qo=A({tag:String,moveClass:String},qo);function Zo(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function ti(t){t.data.newPos=t.elm.getBoundingClientRect()}function ei(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}delete Qo.mode;var ni={Transition:Jo,TransitionGroup:{props:Qo,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Je(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=Wo(this),s=0;s-1?yr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:yr[t]=/HTMLUnknownElement/.test(e.toString())},A(Wn.options.directives,Ho),A(Wn.options.components,ni),Wn.prototype.__patch__=X?Mo:M,Wn.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=ht),tn(t,"beforeMount"),r=function(){t._update(t._render(),n)},new qe(t,r,M,{before:function(){t._isMounted&&!t._isDestroyed&&tn(t,"beforeUpdate")}},!0),n=!1;var o=t._preWatchers;if(o)for(var i=0;i=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(o.path||""),l=e&&e.path||"/",u=c.path?ki(c.path,l,n||o.append):l,f=function(t,e,n){void 0===e&&(e={});var r,o=n||ui;try{r=o(t||"")}catch(t){r={}}for(var i in e){var a=e[i];r[i]=Array.isArray(a)?a.map(li):li(a)}return r}(c.query,o.query,r&&r.options.parseQuery),p=o.hash||c.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:u,query:f,hash:p}}var Hi,qi=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(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),i=o.location,a=o.route,s=o.href,c={},l=n.options.linkActiveClass,u=n.options.linkExactActiveClass,f=null==l?"router-link-active":l,p=null==u?"router-link-exact-active":u,d=null==this.activeClass?f:this.activeClass,h=null==this.exactActiveClass?p:this.exactActiveClass,v=a.redirectedFrom?di(null,Vi(a.redirectedFrom),null,n):a;c[h]=yi(r,v,this.exactPath),c[d]=this.exact||this.exactPath?c[h]:function(t,e){return 0===t.path.replace(pi,"/").indexOf(e.path.replace(pi,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,v);var m=c[h]?this.ariaCurrentValue:null,g=function(t){Wi(t)&&(e.replace?n.replace(i,qi):n.push(i,qi))},y={click:Wi};Array.isArray(this.event)?this.event.forEach((function(t){y[t]=g})):y[this.event]=g;var b={class:c},x=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:a,navigate:g,isActive:c[d],isExactActive:c[h]});if(x){if(1===x.length)return x[0];if(x.length>1||!x.length)return 0===x.length?t():t("span",{},x)}if("a"===this.tag)b.on=y,b.attrs={href:s,"aria-current":m};else{var _=function t(e){var n;if(e)for(var r=0;r-1&&(s.params[p]=n.params[p]);return s.path=zi(u.path,s.params),c(u,s,a)}if(s.path){s.params={};for(var d=0;d-1}function Pa(t,e){return Ca(t)&&t._isRouter&&(null==e||t.type===e)}function Sa(t,e,n){var r=function(o){o>=t.length?n():t[o]?e(t[o],(function(){r(o+1)})):r(o+1)};r(0)}function Oa(t){return function(e,n,r){var o=!1,i=0,a=null;$a(t,(function(t,e,n,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var c,l=Ta((function(e){var o;((o=e).__esModule||ja&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:Hi.extend(e),n.components[s]=e,--i<=0&&r()})),u=Ta((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=Ca(t)?t:new Error(e),r(a))}));try{c=t(l,u)}catch(t){u(t)}if(c)if("function"==typeof c.then)c.then(l,u);else{var f=c.component;f&&"function"==typeof f.then&&f.then(l,u)}}})),o||r()}}function $a(t,e){return Ea(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Ea(t){return Array.prototype.concat.apply([],t)}var ja="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ta(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var Aa=function(t,e){this.router=t,this.base=function(t){if(!t)if(Gi){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=vi,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function La(t,e,n,r){var o=$a(t,(function(t,r,o,i){var a=function(t,e){"function"!=typeof t&&(t=Hi.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,r,o,i)})):n(a,r,o,i)}));return Ea(r?o.reverse():o)}function Ma(t,e){if(e)return function(){return t.apply(e,arguments)}}Aa.prototype.listen=function(t){this.cb=t},Aa.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Aa.prototype.onError=function(t){this.errorCbs.push(t)},Aa.prototype.transitionTo=function(t,e,n){var r,o=this;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(r,(function(){o.updateRoute(r),e&&e(r),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(r,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(r)})))}),(function(t){n&&n(t),t&&!o.ready&&(Pa(t,ba.redirected)&&i===vi||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},Aa.prototype.confirmTransition=function(t,e,n){var r=this,o=this.current;this.pending=t;var i,a,s=function(t){!Pa(t)&&Ca(t)&&(r.errorCbs.length?r.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},c=t.matched.length-1,l=o.matched.length-1;if(yi(t,o)&&c===l&&t.matched[c]===o.matched[l])return this.ensureURL(),t.hash&&aa(this.router,o,t,!1),s(((a=wa(i=o,t,ba.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",a));var u=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,r=va&&n;r&&this.listeners.push(ia());var o=function(){var n=t.current,o=Ua(t.base);t.current===vi&&o===t._startLocation||t.transitionTo(o,(function(t){r&&aa(e,t,n,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){ma(Ci(r.base+t.fullPath)),aa(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){ya(Ci(r.base+t.fullPath)),aa(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(Ua(this.base)!==this.current.fullPath){var e=Ci(this.base+this.current.fullPath);t?ma(e):ya(e)}},e.prototype.getCurrentLocation=function(){return Ua(this.base)},e}(Aa);function Ua(t){var e=window.location.pathname,n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(Ci(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Ia=function(t){function e(e,n,r){t.call(this,e,n),r&&function(t){var e=Ua(t);if(!/^\/#/.test(e))return window.location.replace(Ci(t+"/#"+e)),!0}(this.base)||Da()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=va&&e;n&&this.listeners.push(ia());var r=function(){var e=t.current;Da()&&t.transitionTo(Na(),(function(r){n&&aa(t.router,r,e,!0),va||za(r.fullPath)}))},o=va?"popstate":"hashchange";window.addEventListener(o,r),this.listeners.push((function(){window.removeEventListener(o,r)}))}},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){Ba(t.fullPath),aa(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){za(t.fullPath),aa(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Na()!==e&&(t?Ba(e):za(e))},e.prototype.getCurrentLocation=function(){return Na()},e}(Aa);function Da(){var t=Na();return"/"===t.charAt(0)||(za("/"+t),!1)}function Na(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Fa(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function Ba(t){va?ma(Fa(t)):window.location.hash=t}function za(t){va?ya(Fa(t)):window.location.replace(Fa(t))}var Va=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){var t=e.current;e.index=n,e.updateRoute(r),e.router.afterHooks.forEach((function(e){e&&e(r,t)}))}),(function(t){Pa(t,ba.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Aa),Ha=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Ji(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!va&&!1!==t.fallback,this.fallback&&(e="hash"),Gi||(e="abstract"),this.mode=e,e){case"history":this.history=new Ra(this,t.base);break;case"hash":this.history=new Ia(this,t.base,this.fallback);break;case"abstract":this.history=new Va(this,t.base);break;default:0}},qa={currentRoute:{configurable:!0}};Ha.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},qa.currentRoute.get=function(){return this.history&&this.history.current},Ha.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof Ra||n instanceof Ia){var r=function(t){n.setupListeners(),function(t){var r=n.current,o=e.options.scrollBehavior;va&&o&&"fullPath"in t&&aa(e,t,r,!1)}(t)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ha.prototype.beforeEach=function(t){return Wa(this.beforeHooks,t)},Ha.prototype.beforeResolve=function(t){return Wa(this.resolveHooks,t)},Ha.prototype.afterEach=function(t){return Wa(this.afterHooks,t)},Ha.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ha.prototype.onError=function(t){this.history.onError(t)},Ha.prototype.push=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.push(t,e,n)}));this.history.push(t,e,n)},Ha.prototype.replace=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.replace(t,e,n)}));this.history.replace(t,e,n)},Ha.prototype.go=function(t){this.history.go(t)},Ha.prototype.back=function(){this.go(-1)},Ha.prototype.forward=function(){this.go(1)},Ha.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ha.prototype.resolve=function(t,e,n){var r=Vi(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?Ci(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}},Ha.prototype.getRoutes=function(){return this.matcher.getRoutes()},Ha.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==vi&&this.history.transitionTo(this.history.getCurrentLocation())},Ha.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==vi&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ha.prototype,qa);var Ka=Ha;function Wa(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Ha.install=function t(e){if(!t.installed||Hi!==e){t.installed=!0,Hi=e;var n=function(t){return void 0!==t},r=function(t,e){var r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.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(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",_i),e.component("RouterLink",Ki);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Ha.version="3.6.5",Ha.isNavigationFailure=Pa,Ha.NavigationFailureType=ba,Ha.START_LOCATION=vi,Gi&&window.Vue&&window.Vue.use(Ha);n(98);n(125),n(91);var Ga={"components/AlgoliaSearchBox":()=>Promise.all([n.e(0),n.e(11)]).then(n.bind(null,306)),"components/DropdownLink":()=>Promise.all([n.e(0),n.e(12)]).then(n.bind(null,260)),"components/DropdownTransition":()=>Promise.all([n.e(0),n.e(18)]).then(n.bind(null,248)),"components/Home":()=>Promise.all([n.e(0),n.e(15)]).then(n.bind(null,284)),"components/NavLink":()=>n.e(20).then(n.bind(null,247)),"components/NavLinks":()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,271)),"components/Navbar":()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,302)),"components/Page":()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,285)),"components/PageEdit":()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,273)),"components/PageNav":()=>Promise.all([n.e(0),n.e(13)]).then(n.bind(null,274)),"components/Sidebar":()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,286)),"components/SidebarButton":()=>Promise.all([n.e(0),n.e(19)]).then(n.bind(null,287)),"components/SidebarGroup":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,272)),"components/SidebarLink":()=>Promise.all([n.e(0),n.e(17)]).then(n.bind(null,261)),"components/SidebarLinks":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,259)),"global-components/Badge":()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,309)),"layouts/404":()=>n.e(5).then(n.bind(null,307)),"layouts/Layout":()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,308)),NotFound:()=>n.e(5).then(n.bind(null,307)),Layout:()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,308))},Xa={"v-628bc8f0":()=>n.e(22).then(n.bind(null,310)),"v-b8b65022":()=>n.e(24).then(n.bind(null,311)),"v-1cbafd5b":()=>n.e(23).then(n.bind(null,312)),"v-386691fe":()=>n.e(25).then(n.bind(null,313)),"v-b3e2f7dc":()=>n.e(27).then(n.bind(null,314)),"v-7cb2e029":()=>n.e(21).then(n.bind(null,315)),"v-0359c01b":()=>n.e(26).then(n.bind(null,316)),"v-3a964646":()=>n.e(28).then(n.bind(null,317)),"v-d80157e0":()=>n.e(29).then(n.bind(null,318)),"v-0648babb":()=>n.e(30).then(n.bind(null,319)),"v-2d5f850a":()=>n.e(31).then(n.bind(null,320)),"v-f8ff2a8a":()=>n.e(32).then(n.bind(null,321)),"v-1d0a5d05":()=>n.e(33).then(n.bind(null,322)),"v-37d6db67":()=>n.e(35).then(n.bind(null,323)),"v-3d14d060":()=>n.e(34).then(n.bind(null,324)),"v-0606cc70":()=>n.e(36).then(n.bind(null,325)),"v-fb520162":()=>n.e(14).then(n.bind(null,326)),"v-ed86e68a":()=>n.e(37).then(n.bind(null,327)),"v-a1dfbd8a":()=>n.e(38).then(n.bind(null,328)),"v-7cda367b":()=>n.e(39).then(n.bind(null,329)),"v-624343f9":()=>n.e(40).then(n.bind(null,330)),"v-97db1d60":()=>n.e(41).then(n.bind(null,331)),"v-49812bde":()=>n.e(42).then(n.bind(null,332)),"v-9436f116":()=>n.e(44).then(n.bind(null,333)),"v-81282f8a":()=>n.e(43).then(n.bind(null,334)),"v-3d32147b":()=>n.e(45).then(n.bind(null,335)),"v-43c25037":()=>n.e(46).then(n.bind(null,336)),"v-3098292d":()=>n.e(47).then(n.bind(null,337)),"v-43d3637b":()=>n.e(48).then(n.bind(null,338)),"v-67061e4a":()=>n.e(49).then(n.bind(null,339)),"v-253dcc3b":()=>n.e(51).then(n.bind(null,340)),"v-87d9c7de":()=>n.e(50).then(n.bind(null,341)),"v-4e564c1b":()=>n.e(52).then(n.bind(null,342)),"v-5ab843d6":()=>n.e(53).then(n.bind(null,343)),"v-32163c7b":()=>n.e(54).then(n.bind(null,344)),"v-53650bf2":()=>n.e(55).then(n.bind(null,345)),"v-fb9fdb00":()=>n.e(56).then(n.bind(null,346))};function Ya(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const Ja=/-(\w)/g,Qa=Ya(t=>t.replace(Ja,(t,e)=>e?e.toUpperCase():"")),Za=/\B([A-Z])/g,ts=Ya(t=>t.replace(Za,"-$1").toLowerCase()),es=Ya(t=>t.charAt(0).toUpperCase()+t.slice(1));function ns(t,e){if(!e)return;if(t(e))return t(e);return e.includes("-")?t(es(Qa(e))):t(es(e))||t(ts(e))}const rs=Object.assign({},Ga,Xa),os=t=>rs[t],is=t=>Xa[t],as=t=>Ga[t],ss=t=>Wn.component(t);function cs(t){return ns(is,t)}function ls(t){return ns(as,t)}function us(t){return ns(os,t)}function fs(t){return ns(ss,t)}function ps(...t){return Promise.all(t.filter(t=>t).map(async t=>{if(!fs(t)&&us(t)){const e=await us(t)();Wn.component(t,e.default)}}))}function ds(t,e){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[t]=e)}var hs=n(88),vs=n.n(hs),ms=n(89),gs=n.n(ms),ys={created(){if(this.siteMeta=this.$site.headTags.filter(([t])=>"meta"===t).map(([t,e])=>e),this.$ssrContext){const e=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(t=e)?t.map(t=>{let e="{e+=` ${n}="${gs()(t[n])}"`}),e+">"}).join("\n "):"",this.$ssrContext.canonicalLink=xs(this.$canonicalUrl)}var t},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const t=this.getMergedMetaTags();this.currentMetaTags=_s(t,this.currentMetaTags)},getMergedMetaTags(){const t=this.$page.frontmatter.meta||[];return vs()([{name:"description",content:this.$description}],t,this.siteMeta,ws)},updateCanonicalLink(){bs(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",xs(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){_s(null,this.currentMetaTags),bs()}};function bs(){const t=document.querySelector("link[rel='canonical']");t&&t.remove()}function xs(t=""){return t?``:""}function _s(t,e){if(e&&[...e].filter(t=>t.parentNode===document.head).forEach(t=>document.head.removeChild(t)),t)return t.map(t=>{const e=document.createElement("meta");return Object.keys(t).forEach(n=>{e.setAttribute(n,t[n])}),document.head.appendChild(e),e})}function ws(t){for(const e of["name","property","itemprop"])if(t.hasOwnProperty(e))return t[e]+e;return JSON.stringify(t)}var ks=n(22),Cs=n.n(ks),Ps={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:Cs()((function(){this.setActiveHash()}),300),setActiveHash(){const t=[].slice.call(document.querySelectorAll(".sidebar-link")),e=[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(t=>t.hash===e.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),o=window.innerHeight+n;for(let t=0;t=i.parentElement.offsetTop+10&&(!a||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Ss=n(23),Os=n.n(Ss),$s={mounted(){Os.a.configure({showSpinner:!1}),this.$router.beforeEach((t,e,n)=>{t.path===e.path||Wn.component(t.name)||Os.a.start(),n()}),this.$router.afterEach(()=>{Os.a.done(),this.isSidebarOpen=!1})}},Es=n(90),js=n.n(Es),Ts={mounted(){js.a.polyfill()}};n(236),n(237);class As{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:t="",duration:e=3e3}){let n=document.createElement("div");n.className="message move-in",n.innerHTML=`\n \n \n \n
    ${t}
    \n `,this.containerEl.appendChild(n),e>0&&setTimeout(()=>{this.close(n)},e)}close(t){t.className=t.className.replace("move-in",""),t.className+="move-out",t.addEventListener("animationend",()=>{t.remove()})}}var Ls=[ys,Ps,$s,Ts,{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(t=>{document.querySelectorAll(t).forEach(this.generateCopyButton)})},1e3)},generateCopyButton(t){if(t.classList.contains("codecopy-enabled"))return;const e=document.createElement("i");e.className="code-copy",e.innerHTML='',e.title="Click to Copy to Clipboard",e.addEventListener("click",()=>{this.copyToClipboard(t.innerText)}),t.appendChild(e),t.classList.add("codecopy-enabled")},copyToClipboard(t){const e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e);const n=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);e.select(),document.execCommand("copy");(new As).show({text:"Copy successfully and then paste it for use.",duration:3e3}),document.body.removeChild(e),n&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(n))}}}],Ms={name:"GlobalLayout",computed:{layout(){const t=this.getLayout();return ds("layout",t),Wn.component(t)}},methods:{getLayout(){if(this.$page.path){const t=this.$page.frontmatter.layout;return t&&(this.$vuepress.getLayoutAsyncComponent(t)||this.$vuepress.getVueComponent(t))?t:"Layout"}return"NotFound"}}},Rs=n(10),Us=Object(Rs.a)(Ms,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(t,e,n){switch(e){case"components":t[e]||(t[e]={}),Object.assign(t[e],n);break;case"mixins":t[e]||(t[e]=[]),t[e].push(...n);break;default:throw new Error("Unknown option name.")}}(Us,"mixins",Ls);const Is=[{name:"v-628bc8f0",path:"/1.x/advanced/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-628bc8f0").then(n)}},{path:"/1.x/advanced/index.html",redirect:"/1.x/advanced/"},{name:"v-b8b65022",path:"/1.x/advanced/helpers.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-b8b65022").then(n)}},{name:"v-1cbafd5b",path:"/1.x/advanced/events.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-1cbafd5b").then(n)}},{name:"v-386691fe",path:"/1.x/advanced/override-core-model.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-386691fe").then(n)}},{name:"v-b3e2f7dc",path:"/1.x/api/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-b3e2f7dc").then(n)}},{path:"/1.x/api/index.html",redirect:"/1.x/api/"},{name:"v-7cb2e029",path:"/1.x/advanced/security-practice.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-7cb2e029").then(n)}},{name:"v-0359c01b",path:"/1.x/advanced/render-event.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-0359c01b").then(n)}},{name:"v-3a964646",path:"/1.x/api/getting-started-with-the-api.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-3a964646").then(n)}},{name:"v-d80157e0",path:"/1.x/architecture/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-d80157e0").then(n)}},{path:"/1.x/architecture/index.html",redirect:"/1.x/architecture/"},{name:"v-0648babb",path:"/1.x/architecture/modular-design.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-0648babb").then(n)}},{name:"v-2d5f850a",path:"/1.x/architecture/packages.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-2d5f850a").then(n)}},{name:"v-f8ff2a8a",path:"/1.x/architecture/repository-pattern.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-f8ff2a8a").then(n)}},{name:"v-1d0a5d05",path:"/1.x/architecture/theme.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-1d0a5d05").then(n)}},{name:"v-37d6db67",path:"/1.x/custom-attributes/custom-attribute.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-37d6db67").then(n)}},{name:"v-3d14d060",path:"/1.x/custom-attributes/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-3d14d060").then(n)}},{path:"/1.x/custom-attributes/index.html",redirect:"/1.x/custom-attributes/"},{name:"v-0606cc70",path:"/1.x/introduction/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-0606cc70").then(n)}},{path:"/1.x/introduction/index.html",redirect:"/1.x/introduction/"},{name:"v-fb520162",path:"/1.x/custom-attributes/uses.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-fb520162").then(n)}},{name:"v-ed86e68a",path:"/1.x/introduction/docker.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-ed86e68a").then(n)}},{name:"v-a1dfbd8a",path:"/1.x/introduction/installation.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-a1dfbd8a").then(n)}},{name:"v-7cda367b",path:"/1.x/introduction/requirements.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-7cda367b").then(n)}},{name:"v-624343f9",path:"/1.x/introduction/upgrade-to-latest-bagisto.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-624343f9").then(n)}},{name:"v-97db1d60",path:"/1.x/packages/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-97db1d60").then(n)}},{path:"/1.x/packages/index.html",redirect:"/1.x/packages/"},{name:"v-49812bde",path:"/1.x/packages/add-menu-in-admin.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-49812bde").then(n)}},{name:"v-9436f116",path:"/1.x/packages/controllers.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-9436f116").then(n)}},{name:"v-81282f8a",path:"/1.x/packages/assets.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-81282f8a").then(n)}},{name:"v-3d32147b",path:"/1.x/packages/create-acl.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-3d32147b").then(n)}},{name:"v-43c25037",path:"/1.x/packages/create-migrations.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-43c25037").then(n)}},{name:"v-3098292d",path:"/1.x/packages/create-models.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-3098292d").then(n)}},{name:"v-43d3637b",path:"/1.x/packages/create-package.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-43d3637b").then(n)}},{name:"v-67061e4a",path:"/1.x/packages/datagrid.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-67061e4a").then(n)}},{name:"v-253dcc3b",path:"/1.x/packages/localization.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-253dcc3b").then(n)}},{name:"v-87d9c7de",path:"/1.x/packages/layouts.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-87d9c7de").then(n)}},{name:"v-4e564c1b",path:"/1.x/packages/routes.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-4e564c1b").then(n)}},{name:"v-5ab843d6",path:"/1.x/packages/store-data-through-repositories.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-5ab843d6").then(n)}},{name:"v-32163c7b",path:"/1.x/packages/validation.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-32163c7b").then(n)}},{name:"v-53650bf2",path:"/1.x/packages/views.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-53650bf2").then(n)}},{name:"v-fb9fdb00",path:"/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-fb9fdb00").then(n)}},{path:"/index.html",redirect:"/"},{path:"*",component:Us}],Ds={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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{title:"Architecture concepts",frontmatter:{},regularPath:"/1.x/architecture/",relativePath:"1.x/architecture/README.md",key:"v-d80157e0",path:"/1.x/architecture/",lastUpdated:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{title:"Docker",frontmatter:{},regularPath:"/1.x/introduction/docker.html",relativePath:"1.x/introduction/docker.md",key:"v-ed86e68a",path:"/1.x/introduction/docker.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Installation & Setup",slug:"installation-setup"},{level:3,title:"First steps",slug:"first-steps"},{level:3,title:"Configure the docker container",slug:"configure-the-docker-container"},{level:3,title:"Launching the docker container",slug:"launching-the-docker-container"},{level:3,title:"Monitor your container(s):",slug:"monitor-your-container-s"},{level:2,title:"Configuring Krayin",slug:"configuring-krayin"},{level:3,title:"Install without composer",slug:"install-without-composer"},{level:3,title:"Install with composer",slug:"install-with-composer"},{level:3,title:"Configure Apache",slug:"configure-apache"},{level:3,title:"Ready",slug:"ready"}],lastUpdated:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{title:"Upgrade to the latest version of Krayin",frontmatter:{},regularPath:"/1.x/introduction/upgrade-to-latest-bagisto.html",relativePath:"1.x/introduction/upgrade-to-latest-bagisto.md",key:"v-624343f9",path:"/1.x/introduction/upgrade-to-latest-bagisto.html",lastUpdated:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3},{title:"Home",frontmatter:{home:!0,heroText:"Krayin CRM Developer Portal",tagline:"Find detailed documentation and code examples.",actionText:"Get Started →",actionLink:"/1.x/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:"8/7/2024, 12:31:23 PM",lastUpdatedTimestamp:1723033883e3}],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:"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"]]},{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"]]}]}}};n(238);Wn.component("Badge",()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,309)));n(239),n(240);function Ns(t){const e=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.left-e.left,y:n.top-e.top}}class Fs{constructor(t){Object.defineProperty(this,"registration",{value:t,configurable:!0,writable:!0})}update(){return this.registration.update()}skipWaiting(){const t=this.registration.waiting;return t?(console.log("[vuepress:sw] Doing worker.skipWaiting()."),new Promise((e,n)=>{const r=new MessageChannel;r.port1.onmessage=t=>{console.log("[vuepress:sw] Done worker.skipWaiting()."),t.data.error?n(t.data.error):e(t.data)},t.postMessage({type:"skip-waiting"},[r.port2])})):Promise.resolve()}}var Bs=new Wn;var zs={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",Cs()(()=>{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}}},Vs=(n(241),Object(Rs.a)(zs,(function(){var t=this._self._c;return t("transition",{attrs:{name:"fade"}},[this.show?t("svg",{staticClass:"go-to-top",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 49.484 28.284"},on:{click:this.scrollToTop}},[t("g",{attrs:{transform:"translate(-229 -126.358)"}},[t("rect",{attrs:{fill:"currentColor",width:"35",height:"5",rx:"2",transform:"translate(229 151.107) rotate(-45)"}}),this._v(" "),t("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),Hs=[{},({Vue:t})=>{t.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},({Vue:t,router:e})=>{e.options.scrollBehavior=(e,n,r)=>{if(r)return window.scrollTo({top:r.y,behavior:"smooth"});if(e.hash){if(t.$vuepress.$get("disableScrollBehavior"))return!1;const n=document.querySelector(e.hash);return!!n&&window.scrollTo({top:Ns(n).y,behavior:"smooth"})}return window.scrollTo({top:0,behavior:"smooth"})}},async({router:t,isServer:e})=>{if(!e){const{register:e}=await n.e(57).then(n.bind(null,303));t.onReady(()=>{e("/service-worker.js",{registrationOptions:{},ready(){console.log("[vuepress:sw] Service worker is active."),Bs.$emit("sw-ready")},cached(t){console.log("[vuepress:sw] Content has been cached for offline use."),Bs.$emit("sw-cached",new Fs(t))},updated(t){console.log("[vuepress:sw] Content updated."),Bs.$emit("sw-updated",new Fs(t))},offline(){console.log("[vuepress:sw] No internet connection found. App is running in offline mode."),Bs.$emit("sw-offline")},error(t){console.error("[vuepress:sw] Error during service worker registration:",t),Bs.$emit("sw-error",t),GA_ID&&ga("send","exception",{exDescription:t.message,exFatal:!1})}})})}},({Vue:t})=>{t.component("BackToTop",Vs)}],qs=["BackToTop"];class Ks extends class{constructor(){this.store=new Wn({data:{state:{}}})}$get(t){return this.store.state[t]}$set(t,e){Wn.set(this.store.state,t,e)}$emit(...t){this.store.$emit(...t)}$on(...t){this.store.$on(...t)}}{}Object.assign(Ks.prototype,{getPageAsyncComponent:cs,getLayoutAsyncComponent:ls,getAsyncComponent:us,getVueComponent:fs});var Ws={install(t){const e=new Ks;t.$vuepress=e,t.prototype.$vuepress=e}};function Gs(t,e){const n=e.toLowerCase();return t.options.routes.some(t=>t.path.toLowerCase()===n)}var Xs={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(t){const e=this.pageKey||this.$parent.$page.key;return ds("pageKey",e),Wn.component(e)||Wn.component(e,cs(e)),Wn.component(e)?t(e):t("")}},Ys={functional:!0,props:{slotKey:String,required:!0},render:(t,{props:e,slots:n})=>t("div",{class:["content__"+e.slotKey]},n()[e.slotKey])},Js={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},Qs=(n(242),n(243),Object(Rs.a)(Js,(function(){var t=this._self._c;return t("span",[t("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"}},[t("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(" "),t("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(" "),t("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),Zs={functional:!0,render(t,{parent:e,children:n}){if(e._isMounted)return n;e.$once("hook:mounted",()=>{e.$forceUpdate()})}};Wn.config.productionTip=!1,Wn.use(Ka),Wn.use(Ws),Wn.mixin(function(t,e,n=Wn){!function(t){t.locales&&Object.keys(t.locales).forEach(e=>{t.locales[e].path=e});Object.freeze(t)}(e),n.$vuepress.$set("siteData",e);const r=new(t(n.$vuepress.$get("siteData"))),o=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(r)),i={};return Object.keys(o).reduce((t,e)=>(e.startsWith("$")&&(t[e]=o[e].get),t),i),{computed:i}}(t=>class{setPage(t){this.__page=t}get $site(){return t}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:t={}}=this.$site;let e,n;for(const r in t)"/"===r?n=t[r]:0===this.$page.path.indexOf(r)&&(e=t[r]);return e||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:t}=this.$page.frontmatter;return"string"==typeof t&&t}get $title(){const t=this.$page,{metaTitle:e}=this.$page.frontmatter;if("string"==typeof e)return e;const n=this.$siteTitle,r=t.frontmatter.home?null:t.frontmatter.title||t.title;return n?r?r+" | "+n:n:r||"VuePress"}get $description(){const t=function(t){if(t){const e=t.filter(t=>"description"===t.name)[0];if(e)return e.content}}(this.$page.frontmatter.meta);return t||(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(t,e){for(let n=0;nn||(t.hash?!Wn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(t.hash)}:{x:0,y:0})});!function(t){t.beforeEach((e,n,r)=>{if(Gs(t,e.path))r();else if(/(\/|\.html)$/.test(e.path))if(/\/$/.test(e.path)){const n=e.path.replace(/\/$/,"")+".html";Gs(t,n)?r(n):r()}else r();else{const n=e.path+"/",o=e.path+".html";Gs(t,o)?r(o):Gs(t,n)?r(n):r()}})}(n);const r={};try{await Promise.all(Hs.filter(t=>"function"==typeof t).map(e=>e({Vue:Wn,options:r,router:n,siteData:Ds,isServer:t})))}catch(t){console.error(t)}return{app:new Wn(Object.assign(r,{router:n,render:t=>t("div",{attrs:{id:"app"}},[t("RouterView",{ref:"layout"}),t("div",{class:"global-ui"},qs.map(e=>t(e)))])})),router:n}}(!1).then(({app:t,router:e})=>{e.onReady(()=>{t.$mount("#app")})})}]); \ No newline at end of file +var r=Object.freeze({}),o=Array.isArray;function i(t){return null==t}function a(t){return null!=t}function s(t){return!0===t}function c(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function l(t){return"function"==typeof t}function u(t){return null!==t&&"object"==typeof t}var f=Object.prototype.toString;function p(t){return"[object Object]"===f.call(t)}function d(t){return"[object RegExp]"===f.call(t)}function h(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function v(t){return a(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function m(t){return null==t?"":Array.isArray(t)||p(t)&&t.toString===f?JSON.stringify(t,g,2):String(t)}function g(t,e){return e&&e.__v_isRef?e.value:e}function y(t){var e=parseFloat(t);return isNaN(e)?t:e}function b(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(r,1)}}var w=Object.prototype.hasOwnProperty;function k(t,e){return w.call(t,e)}function C(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var S=/-(\w)/g,O=C((function(t){return t.replace(S,(function(t,e){return e?e.toUpperCase():""}))})),P=C((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),$=/\B([A-Z])/g,E=C((function(t){return t.replace($,"-$1").toLowerCase()}));var j=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function T(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function A(t,e){for(var n in e)t[n]=e[n];return t}function L(t){for(var e={},n=0;n0,Z=Y&&Y.indexOf("edge/")>0;Y&&Y.indexOf("android");var tt=Y&&/iphone|ipad|ipod|ios/.test(Y);Y&&/chrome\/\d+/.test(Y),Y&&/phantomjs/.test(Y);var et,nt=Y&&Y.match(/firefox\/(\d+)/),rt={}.watch,ot=!1;if(X)try{var it={};Object.defineProperty(it,"passive",{get:function(){ot=!0}}),window.addEventListener("test-passive",null,it)}catch(t){}var at=function(){return void 0===et&&(et=!X&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),et},st=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ct(t){return"function"==typeof t&&/native code/.test(t.toString())}var lt,ut="undefined"!=typeof Symbol&&ct(Symbol)&&"undefined"!=typeof Reflect&&ct(Reflect.ownKeys);lt="undefined"!=typeof Set&&ct(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ft=null;function pt(t){void 0===t&&(t=null),t||ft&&ft._scope.off(),ft=t,t&&t._scope.on()}var dt=function(){function t(t,e,n,r,o,i,a,s){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,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=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),ht=function(t){void 0===t&&(t="");var e=new dt;return e.text=t,e.isComment=!0,e};function vt(t){return new dt(void 0,void 0,void 0,String(t))}function mt(t){var e=new dt(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}"function"==typeof SuppressedError&&SuppressedError;var gt=0,yt=[],bt=function(){function t(){this._pending=!1,this.id=gt++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,yt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));for(var n=0,r=e.length;n0&&(Yt((l=t(l,"".concat(n||"","_").concat(r)))[0])&&Yt(f)&&(p[u]=vt(f.text+l[0].text),l.shift()),p.push.apply(p,l)):c(l)?Yt(f)?p[u]=vt(f.text+l):""!==l&&p.push(vt(l)):Yt(l)&&Yt(f)?p[u]=vt(f.text+l.text):(s(e._isVList)&&a(l.tag)&&i(l.key)&&a(n)&&(l.key="__vlist".concat(n,"_").concat(r,"__")),p.push(l)));return p}(t):void 0}function Yt(t){return a(t)&&a(t.text)&&!1===t.isComment}function Jt(t,e){var n,r,i,s,c=null;if(o(t)||"string"==typeof t)for(c=new Array(t.length),n=0,r=t.length;n0,s=e?!!e.$stable:!a,c=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&o&&o!==r&&c===o.$key&&!a&&!o.$hasNormal)return o;for(var l in i={},e)e[l]&&"$"!==l[0]&&(i[l]=me(t,n,l,e[l]))}else i={};for(var u in n)u in i||(i[u]=ge(n,u));return e&&Object.isExtensible(e)&&(e._normalized=i),K(i,"$stable",s),K(i,"$key",c),K(i,"$hasNormal",a),i}function me(t,e,n,r){var i=function(){var e=ft;pt(t);var n=arguments.length?r.apply(null,arguments):r({}),i=(n=n&&"object"==typeof n&&!o(n)?[n]:Xt(n))&&n[0];return pt(e),n&&(!i||1===n.length&&i.isComment&&!he(i))?void 0:n};return r.proxy&&Object.defineProperty(e,n,{get:i,enumerable:!0,configurable:!0}),i}function ge(t,e){return function(){return t[e]}}function ye(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};K(e,"_v_attr_proxy",!0),be(e,t.$attrs,r,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||be(t._listenersProxy={},t.$listeners,r,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||_e(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:j(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach((function(n){return Ft(t,e,n)}))}}}function be(t,e,n,r,o){var i=!1;for(var a in e)a in t?e[a]!==n[a]&&(i=!0):(i=!0,xe(t,a,r,o));for(var a in t)a in e||(i=!0,delete t[a]);return i}function xe(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function _e(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var we=null;function ke(t,e){return(t.__esModule||ut&&"Module"===t[Symbol.toStringTag])&&(t=t.default),u(t)?e.extend(t):t}function Ce(t){if(o(t))for(var e=0;edocument.createEvent("Event").timeStamp&&(ln=function(){return un.now()})}var fn=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function pn(){var t,e;for(cn=ln(),an=!0,en.sort(fn),sn=0;snsn&&en[n].id>t.id;)n--;en.splice(n+1,0,t)}else en.push(t);on||(on=!0,Ne(pn))}}function hn(t,e){if(t){for(var n=Object.create(null),r=ut?Reflect.ownKeys(t):Object.keys(t),o=0;o-1)if(i&&!k(o,"default"))a=!1;else if(""===a||a===E(t)){var c=Un(String,o.type);(c<0||s-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!d(t)&&t.test(e)}function Jn(t,e){var n=t.cache,r=t.keys,o=t._vnode,i=t.$vnode;for(var a in n){var s=n[a];if(s){var c=s.name;c&&!e(c)&&Qn(n,a,r,o)}}i.componentOptions.children=void 0}function Qn(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,_(n,e)}Wn.prototype._init=function(t){var e=this;e._uid=qn++,e._isVue=!0,e.__v_skip=!0,e._scope=new zt(!0),e._scope.parent=void 0,e._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=jn(Kn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Xe(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=pe(e._renderChildren,o),t.$scopedSlots=n?ve(t.$parent,n.data.scopedSlots,t.$slots):r,t._c=function(e,n,r,o){return Se(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return Se(t,e,n,r,o,!0)};var i=n&&n.data;At(t,"$attrs",i&&i.attrs||r,null,!0),At(t,"$listeners",e._parentListeners||r,null,!0)}(e),tn(e,"beforeCreate",void 0,!1),function(t){var e=hn(t.$options.inject,t);e&&($t(!1),Object.keys(e).forEach((function(n){At(t,n,e[n])})),$t(!0))}(e),Nn(e),function(t){var e=t.$options.provide;if(e){var n=l(e)?e.call(t):e;if(!u(n))return;for(var r=Vt(t),o=ut?Reflect.ownKeys(n):Object.keys(n),i=0;i1?T(n):n;for(var r=T(arguments,1),o='event handler for "'.concat(t,'"'),i=0,a=n.length;iparseInt(this.max)&&Qn(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Qn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Jn(t,(function(t){return Yn(e,t)}))})),this.$watch("exclude",(function(e){Jn(t,(function(t){return!Yn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Ce(t),n=e&&e.componentOptions;if(n){var r=Xn(n),o=this.include,i=this.exclude;if(o&&(!r||!Yn(o,r))||i&&r&&Yn(i,r))return e;var a=this.cache,s=this.keys,c=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;a[c]?(e.componentInstance=a[c].componentInstance,_(s,c),s.push(c)):(this.vnodeToCache=e,this.keyToCache=c),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return V}};Object.defineProperty(t,"config",e),t.util={warn:kn,extend:A,mergeOptions:jn,defineReactive:At},t.set=Lt,t.delete=Mt,t.nextTick=Ne,t.observable=function(t){return Tt(t),t},t.options=Object.create(null),B.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,A(t.options.components,tr),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=T(arguments,1);return n.unshift(this),l(t.install)?t.install.apply(t,n):l(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=jn(this.options,t),this}}(t),Gn(t),function(t){B.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&p(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&l(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Wn),Object.defineProperty(Wn.prototype,"$isServer",{get:at}),Object.defineProperty(Wn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Wn,"FunctionalRenderContext",{value:vn}),Wn.version="2.7.16";var er=b("style,class"),nr=b("input,textarea,option,select,progress"),rr=b("contenteditable,draggable,spellcheck"),or=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"),ar="http://www.w3.org/1999/xlink",sr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},cr=function(t){return sr(t)?t.slice(6,t.length):""},lr=function(t){return null==t||!1===t};function ur(t){for(var e=t.data,n=t,r=t;a(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=fr(r.data,e));for(;a(n=n.parent);)n&&n.data&&(e=fr(e,n.data));return function(t,e){if(a(t)||a(e))return pr(t,dr(e));return""}(e.staticClass,e.class)}function fr(t,e){return{staticClass:pr(t.staticClass,e.staticClass),class:a(t.class)?[t.class,e.class]:e.class}}function pr(t,e){return t?e?t+" "+e:t:e||""}function dr(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r-1?Ir(t,e,n):ir(e)?lr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):rr(e)?t.setAttribute(e,function(t,e){return lr(e)||"false"===e?"false":"contenteditable"===t&&or(e)?e:"true"}(e,n)):sr(e)?lr(n)?t.removeAttributeNS(ar,cr(e)):t.setAttributeNS(ar,e,n):Ir(t,e,n)}function Ir(t,e,n){if(lr(n))t.removeAttribute(e);else{if(J&&!Q&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Dr={create:Rr,update:Rr};function Nr(t,e){var n=e.elm,r=e.data,o=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(o)||i(o.staticClass)&&i(o.class)))){var s=ur(e),c=n._transitionClasses;a(c)&&(s=pr(s,dr(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Fr,Br={create:Nr,update:Nr};function zr(t,e,n){var r=Fr;return function o(){var i=e.apply(null,arguments);null!==i&&qr(t,o,n,r)}}var Vr=Te&&!(nt&&Number(nt[1])<=53);function Hr(t,e,n,r){if(Vr){var o=cn,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}Fr.addEventListener(t,e,ot?{capture:n,passive:r}:n)}function qr(t,e,n,r){(r||Fr).removeEventListener(t,e._wrapper||e,n)}function Kr(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Fr=e.elm||t.elm,function(t){if(a(t.__r)){var e=J?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}a(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),Kt(n,r,Hr,qr,zr,e.context),Fr=void 0}}var Wr,Gr={create:Kr,update:Kr,destroy:function(t){return Kr(t,Cr)}};function Xr(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,o=e.elm,c=t.data.domProps||{},l=e.data.domProps||{};for(n in(a(l.__ob__)||s(l._v_attr_proxy))&&(l=e.data.domProps=A({},l)),c)n in l||(o[n]="");for(n in l){if(r=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===c[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=r;var u=i(r)?"":String(r);Yr(o,u)&&(o.value=u)}else if("innerHTML"===n&&mr(o.tagName)&&i(o.innerHTML)){(Wr=Wr||document.createElement("div")).innerHTML="".concat(r,"");for(var f=Wr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;f.firstChild;)o.appendChild(f.firstChild)}else if(r!==c[n])try{o[n]=r}catch(t){}}}}function Yr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(a(r)){if(r.number)return y(n)!==y(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Jr={create:Xr,update:Xr},Qr=C((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Zr(t){var e=to(t.style);return t.staticStyle?A(t.staticStyle,e):e}function to(t){return Array.isArray(t)?L(t):"string"==typeof t?Qr(t):t}var eo,no=/^--/,ro=/\s*!important$/,oo=function(t,e,n){if(no.test(e))t.style.setProperty(e,n);else if(ro.test(n))t.style.setProperty(E(e),n.replace(ro,""),"important");else{var r=ao(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(lo).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function fo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(lo).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function po(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&A(e,ho(t.name||"v")),A(e,t),e}return"string"==typeof t?ho(t):void 0}}var ho=C((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),vo=X&&!Q,mo="transition",go="transitionend",yo="animation",bo="animationend";vo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(mo="WebkitTransition",go="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(yo="WebkitAnimation",bo="webkitAnimationEnd"));var xo=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function _o(t){xo((function(){xo(t)}))}function wo(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),uo(t,e))}function ko(t,e){t._transitionClasses&&_(t._transitionClasses,e),fo(t,e)}function Co(t,e,n){var r=Oo(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s="transition"===o?go:bo,c=0,l=function(){t.removeEventListener(s,u),n()},u=function(e){e.target===t&&++c>=a&&l()};setTimeout((function(){c0&&(n="transition",u=a,f=i.length):"animation"===e?l>0&&(n="animation",u=l,f=c.length):f=(n=(u=Math.max(a,l))>0?a>l?"transition":"animation":null)?"transition"===n?i.length:c.length:0,{type:n,timeout:u,propCount:f,hasTransform:"transition"===n&&So.test(r[mo+"Property"])}}function Po(t,e){for(;t.length1}function Lo(t,e){!0!==e.data.show&&Eo(e)}var Mo=function(t){var e,n,r={},l=t.modules,u=t.nodeOps;for(e=0;eh?x(t,i(n[g+1])?null:n[g+1].elm,n,d,g,r):d>g&&w(e,f,h)}(f,v,g,n,l):a(g)?(a(t.text)&&u.setTextContent(f,""),x(f,null,g,0,g.length-1,n)):a(v)?w(v,0,v.length-1):a(t.text)&&u.setTextContent(f,""):t.text!==e.text&&u.setTextContent(f,e.text),a(h)&&a(d=h.hook)&&a(d=d.postpatch)&&d(t,e)}}}function O(t,e,n){if(s(n)&&a(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==i&&(a.selected=i);else if(I(No(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function Do(t,e){return e.every((function(e){return!I(e,t)}))}function No(t){return"_value"in t?t._value:t.value}function Fo(t){t.target.composing=!0}function Bo(t){t.target.composing&&(t.target.composing=!1,zo(t.target,"input"))}function zo(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Vo(t){return!t.componentInstance||t.data&&t.data.transition?t:Vo(t.componentInstance._vnode)}var Ho={model:Ro,show:{bind:function(t,e,n){var r=e.value,o=(n=Vo(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,Eo(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Vo(n)).data&&n.data.transition?(n.data.show=!0,r?Eo(n,(function(){t.style.display=t.__vOriginalDisplay})):jo(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},qo={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 Ko(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ko(Ce(e.children)):t}function Wo(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[O(r)]=o[r];return e}function Go(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Xo=function(t){return t.tag||he(t)},Yo=function(t){return"show"===t.name},Jo={name:"transition",props:qo,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Xo)).length){0;var r=this.mode;0;var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=Ko(o);if(!i)return o;if(this._leaving)return Go(t,o);var a="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?a+"comment":a+i.tag:c(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var s=(i.data||(i.data={})).transition=Wo(this),l=this._vnode,u=Ko(l);if(i.data.directives&&i.data.directives.some(Yo)&&(i.data.show=!0),u&&u.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,u)&&!he(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var f=u.data.transition=A({},s);if("out-in"===r)return this._leaving=!0,Wt(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Go(t,o);if("in-out"===r){if(he(i))return l;var p,d=function(){p()};Wt(s,"afterEnter",d),Wt(s,"enterCancelled",d),Wt(f,"delayLeave",(function(t){p=t}))}}return o}}},Qo=A({tag:String,moveClass:String},qo);function Zo(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function ti(t){t.data.newPos=t.elm.getBoundingClientRect()}function ei(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}delete Qo.mode;var ni={Transition:Jo,TransitionGroup:{props:Qo,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Je(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=Wo(this),s=0;s-1?yr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:yr[t]=/HTMLUnknownElement/.test(e.toString())},A(Wn.options.directives,Ho),A(Wn.options.components,ni),Wn.prototype.__patch__=X?Mo:M,Wn.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=ht),tn(t,"beforeMount"),r=function(){t._update(t._render(),n)},new qe(t,r,M,{before:function(){t._isMounted&&!t._isDestroyed&&tn(t,"beforeUpdate")}},!0),n=!1;var o=t._preWatchers;if(o)for(var i=0;i=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(o.path||""),l=e&&e.path||"/",u=c.path?ki(c.path,l,n||o.append):l,f=function(t,e,n){void 0===e&&(e={});var r,o=n||ui;try{r=o(t||"")}catch(t){r={}}for(var i in e){var a=e[i];r[i]=Array.isArray(a)?a.map(li):li(a)}return r}(c.query,o.query,r&&r.options.parseQuery),p=o.hash||c.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:u,query:f,hash:p}}var Hi,qi=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(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),i=o.location,a=o.route,s=o.href,c={},l=n.options.linkActiveClass,u=n.options.linkExactActiveClass,f=null==l?"router-link-active":l,p=null==u?"router-link-exact-active":u,d=null==this.activeClass?f:this.activeClass,h=null==this.exactActiveClass?p:this.exactActiveClass,v=a.redirectedFrom?di(null,Vi(a.redirectedFrom),null,n):a;c[h]=yi(r,v,this.exactPath),c[d]=this.exact||this.exactPath?c[h]:function(t,e){return 0===t.path.replace(pi,"/").indexOf(e.path.replace(pi,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,v);var m=c[h]?this.ariaCurrentValue:null,g=function(t){Wi(t)&&(e.replace?n.replace(i,qi):n.push(i,qi))},y={click:Wi};Array.isArray(this.event)?this.event.forEach((function(t){y[t]=g})):y[this.event]=g;var b={class:c},x=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:a,navigate:g,isActive:c[d],isExactActive:c[h]});if(x){if(1===x.length)return x[0];if(x.length>1||!x.length)return 0===x.length?t():t("span",{},x)}if("a"===this.tag)b.on=y,b.attrs={href:s,"aria-current":m};else{var _=function t(e){var n;if(e)for(var r=0;r-1&&(s.params[p]=n.params[p]);return s.path=zi(u.path,s.params),c(u,s,a)}if(s.path){s.params={};for(var d=0;d-1}function Sa(t,e){return Ca(t)&&t._isRouter&&(null==e||t.type===e)}function Oa(t,e,n){var r=function(o){o>=t.length?n():t[o]?e(t[o],(function(){r(o+1)})):r(o+1)};r(0)}function Pa(t){return function(e,n,r){var o=!1,i=0,a=null;$a(t,(function(t,e,n,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var c,l=Ta((function(e){var o;((o=e).__esModule||ja&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:Hi.extend(e),n.components[s]=e,--i<=0&&r()})),u=Ta((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=Ca(t)?t:new Error(e),r(a))}));try{c=t(l,u)}catch(t){u(t)}if(c)if("function"==typeof c.then)c.then(l,u);else{var f=c.component;f&&"function"==typeof f.then&&f.then(l,u)}}})),o||r()}}function $a(t,e){return Ea(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Ea(t){return Array.prototype.concat.apply([],t)}var ja="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ta(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var Aa=function(t,e){this.router=t,this.base=function(t){if(!t)if(Gi){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=vi,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function La(t,e,n,r){var o=$a(t,(function(t,r,o,i){var a=function(t,e){"function"!=typeof t&&(t=Hi.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,r,o,i)})):n(a,r,o,i)}));return Ea(r?o.reverse():o)}function Ma(t,e){if(e)return function(){return t.apply(e,arguments)}}Aa.prototype.listen=function(t){this.cb=t},Aa.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Aa.prototype.onError=function(t){this.errorCbs.push(t)},Aa.prototype.transitionTo=function(t,e,n){var r,o=this;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(r,(function(){o.updateRoute(r),e&&e(r),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(r,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(r)})))}),(function(t){n&&n(t),t&&!o.ready&&(Sa(t,ba.redirected)&&i===vi||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},Aa.prototype.confirmTransition=function(t,e,n){var r=this,o=this.current;this.pending=t;var i,a,s=function(t){!Sa(t)&&Ca(t)&&(r.errorCbs.length?r.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},c=t.matched.length-1,l=o.matched.length-1;if(yi(t,o)&&c===l&&t.matched[c]===o.matched[l])return this.ensureURL(),t.hash&&aa(this.router,o,t,!1),s(((a=wa(i=o,t,ba.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",a));var u=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,r=va&&n;r&&this.listeners.push(ia());var o=function(){var n=t.current,o=Ua(t.base);t.current===vi&&o===t._startLocation||t.transitionTo(o,(function(t){r&&aa(e,t,n,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){ma(Ci(r.base+t.fullPath)),aa(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){ya(Ci(r.base+t.fullPath)),aa(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(Ua(this.base)!==this.current.fullPath){var e=Ci(this.base+this.current.fullPath);t?ma(e):ya(e)}},e.prototype.getCurrentLocation=function(){return Ua(this.base)},e}(Aa);function Ua(t){var e=window.location.pathname,n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(Ci(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Ia=function(t){function e(e,n,r){t.call(this,e,n),r&&function(t){var e=Ua(t);if(!/^\/#/.test(e))return window.location.replace(Ci(t+"/#"+e)),!0}(this.base)||Da()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=va&&e;n&&this.listeners.push(ia());var r=function(){var e=t.current;Da()&&t.transitionTo(Na(),(function(r){n&&aa(t.router,r,e,!0),va||za(r.fullPath)}))},o=va?"popstate":"hashchange";window.addEventListener(o,r),this.listeners.push((function(){window.removeEventListener(o,r)}))}},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){Ba(t.fullPath),aa(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){za(t.fullPath),aa(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Na()!==e&&(t?Ba(e):za(e))},e.prototype.getCurrentLocation=function(){return Na()},e}(Aa);function Da(){var t=Na();return"/"===t.charAt(0)||(za("/"+t),!1)}function Na(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Fa(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function Ba(t){va?ma(Fa(t)):window.location.hash=t}function za(t){va?ya(Fa(t)):window.location.replace(Fa(t))}var Va=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){var t=e.current;e.index=n,e.updateRoute(r),e.router.afterHooks.forEach((function(e){e&&e(r,t)}))}),(function(t){Sa(t,ba.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Aa),Ha=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Ji(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!va&&!1!==t.fallback,this.fallback&&(e="hash"),Gi||(e="abstract"),this.mode=e,e){case"history":this.history=new Ra(this,t.base);break;case"hash":this.history=new Ia(this,t.base,this.fallback);break;case"abstract":this.history=new Va(this,t.base);break;default:0}},qa={currentRoute:{configurable:!0}};Ha.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},qa.currentRoute.get=function(){return this.history&&this.history.current},Ha.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof Ra||n instanceof Ia){var r=function(t){n.setupListeners(),function(t){var r=n.current,o=e.options.scrollBehavior;va&&o&&"fullPath"in t&&aa(e,t,r,!1)}(t)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ha.prototype.beforeEach=function(t){return Wa(this.beforeHooks,t)},Ha.prototype.beforeResolve=function(t){return Wa(this.resolveHooks,t)},Ha.prototype.afterEach=function(t){return Wa(this.afterHooks,t)},Ha.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ha.prototype.onError=function(t){this.history.onError(t)},Ha.prototype.push=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.push(t,e,n)}));this.history.push(t,e,n)},Ha.prototype.replace=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.replace(t,e,n)}));this.history.replace(t,e,n)},Ha.prototype.go=function(t){this.history.go(t)},Ha.prototype.back=function(){this.go(-1)},Ha.prototype.forward=function(){this.go(1)},Ha.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ha.prototype.resolve=function(t,e,n){var r=Vi(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?Ci(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}},Ha.prototype.getRoutes=function(){return this.matcher.getRoutes()},Ha.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==vi&&this.history.transitionTo(this.history.getCurrentLocation())},Ha.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==vi&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ha.prototype,qa);var Ka=Ha;function Wa(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Ha.install=function t(e){if(!t.installed||Hi!==e){t.installed=!0,Hi=e;var n=function(t){return void 0!==t},r=function(t,e){var r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.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(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",_i),e.component("RouterLink",Ki);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Ha.version="3.6.5",Ha.isNavigationFailure=Sa,Ha.NavigationFailureType=ba,Ha.START_LOCATION=vi,Gi&&window.Vue&&window.Vue.use(Ha);n(98);n(125),n(91);var Ga={"components/AlgoliaSearchBox":()=>Promise.all([n.e(0),n.e(11)]).then(n.bind(null,306)),"components/DropdownLink":()=>Promise.all([n.e(0),n.e(12)]).then(n.bind(null,260)),"components/DropdownTransition":()=>Promise.all([n.e(0),n.e(18)]).then(n.bind(null,248)),"components/Home":()=>Promise.all([n.e(0),n.e(15)]).then(n.bind(null,284)),"components/NavLink":()=>n.e(20).then(n.bind(null,247)),"components/NavLinks":()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,271)),"components/Navbar":()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,302)),"components/Page":()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,285)),"components/PageEdit":()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,273)),"components/PageNav":()=>Promise.all([n.e(0),n.e(13)]).then(n.bind(null,274)),"components/Sidebar":()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,286)),"components/SidebarButton":()=>Promise.all([n.e(0),n.e(19)]).then(n.bind(null,287)),"components/SidebarGroup":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,272)),"components/SidebarLink":()=>Promise.all([n.e(0),n.e(17)]).then(n.bind(null,261)),"components/SidebarLinks":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,259)),"global-components/Badge":()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,309)),"layouts/404":()=>n.e(5).then(n.bind(null,307)),"layouts/Layout":()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,308)),NotFound:()=>n.e(5).then(n.bind(null,307)),Layout:()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,308))},Xa={"v-628bc8f0":()=>n.e(22).then(n.bind(null,310)),"v-b8b65022":()=>n.e(24).then(n.bind(null,311)),"v-1cbafd5b":()=>n.e(23).then(n.bind(null,312)),"v-0359c01b":()=>n.e(26).then(n.bind(null,313)),"v-386691fe":()=>n.e(25).then(n.bind(null,314)),"v-b3e2f7dc":()=>n.e(27).then(n.bind(null,315)),"v-3a964646":()=>n.e(28).then(n.bind(null,316)),"v-d80157e0":()=>n.e(29).then(n.bind(null,317)),"v-7cb2e029":()=>n.e(21).then(n.bind(null,318)),"v-0648babb":()=>n.e(30).then(n.bind(null,319)),"v-2d5f850a":()=>n.e(31).then(n.bind(null,320)),"v-f8ff2a8a":()=>n.e(32).then(n.bind(null,321)),"v-3d14d060":()=>n.e(34).then(n.bind(null,322)),"v-1d0a5d05":()=>n.e(33).then(n.bind(null,323)),"v-37d6db67":()=>n.e(35).then(n.bind(null,324)),"v-fb520162":()=>n.e(14).then(n.bind(null,325)),"v-0606cc70":()=>n.e(36).then(n.bind(null,326)),"v-ed86e68a":()=>n.e(37).then(n.bind(null,327)),"v-7cda367b":()=>n.e(39).then(n.bind(null,328)),"v-624343f9":()=>n.e(40).then(n.bind(null,329)),"v-49812bde":()=>n.e(42).then(n.bind(null,330)),"v-a1dfbd8a":()=>n.e(38).then(n.bind(null,331)),"v-81282f8a":()=>n.e(43).then(n.bind(null,332)),"v-97db1d60":()=>n.e(41).then(n.bind(null,333)),"v-9436f116":()=>n.e(44).then(n.bind(null,334)),"v-3d32147b":()=>n.e(45).then(n.bind(null,335)),"v-3098292d":()=>n.e(47).then(n.bind(null,336)),"v-43d3637b":()=>n.e(48).then(n.bind(null,337)),"v-67061e4a":()=>n.e(49).then(n.bind(null,338)),"v-43c25037":()=>n.e(46).then(n.bind(null,339)),"v-4e564c1b":()=>n.e(52).then(n.bind(null,340)),"v-87d9c7de":()=>n.e(50).then(n.bind(null,341)),"v-253dcc3b":()=>n.e(51).then(n.bind(null,342)),"v-5ab843d6":()=>n.e(53).then(n.bind(null,343)),"v-32163c7b":()=>n.e(54).then(n.bind(null,344)),"v-fb9fdb00":()=>n.e(56).then(n.bind(null,345)),"v-53650bf2":()=>n.e(55).then(n.bind(null,346))};function Ya(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const Ja=/-(\w)/g,Qa=Ya(t=>t.replace(Ja,(t,e)=>e?e.toUpperCase():"")),Za=/\B([A-Z])/g,ts=Ya(t=>t.replace(Za,"-$1").toLowerCase()),es=Ya(t=>t.charAt(0).toUpperCase()+t.slice(1));function ns(t,e){if(!e)return;if(t(e))return t(e);return e.includes("-")?t(es(Qa(e))):t(es(e))||t(ts(e))}const rs=Object.assign({},Ga,Xa),os=t=>rs[t],is=t=>Xa[t],as=t=>Ga[t],ss=t=>Wn.component(t);function cs(t){return ns(is,t)}function ls(t){return ns(as,t)}function us(t){return ns(os,t)}function fs(t){return ns(ss,t)}function ps(...t){return Promise.all(t.filter(t=>t).map(async t=>{if(!fs(t)&&us(t)){const e=await us(t)();Wn.component(t,e.default)}}))}function ds(t,e){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[t]=e)}var hs=n(88),vs=n.n(hs),ms=n(89),gs=n.n(ms),ys={created(){if(this.siteMeta=this.$site.headTags.filter(([t])=>"meta"===t).map(([t,e])=>e),this.$ssrContext){const e=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(t=e)?t.map(t=>{let e="{e+=` ${n}="${gs()(t[n])}"`}),e+">"}).join("\n "):"",this.$ssrContext.canonicalLink=xs(this.$canonicalUrl)}var t},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const t=this.getMergedMetaTags();this.currentMetaTags=_s(t,this.currentMetaTags)},getMergedMetaTags(){const t=this.$page.frontmatter.meta||[];return vs()([{name:"description",content:this.$description}],t,this.siteMeta,ws)},updateCanonicalLink(){bs(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",xs(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){_s(null,this.currentMetaTags),bs()}};function bs(){const t=document.querySelector("link[rel='canonical']");t&&t.remove()}function xs(t=""){return t?``:""}function _s(t,e){if(e&&[...e].filter(t=>t.parentNode===document.head).forEach(t=>document.head.removeChild(t)),t)return t.map(t=>{const e=document.createElement("meta");return Object.keys(t).forEach(n=>{e.setAttribute(n,t[n])}),document.head.appendChild(e),e})}function ws(t){for(const e of["name","property","itemprop"])if(t.hasOwnProperty(e))return t[e]+e;return JSON.stringify(t)}var ks=n(22),Cs=n.n(ks),Ss={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:Cs()((function(){this.setActiveHash()}),300),setActiveHash(){const t=[].slice.call(document.querySelectorAll(".sidebar-link")),e=[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(t=>t.hash===e.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),o=window.innerHeight+n;for(let t=0;t=i.parentElement.offsetTop+10&&(!a||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Os=n(23),Ps=n.n(Os),$s={mounted(){Ps.a.configure({showSpinner:!1}),this.$router.beforeEach((t,e,n)=>{t.path===e.path||Wn.component(t.name)||Ps.a.start(),n()}),this.$router.afterEach(()=>{Ps.a.done(),this.isSidebarOpen=!1})}},Es=n(90),js=n.n(Es),Ts={mounted(){js.a.polyfill()}};n(236),n(237);class As{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:t="",duration:e=3e3}){let n=document.createElement("div");n.className="message move-in",n.innerHTML=`\n \n \n \n
    ${t}
    \n `,this.containerEl.appendChild(n),e>0&&setTimeout(()=>{this.close(n)},e)}close(t){t.className=t.className.replace("move-in",""),t.className+="move-out",t.addEventListener("animationend",()=>{t.remove()})}}var Ls=[ys,Ss,$s,Ts,{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(t=>{document.querySelectorAll(t).forEach(this.generateCopyButton)})},1e3)},generateCopyButton(t){if(t.classList.contains("codecopy-enabled"))return;const e=document.createElement("i");e.className="code-copy",e.innerHTML='',e.title="Click to Copy to Clipboard",e.addEventListener("click",()=>{this.copyToClipboard(t.innerText)}),t.appendChild(e),t.classList.add("codecopy-enabled")},copyToClipboard(t){const e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e);const n=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);e.select(),document.execCommand("copy");(new As).show({text:"Copy successfully and then paste it for use.",duration:3e3}),document.body.removeChild(e),n&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(n))}}}],Ms={name:"GlobalLayout",computed:{layout(){const t=this.getLayout();return ds("layout",t),Wn.component(t)}},methods:{getLayout(){if(this.$page.path){const t=this.$page.frontmatter.layout;return t&&(this.$vuepress.getLayoutAsyncComponent(t)||this.$vuepress.getVueComponent(t))?t:"Layout"}return"NotFound"}}},Rs=n(10),Us=Object(Rs.a)(Ms,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(t,e,n){switch(e){case"components":t[e]||(t[e]={}),Object.assign(t[e],n);break;case"mixins":t[e]||(t[e]=[]),t[e].push(...n);break;default:throw new Error("Unknown option name.")}}(Us,"mixins",Ls);const Is=[{name:"v-628bc8f0",path:"/1.x/advanced/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-628bc8f0").then(n)}},{path:"/1.x/advanced/index.html",redirect:"/1.x/advanced/"},{name:"v-b8b65022",path:"/1.x/advanced/helpers.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-b8b65022").then(n)}},{name:"v-1cbafd5b",path:"/1.x/advanced/events.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-1cbafd5b").then(n)}},{name:"v-0359c01b",path:"/1.x/advanced/render-event.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-0359c01b").then(n)}},{name:"v-386691fe",path:"/1.x/advanced/override-core-model.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-386691fe").then(n)}},{name:"v-b3e2f7dc",path:"/1.x/api/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-b3e2f7dc").then(n)}},{path:"/1.x/api/index.html",redirect:"/1.x/api/"},{name:"v-3a964646",path:"/1.x/api/getting-started-with-the-api.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-3a964646").then(n)}},{name:"v-d80157e0",path:"/1.x/architecture/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-d80157e0").then(n)}},{path:"/1.x/architecture/index.html",redirect:"/1.x/architecture/"},{name:"v-7cb2e029",path:"/1.x/advanced/security-practice.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-7cb2e029").then(n)}},{name:"v-0648babb",path:"/1.x/architecture/modular-design.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-0648babb").then(n)}},{name:"v-2d5f850a",path:"/1.x/architecture/packages.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-2d5f850a").then(n)}},{name:"v-f8ff2a8a",path:"/1.x/architecture/repository-pattern.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-f8ff2a8a").then(n)}},{name:"v-3d14d060",path:"/1.x/custom-attributes/",component:Us,beforeEnter:(t,e,n)=>{ps("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:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-1d0a5d05").then(n)}},{name:"v-37d6db67",path:"/1.x/custom-attributes/custom-attribute.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-37d6db67").then(n)}},{name:"v-fb520162",path:"/1.x/custom-attributes/uses.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-fb520162").then(n)}},{name:"v-0606cc70",path:"/1.x/introduction/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-0606cc70").then(n)}},{path:"/1.x/introduction/index.html",redirect:"/1.x/introduction/"},{name:"v-ed86e68a",path:"/1.x/introduction/docker.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-ed86e68a").then(n)}},{name:"v-7cda367b",path:"/1.x/introduction/requirements.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-7cda367b").then(n)}},{name:"v-624343f9",path:"/1.x/introduction/upgrade-to-latest-bagisto.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-624343f9").then(n)}},{name:"v-49812bde",path:"/1.x/packages/add-menu-in-admin.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-49812bde").then(n)}},{name:"v-a1dfbd8a",path:"/1.x/introduction/installation.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-a1dfbd8a").then(n)}},{name:"v-81282f8a",path:"/1.x/packages/assets.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-81282f8a").then(n)}},{name:"v-97db1d60",path:"/1.x/packages/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-97db1d60").then(n)}},{path:"/1.x/packages/index.html",redirect:"/1.x/packages/"},{name:"v-9436f116",path:"/1.x/packages/controllers.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-9436f116").then(n)}},{name:"v-3d32147b",path:"/1.x/packages/create-acl.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-3d32147b").then(n)}},{name:"v-3098292d",path:"/1.x/packages/create-models.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-3098292d").then(n)}},{name:"v-43d3637b",path:"/1.x/packages/create-package.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-43d3637b").then(n)}},{name:"v-67061e4a",path:"/1.x/packages/datagrid.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-67061e4a").then(n)}},{name:"v-43c25037",path:"/1.x/packages/create-migrations.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-43c25037").then(n)}},{name:"v-4e564c1b",path:"/1.x/packages/routes.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-4e564c1b").then(n)}},{name:"v-87d9c7de",path:"/1.x/packages/layouts.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-87d9c7de").then(n)}},{name:"v-253dcc3b",path:"/1.x/packages/localization.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-253dcc3b").then(n)}},{name:"v-5ab843d6",path:"/1.x/packages/store-data-through-repositories.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-5ab843d6").then(n)}},{name:"v-32163c7b",path:"/1.x/packages/validation.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-32163c7b").then(n)}},{name:"v-fb9fdb00",path:"/",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-fb9fdb00").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-53650bf2",path:"/1.x/packages/views.html",component:Us,beforeEnter:(t,e,n)=>{ps("Layout","v-53650bf2").then(n)}},{path:"*",component:Us}],Ds={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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{title:"Architecture concepts",frontmatter:{},regularPath:"/1.x/architecture/",relativePath:"1.x/architecture/README.md",key:"v-d80157e0",path:"/1.x/architecture/",lastUpdated:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{title:"Docker",frontmatter:{},regularPath:"/1.x/introduction/docker.html",relativePath:"1.x/introduction/docker.md",key:"v-ed86e68a",path:"/1.x/introduction/docker.html",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Installation & Setup",slug:"installation-setup"},{level:3,title:"First steps",slug:"first-steps"},{level:3,title:"Configure the docker container",slug:"configure-the-docker-container"},{level:3,title:"Launching the docker container",slug:"launching-the-docker-container"},{level:3,title:"Monitor your container(s):",slug:"monitor-your-container-s"},{level:2,title:"Configuring Krayin",slug:"configuring-krayin"},{level:3,title:"Install without composer",slug:"install-without-composer"},{level:3,title:"Install with composer",slug:"install-with-composer"},{level:3,title:"Configure Apache",slug:"configure-apache"},{level:3,title:"Ready",slug:"ready"}],lastUpdated:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{title:"Upgrade to the latest version of Krayin",frontmatter:{},regularPath:"/1.x/introduction/upgrade-to-latest-bagisto.html",relativePath:"1.x/introduction/upgrade-to-latest-bagisto.md",key:"v-624343f9",path:"/1.x/introduction/upgrade-to-latest-bagisto.html",lastUpdated:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{title:"Home",frontmatter:{home:!0,heroText:"Krayin CRM Developer Portal",tagline:"Find detailed documentation and code examples.",actionText:"Get Started →",actionLink:"/1.x/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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3},{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:"8/9/2024, 6:14:04 AM",lastUpdatedTimestamp:1723184044e3}],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:"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"]]},{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"]]}]}}};n(238);Wn.component("Badge",()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,309)));n(239),n(240);function Ns(t){const e=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.left-e.left,y:n.top-e.top}}class Fs{constructor(t){Object.defineProperty(this,"registration",{value:t,configurable:!0,writable:!0})}update(){return this.registration.update()}skipWaiting(){const t=this.registration.waiting;return t?(console.log("[vuepress:sw] Doing worker.skipWaiting()."),new Promise((e,n)=>{const r=new MessageChannel;r.port1.onmessage=t=>{console.log("[vuepress:sw] Done worker.skipWaiting()."),t.data.error?n(t.data.error):e(t.data)},t.postMessage({type:"skip-waiting"},[r.port2])})):Promise.resolve()}}var Bs=new Wn;var zs={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",Cs()(()=>{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}}},Vs=(n(241),Object(Rs.a)(zs,(function(){var t=this._self._c;return t("transition",{attrs:{name:"fade"}},[this.show?t("svg",{staticClass:"go-to-top",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 49.484 28.284"},on:{click:this.scrollToTop}},[t("g",{attrs:{transform:"translate(-229 -126.358)"}},[t("rect",{attrs:{fill:"currentColor",width:"35",height:"5",rx:"2",transform:"translate(229 151.107) rotate(-45)"}}),this._v(" "),t("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),Hs=[{},({Vue:t})=>{t.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},({Vue:t,router:e})=>{e.options.scrollBehavior=(e,n,r)=>{if(r)return window.scrollTo({top:r.y,behavior:"smooth"});if(e.hash){if(t.$vuepress.$get("disableScrollBehavior"))return!1;const n=document.querySelector(e.hash);return!!n&&window.scrollTo({top:Ns(n).y,behavior:"smooth"})}return window.scrollTo({top:0,behavior:"smooth"})}},async({router:t,isServer:e})=>{if(!e){const{register:e}=await n.e(57).then(n.bind(null,303));t.onReady(()=>{e("/service-worker.js",{registrationOptions:{},ready(){console.log("[vuepress:sw] Service worker is active."),Bs.$emit("sw-ready")},cached(t){console.log("[vuepress:sw] Content has been cached for offline use."),Bs.$emit("sw-cached",new Fs(t))},updated(t){console.log("[vuepress:sw] Content updated."),Bs.$emit("sw-updated",new Fs(t))},offline(){console.log("[vuepress:sw] No internet connection found. App is running in offline mode."),Bs.$emit("sw-offline")},error(t){console.error("[vuepress:sw] Error during service worker registration:",t),Bs.$emit("sw-error",t),GA_ID&&ga("send","exception",{exDescription:t.message,exFatal:!1})}})})}},({Vue:t})=>{t.component("BackToTop",Vs)}],qs=["BackToTop"];class Ks extends class{constructor(){this.store=new Wn({data:{state:{}}})}$get(t){return this.store.state[t]}$set(t,e){Wn.set(this.store.state,t,e)}$emit(...t){this.store.$emit(...t)}$on(...t){this.store.$on(...t)}}{}Object.assign(Ks.prototype,{getPageAsyncComponent:cs,getLayoutAsyncComponent:ls,getAsyncComponent:us,getVueComponent:fs});var Ws={install(t){const e=new Ks;t.$vuepress=e,t.prototype.$vuepress=e}};function Gs(t,e){const n=e.toLowerCase();return t.options.routes.some(t=>t.path.toLowerCase()===n)}var Xs={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(t){const e=this.pageKey||this.$parent.$page.key;return ds("pageKey",e),Wn.component(e)||Wn.component(e,cs(e)),Wn.component(e)?t(e):t("")}},Ys={functional:!0,props:{slotKey:String,required:!0},render:(t,{props:e,slots:n})=>t("div",{class:["content__"+e.slotKey]},n()[e.slotKey])},Js={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},Qs=(n(242),n(243),Object(Rs.a)(Js,(function(){var t=this._self._c;return t("span",[t("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"}},[t("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(" "),t("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(" "),t("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),Zs={functional:!0,render(t,{parent:e,children:n}){if(e._isMounted)return n;e.$once("hook:mounted",()=>{e.$forceUpdate()})}};Wn.config.productionTip=!1,Wn.use(Ka),Wn.use(Ws),Wn.mixin(function(t,e,n=Wn){!function(t){t.locales&&Object.keys(t.locales).forEach(e=>{t.locales[e].path=e});Object.freeze(t)}(e),n.$vuepress.$set("siteData",e);const r=new(t(n.$vuepress.$get("siteData"))),o=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(r)),i={};return Object.keys(o).reduce((t,e)=>(e.startsWith("$")&&(t[e]=o[e].get),t),i),{computed:i}}(t=>class{setPage(t){this.__page=t}get $site(){return t}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:t={}}=this.$site;let e,n;for(const r in t)"/"===r?n=t[r]:0===this.$page.path.indexOf(r)&&(e=t[r]);return e||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:t}=this.$page.frontmatter;return"string"==typeof t&&t}get $title(){const t=this.$page,{metaTitle:e}=this.$page.frontmatter;if("string"==typeof e)return e;const n=this.$siteTitle,r=t.frontmatter.home?null:t.frontmatter.title||t.title;return n?r?r+" | "+n:n:r||"VuePress"}get $description(){const t=function(t){if(t){const e=t.filter(t=>"description"===t.name)[0];if(e)return e.content}}(this.$page.frontmatter.meta);return t||(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(t,e){for(let n=0;nn||(t.hash?!Wn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(t.hash)}:{x:0,y:0})});!function(t){t.beforeEach((e,n,r)=>{if(Gs(t,e.path))r();else if(/(\/|\.html)$/.test(e.path))if(/\/$/.test(e.path)){const n=e.path.replace(/\/$/,"")+".html";Gs(t,n)?r(n):r()}else r();else{const n=e.path+"/",o=e.path+".html";Gs(t,o)?r(o):Gs(t,n)?r(n):r()}})}(n);const r={};try{await Promise.all(Hs.filter(t=>"function"==typeof t).map(e=>e({Vue:Wn,options:r,router:n,siteData:Ds,isServer:t})))}catch(t){console.error(t)}return{app:new Wn(Object.assign(r,{router:n,render:t=>t("div",{attrs:{id:"app"}},[t("RouterView",{ref:"layout"}),t("div",{class:"global-ui"},qs.map(e=>t(e)))])})),router:n}}(!1).then(({app:t,router:e})=>{e.onReady(()=>{t.$mount("#app")})})}]); \ No newline at end of file diff --git a/index.html b/index.html index 3b8ffad..e8c03e2 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ - + @@ -38,6 +38,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/service-worker.js b/service-worker.js index bae4988..c452144 100644 --- a/service-worker.js +++ b/service-worker.js @@ -27,151 +27,151 @@ self.addEventListener('message', (event) => { self.__precacheManifest = [ { "url": "1.x/advanced/events.html", - "revision": "1257ef7b500849898b3a7376c14392fa" + "revision": "9a6f9957b8cc4d1c15be36d26b306049" }, { "url": "1.x/advanced/helpers.html", - "revision": "13af2743d171a3c6f75d2c16ab648868" + "revision": "b75402a8bf07b91f20c0ff71f635fbf9" }, { "url": "1.x/advanced/index.html", - "revision": "ea1e7e32cdaf5279ddb9107f6b2c1e8e" + "revision": "36675be4d5936f949ce897698e9fd271" }, { "url": "1.x/advanced/override-core-model.html", - "revision": "f19b4501a42b64ae3a4afc66e328ca34" + "revision": "aac4917d518ef52c83e0949cdc0197be" }, { "url": "1.x/advanced/render-event.html", - "revision": "e50bd8ee432a7bf7a2e86af0aeabe537" + "revision": "abaef788a2c6b98534caa772491b4d8e" }, { "url": "1.x/advanced/security-practice.html", - "revision": "224b3232636137db1a0aed8c4c5d675b" + "revision": "045f9e119830aebd7b6e64785e50d95d" }, { "url": "1.x/api/getting-started-with-the-api.html", - "revision": "34ca26e6abd489a0c694b0d176cb7b8e" + "revision": "30b7d6ef16f4bdd34b094c96c9c4688e" }, { "url": "1.x/api/index.html", - "revision": "f9facc71aeac672be188749f911f5d79" + "revision": "8795e435fdd5f138b8dc76264cba7bdb" }, { "url": "1.x/architecture/index.html", - "revision": "3c1be2a1a25493f5513f3d4bfd0433ef" + "revision": "39f022a877035952cd01a08ad674be37" }, { "url": "1.x/architecture/modular-design.html", - "revision": "866b017d6b662b678b1272e87e61ebaf" + "revision": "37e399305f0446d04dc6a2a4ddcf3ca2" }, { "url": "1.x/architecture/packages.html", - "revision": "b2c85538438b61a76d9ad0cd968dedb5" + "revision": "9e762a1dfac5aa945bf2f4c6cc5b109d" }, { "url": "1.x/architecture/repository-pattern.html", - "revision": "5d0f09e6343e9b9734ab90cc9c9ee98a" + "revision": "95fba3857565dff7eb3a813262a54490" }, { "url": "1.x/architecture/theme.html", - "revision": "f416ea135ee7f340858912fecc1ad976" + "revision": "d2bc35f26d6d2f742591c67be985a660" }, { "url": "1.x/custom-attributes/custom-attribute.html", - "revision": "4b808ba0b6814acf237a02b0d9a9bd85" + "revision": "d53a279b2f50e3afb7f0b0601e2f3440" }, { "url": "1.x/custom-attributes/index.html", - "revision": "fad39a2b76559550c793ad776be5d09b" + "revision": "7b9235dfc3a490d6438eb2fd977c45c1" }, { "url": "1.x/custom-attributes/uses.html", - "revision": "3cc3737b95949e06283129c3f3d8b8f9" + "revision": "55c8ea38070eb5e7ed0f6dc1f5e7cb23" }, { "url": "1.x/introduction/docker.html", - "revision": "a99e22ccfd8b565fda12e3b19b19a2c6" + "revision": "5a7d884529c9af04f7aa915694535a5d" }, { "url": "1.x/introduction/index.html", - "revision": "42d31bda1aaddd0ed4381c4d3c8b9af3" + "revision": "2ddac9688d919bc30825bdb169b0b318" }, { "url": "1.x/introduction/installation.html", - "revision": "68ec82e98d830f9bda9c540f83d2b03f" + "revision": "d5719df7eaa048423334ec6661950b1e" }, { "url": "1.x/introduction/requirements.html", - "revision": "2b09ec0ba009bfaec317f2b2c85c021e" + "revision": "1e52edc3f14998734b3584ea1b057776" }, { "url": "1.x/introduction/upgrade-to-latest-bagisto.html", - "revision": "c0b412b01c1376ff60bdae400cd5b018" + "revision": "00ae37d0975bdc5dfeb19164e03944a2" }, { "url": "1.x/packages/add-menu-in-admin.html", - "revision": "ec382e73b38f79c10d8e28b781315ae1" + "revision": "a0632409db5ea4d4016f33364b3fa481" }, { "url": "1.x/packages/assets.html", - "revision": "81cf88e620e02336fe6d21fe725cf14b" + "revision": "647fbf9b4ff8ae209b82948c329f8223" }, { "url": "1.x/packages/controllers.html", - "revision": "a24c22a90d2b73ade664ae1a5f2d22bb" + "revision": "81cdc3f00ed8db6b8a17bd4611d79c24" }, { "url": "1.x/packages/create-acl.html", - "revision": "0960fafebf9a94d236805b2cbf9938b2" + "revision": "86aec942c0e646d89f62e2de8a37ec4a" }, { "url": "1.x/packages/create-migrations.html", - "revision": "a2d5c8435a94c491dfe6a4e05b1182e6" + "revision": "7822ac20cf31ea265c9e38ccf3578c2c" }, { "url": "1.x/packages/create-models.html", - "revision": "5364836f458d4d821238b2942f3a8f87" + "revision": "c7a060b54112e65eb712a965d3db33f9" }, { "url": "1.x/packages/create-package.html", - "revision": "b8339fb7bfb0cc3b3633ff08da86e0d2" + "revision": "6363e27d459d2879cc6d261fce797d02" }, { "url": "1.x/packages/datagrid.html", - "revision": "67eea16f9f4b0d7ec076eeec255e694d" + "revision": "b6359827a1796ef42616433b838cd429" }, { "url": "1.x/packages/index.html", - "revision": "aee384d98e5469c709559999c7b69e6b" + "revision": "66716bd053ac3835f9cf0718c0b4fb1d" }, { "url": "1.x/packages/layouts.html", - "revision": "8e7032dcbe62e847ff5cedc855a98d0e" + "revision": "4532fba3d8f4396d71d54c5dff47d089" }, { "url": "1.x/packages/localization.html", - "revision": "6dbe842eb3f6ba0cb384d49465b4c0d3" + "revision": "3abd3254c94a989e65facdb809b0071d" }, { "url": "1.x/packages/routes.html", - "revision": "830a4a12f1496ca9552797897aafeb38" + "revision": "f4bce100908ecb1806d905abee66dcdd" }, { "url": "1.x/packages/store-data-through-repositories.html", - "revision": "89cf6ab712c40c479ad6edcbb3da79a5" + "revision": "5ad1521f1ae594c9649f54bb20196038" }, { "url": "1.x/packages/validation.html", - "revision": "c260de8c3f65a19fc9459970122ab244" + "revision": "3e76a3d348ae070fbf29183c19fefa86" }, { "url": "1.x/packages/views.html", - "revision": "5a48977afe0ad5aff93ea319c9d7ec45" + "revision": "19930ac67bbb4fa933c240633a4f5ab1" }, { "url": "404.html", - "revision": "491f6044b9089e24a6bbfef494abc8f7" + "revision": "1de175be67a003d59a0b3b47066775ae" }, { "url": "assets/css/0.styles.a79998da.css", @@ -226,8 +226,8 @@ self.__precacheManifest = [ "revision": "c0da7c230039ffc31d602accceac17c8" }, { - "url": "assets/js/14.e72960fa.js", - "revision": "715e8fa10a81268c3276a4c567becbd9" + "url": "assets/js/14.9fe61dd3.js", + "revision": "ffa0ebd4441572f94344e2570c3e2fee" }, { "url": "assets/js/15.2636a4e7.js", @@ -258,8 +258,8 @@ self.__precacheManifest = [ "revision": "a5fdf0314c6f81bc378bbf0b0ebf9c7a" }, { - "url": "assets/js/21.5b6eadf2.js", - "revision": "97752525ad73f72df4dd87db4c23416b" + "url": "assets/js/21.22b0536d.js", + "revision": "d76ef05f8d304f7b678fb95af09c5c3f" }, { "url": "assets/js/22.53075cde.js", @@ -274,24 +274,24 @@ self.__precacheManifest = [ "revision": "5d93635482cbeab18537bad1c9ccf2ff" }, { - "url": "assets/js/25.b13100a3.js", - "revision": "165f8c377aa45e3e8d58db8b3eaeb77e" + "url": "assets/js/25.3abc1e83.js", + "revision": "223ef9e8997a50f1b01dcd29415bcb30" }, { - "url": "assets/js/26.fdef7c6a.js", - "revision": "3c0f9e8384aa51a05db8d0e56279b3dc" + "url": "assets/js/26.fa7a70ef.js", + "revision": "2dd00b2447b149ab5bf2b8bb2af9edaa" }, { - "url": "assets/js/27.53f5eed3.js", - "revision": "d818b862242082ea28e449d21da819c4" + "url": "assets/js/27.5887633f.js", + "revision": "8b318b76c9504548ded928011cff13c4" }, { - "url": "assets/js/28.f9d5b92f.js", - "revision": "cdd0f20c55a4ab09bd404616ea97eb92" + "url": "assets/js/28.bdd80b37.js", + "revision": "1ea61d49755b583285e7b1a2a2ec32dc" }, { - "url": "assets/js/29.192a8672.js", - "revision": "023020b1df8b5e76541b9fc5e2c5d315" + "url": "assets/js/29.4b08399e.js", + "revision": "2a55f29e5bf5bdaf4f96b723a5f216f8" }, { "url": "assets/js/3.7b074b0f.js", @@ -310,76 +310,76 @@ self.__precacheManifest = [ "revision": "521e91a1819c581254626b2a25005f4d" }, { - "url": "assets/js/33.b3c0de1f.js", - "revision": "579a6267f4779412c8450664686a06b6" + "url": "assets/js/33.9816133b.js", + "revision": "05ec6ce3252b92ee1a3549b40a2a0e39" }, { - "url": "assets/js/34.6cb9f5e1.js", - "revision": "27e57b160da8f075b3e07bdd5d3bb302" + "url": "assets/js/34.e36dc895.js", + "revision": "255b781969813c67bad73c276514bedc" }, { - "url": "assets/js/35.c544496e.js", - "revision": "91df73aa227d13926e80364e71edacce" + "url": "assets/js/35.54f27612.js", + "revision": "112f9019728ccab6e8c7ebd5e5fe88be" }, { - "url": "assets/js/36.650631ed.js", - "revision": "6d2295ef3a44cb51305878d7ddd7f6b6" + "url": "assets/js/36.7999bc44.js", + "revision": "c847662dceb7b964a1210f03e4c3219e" }, { "url": "assets/js/37.b5a49134.js", "revision": "72379b0c88f34e744e054b09fc8456f4" }, { - "url": "assets/js/38.3bbdeecf.js", - "revision": "19463e6d4694718bcb257eb2ca518588" + "url": "assets/js/38.804ded6f.js", + "revision": "51758c4a91d710093e39e1e5be040ecc" }, { - "url": "assets/js/39.6f2f06d0.js", - "revision": "0349ce1e4a606ea83bbb80a177c8cb1d" + "url": "assets/js/39.f2e156ac.js", + "revision": "324d3eee9b09db4bed8516e3351ac3e5" }, { "url": "assets/js/4.cc6092b9.js", "revision": "a663fb5c0a6a178c54e85505ff4d911c" }, { - "url": "assets/js/40.3c777840.js", - "revision": "036862490bbe705cc84deaea08fe04eb" + "url": "assets/js/40.bad1cd62.js", + "revision": "41e93b6375b77259648232b639ce4e48" }, { - "url": "assets/js/41.7c677cd8.js", - "revision": "0e59c0439c8150f169c23411eb202a7b" + "url": "assets/js/41.528a517a.js", + "revision": "526d871c38e1cd2d578e9f00e1f8258a" }, { - "url": "assets/js/42.9745a024.js", - "revision": "7a5887c6681b9b03847a5fe592fa94e1" + "url": "assets/js/42.1fbc1407.js", + "revision": "d2273b8fafd9cffef9361131e66cf2da" }, { - "url": "assets/js/43.fd1dad19.js", - "revision": "c2028379cf065d90dd5c4887c70a8f58" + "url": "assets/js/43.bb5be4b5.js", + "revision": "7a05a5075c5f12d5198c282f47325ad8" }, { - "url": "assets/js/44.aecf5f79.js", - "revision": "6b5cc93347907ef75525d87649fa3139" + "url": "assets/js/44.84e2eb55.js", + "revision": "4f3ff62cf53b8a99ce7f438a58d23369" }, { "url": "assets/js/45.04f52ffa.js", "revision": "57b0e44afae7c4d8be2ca752d041ab1a" }, { - "url": "assets/js/46.709a3041.js", - "revision": "f5586250ab7500bc91bf7d53b5826a11" + "url": "assets/js/46.8385a633.js", + "revision": "80a64dcd619db0bb7cd6d6a9e30e223f" }, { - "url": "assets/js/47.1ec640e9.js", - "revision": "067088b2b384585ac08e1e71fb2cc988" + "url": "assets/js/47.6a8acc46.js", + "revision": "ceb2f32ce724f7a555c35611185ddfc9" }, { - "url": "assets/js/48.fabb7629.js", - "revision": "8d8a8093855bfc14d128c2f5421eb7ec" + "url": "assets/js/48.60a37f0b.js", + "revision": "b606fc1a97f30ede31e29a935b2eea9d" }, { - "url": "assets/js/49.4787fee0.js", - "revision": "9968cb5f9dcd877ecf9d83dda77efd53" + "url": "assets/js/49.0ce5ac3f.js", + "revision": "e9f7797c950e800728e1c0061ddc973f" }, { "url": "assets/js/5.0e6a8629.js", @@ -390,12 +390,12 @@ self.__precacheManifest = [ "revision": "d0a5baa7d49667d5a965e4992e9ee0da" }, { - "url": "assets/js/51.551531a2.js", - "revision": "88064f0fcb4de51d254cfd39ed6ebb50" + "url": "assets/js/51.529357c2.js", + "revision": "3ed669c4701c5048e09f25d13f388a2c" }, { - "url": "assets/js/52.c4db90f6.js", - "revision": "96b9af61d411afe9b57cfd4bb64c4752" + "url": "assets/js/52.da80d54a.js", + "revision": "f0b3b8d06ec2206699f77f6f563792e8" }, { "url": "assets/js/53.7aad71f2.js", @@ -406,12 +406,12 @@ self.__precacheManifest = [ "revision": "7331348c3b9e54ab2f523c35c92c6437" }, { - "url": "assets/js/55.fb5ba6ab.js", - "revision": "ef7d60f6f94b4580730d3882f8a928d8" + "url": "assets/js/55.2a96f054.js", + "revision": "40a16be93a7d281c31c9b760a2ce366c" }, { - "url": "assets/js/56.f5780b89.js", - "revision": "1da7326e8b1d2a9a5100df17d58bc9b1" + "url": "assets/js/56.6a018368.js", + "revision": "8540ab2c08e865c973f033d2c3816c6d" }, { "url": "assets/js/57.9467add1.js", @@ -426,8 +426,8 @@ self.__precacheManifest = [ "revision": "4ccf1071a6c887660c5ed167472f0b4a" }, { - "url": "assets/js/app.255df903.js", - "revision": "6f66f2005003459faee06fc09dd7810e" + "url": "assets/js/app.6fd5b9b0.js", + "revision": "dff854906e60d545b8330ae010e34050" }, { "url": "assets/js/vendors~docsearch.df01eec3.js", @@ -435,7 +435,7 @@ self.__precacheManifest = [ }, { "url": "index.html", - "revision": "5c14dcf07ab6a1662936b8c12eaae3ee" + "revision": "4eab8741cca9858368e87597281520f4" }, { "url": "logo.svg",