Skip to content

ItsTarikBTW/zpl-library-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0f6be94 · May 25, 2024

History

4 Commits
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 25, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 24, 2024
May 25, 2024

Repository files navigation

Laravel ZPL Library Demo

X SVG

Project Structure

zpl-library-demo/
├── app/
│   ├── Http/
│   │   ├── Controllers/
│   │   │   └── ZplController.php
│   ├── Models/
│   │   └── Template.php
├── database/
│   ├── migrations/
│   │   ├── 2024_05_24_185822_create_templates_table.php
│   └── seeds/
│       └── TemplateSeeder.php
├── public/
│   └── assets/
│       └── john.png
│       └── tarik.png
├── resources/
├── routes/
│   └── web.php
├── storage/
│   └── app/
│       └── templates/
│           └── designTmp.zpl
│           └── sample1.xml
│           └── sample2.xml
│           └── templateSchema.xsd
│       └── zpl/
├── tests/
├── .env.example
├── composer.json
├── phpunit.xml
└── README.md
└── postman_collection.json

Overview

This project is a Laravel-based library for generating ZPL files from XML templates and dynamic data.

Installation

  1. Clone the repository:

    git clone https://github.com/itsTarikBTW/zpl-library-demo.git
    cd zpl-library-demo
  2. Install dependencies:

    composer install
  3. Set up the environment:

    cp .env.example .env
    php artisan key:generate
  4. Configure your .env file with your database credentials.

  5. Run migrations:

    php artisan migrate
  6. Seed the database with an example template (optional):

    php artisan db:seed --class=TemplateSeeder
  7. Import the Postman collection to test the API.

Usage

  1. Start the Laravel development server:

    php artisan serve
  2. Send a POST request to /upload-template with a name and a file named template to upload a new template.

  3. Send a POST request to /generate-zpl/{id} with dynamic data to generate ZPL.

Testing

Run the following command to run the tests:

php artisan test

Worning

This project is a demo and should not be used in production. The CSRF middleware is disabled for demonstration purposes.

License

This project is open-source software licensed under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published