Cars information package

v1.6 2025-02-28 09:21 UTC

This package is auto-updated.

Last update: 2025-04-28 09:42:22 UTC


README

GitHub Repo Size GitHub License GitHub Stars GitHub Issues

A simple PHP package for managing car manufacturers' data in multiple formats (JSON, CSV, XML). Supports data retrieval, conversion, and validation with robust error handling.

📦 Installation

Install the package via Composer:

composer require sherifsheremetaj/cars

🚀 Usage

1️⃣ Retrieve Manufacturers

use SherifSheremetaj\Cars\Enums\DataTypes;
use SherifSheremetaj\Cars\Manufactures;

#JSON data
$manufactures = new Manufactures();
$data = $manufactures->getManufactures(DataTypes::JSON);

echo $data . PHP_EOL;

#CSV data
$manufactures = new Manufactures();
$data = $manufactures->getManufactures(DataTypes::CSV);

echo $data . PHP_EOL;

#XML data
$manufactures = new Manufactures();
$data = $manufactures->getManufactures(DataTypes::XML);

echo $data . PHP_EOL;

1️⃣ Retrieve CarTypes

use SherifSheremetaj\Cars\CarTypes;
use SherifSheremetaj\Cars\Enums\DataTypes;

#JSON data
$carTypes = new CarTypes();
$data = $carTypes->getTypes(DataTypes::JSON);

echo $data;

#CSV data
$carTypes = new CarTypes();
$data = $carTypes->getTypes(DataTypes::CSV);

echo $data;

#XML data
$carTypes = new CarTypes();
$data = $carTypes->getTypes(DataTypes::XML);

echo $data;

🛠 Configuration

By default, data is loaded from:

__DIR__ . '/data/....';

Running Tests

To run the PHPUnit test suite, use:

composer install
vendor/bin/phpunit

To run lint (Laravel pint), use

composer pint

🔍 Data Source

Logo images are crawled from Carlogos.org and processed for optimal usage.

📝 Contributing

Pull requests are welcome! To contribute:

  1. Fork the repository.
  2. Create a new feature branch (git checkout -b feature-name).
  3. Commit your changes (git commit -m "Added feature X").
  4. Push to the branch (git push origin feature-name).
  5. Open a pull request.

📜 License

This package is licensed under the MIT License.

Support & Feedback

If you find this package helpful, please ⭐ star the repository! For suggestions or issues, open an issue.

Made with ❤️ by Sherif Sheremetaj