PHPackages                             christiancocco/swapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. christiancocco/swapi

ActivePackage[API Development](/categories/api)

christiancocco/swapi
====================

Swapi Integration for Laravel

036PHP

Since Apr 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/christiancocco/swapi)[ Packagist](https://packagist.org/packages/christiancocco/swapi)[ RSS](/packages/christiancocco-swapi/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

swapi
=====

[](#swapi)

[![](https://camo.githubusercontent.com/39ad611c3d516a7c1cbab2c25a1247b7181f07adc15303ef9f9bffe558282f42/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f362f36632f537461725f576172735f4c6f676f2e7376672f3132303070782d537461725f576172735f4c6f676f2e7376672e706e67)](https://camo.githubusercontent.com/39ad611c3d516a7c1cbab2c25a1247b7181f07adc15303ef9f9bffe558282f42/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f362f36632f537461725f576172735f4c6f676f2e7376672f3132303070782d537461725f576172735f4c6f676f2e7376672e706e67)

Table of Contents
-----------------

[](#table-of-contents)

1. [About Swapi](#about-swapi)
2. [Technologies](#technologies)
3. [Installing Swapi package](#installing-swapi-package)
4. [Usage](#usage)
5. [Testing](#testing)
6. [License](#license)

About Swapi
-----------

[](#about-swapi)

"Swapi package" is a simple wrapper package that provide the list of people and the information related to a planet accessible using the following APIs:

- GET /api/people (Provide a paginated list of people, filterable and orderable)
- GET /api/people/{peopleId} (Provide selected people data including planet details)

Technologies
------------

[](#technologies)

Laravel 8.\*

#### Dependencies

[](#dependencies)

[guzzlehttp/guzzle](https://github.com/guzzle/guzzle)
[phpunit/phpunit](https://packagist.org/packages/phpunit/phpunit)
[inertiajs/inertia-laravel](https://packagist.org/packages/inertiajs/inertia-laravel)

Install and configure Swapi Package
-----------------------------------

[](#install-and-configure-swapi-package)

To install Swapi package run this command:

```
composer require christiancocco/swapi --with-all-dependencies
```

Now you can configure testing environment file to be able to run test script.

1. Create testing DB
2. Create .env.testing file in your root application folder and change DB connection parameter
3. Add following to phpunit.xml file:

```

            ./vendor/christiancocco/swapi/tests/Unit

            ./vendor/christiancocco/swapi/tests/Feature

```

Usage
-----

[](#usage)

After installation you have to run the following command:

```
php artisan swapi:install
```

This command initialize package (copy configuration file) and run migration for planet and people table.

```
php artisan swapi:init
```

This command initialize data retrieved data from swapi.dev.

(Full documentation: )

NB. To initialize testing database run this command:

```
php artisan migrate --env=testing
```

If you want to filtering, ordering and paging **/api/people** result you can use this querystring parameter:

1. query: string to search in all people fields
2. itemperpage: item per page (default value = 10)
3. page: page number
4. sort: sorting field
5. sortVer: sorting versus (ASC: ascending - default value; DESC: descending)

Example: /api/people?query=fair&amp;sort=name&amp;sortVer=DESC&amp;itemperpage=2&amp;page=2

Testing
-------

[](#testing)

To launch the Unit Test run this command:

```
php artisan test --filter=Swapi --stop-on-failure
```

To test api run

```
php artisan serve
```

and visit

License
-------

[](#license)

The Swapi Laravel package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/90d52a66dd7133a1c867ed89aee3d5d61e588b1920e43ea7ae6dfca879606d09?d=identicon)[christiancocco](/maintainers/christiancocco)

---

Top Contributors

[![christiancocco](https://avatars.githubusercontent.com/u/36890082?v=4)](https://github.com/christiancocco "christiancocco (45 commits)")

---

Tags

laravellaravel-packagephp

### Embed Badge

![Health badge](/badges/christiancocco-swapi/health.svg)

```
[![Health](https://phpackages.com/badges/christiancocco-swapi/health.svg)](https://phpackages.com/packages/christiancocco-swapi)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M453](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
