PHPackages                             iivannov/larasquare - 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. iivannov/larasquare

ActiveLibrary[API Development](/categories/api)

iivannov/larasquare
===================

Simple and extensible Foursquare API PHP Client with Laravel Support based on Guzzle 6

0.1.0(10y ago)85.1k6[1 issues](https://github.com/iivannov/larasquare/issues)[2 PRs](https://github.com/iivannov/larasquare/pulls)MITPHPPHP &gt;=5.5.0CI failing

Since Oct 2Pushed 2y ago2 watchersCompare

[ Source](https://github.com/iivannov/larasquare)[ Packagist](https://packagist.org/packages/iivannov/larasquare)[ Docs](https://github.com/iivannov/larasquare)[ RSS](/packages/iivannov-larasquare/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Larasquare
==========

[](#larasquare)

[![Latest Version on Packagist](https://camo.githubusercontent.com/edf4b001e2eca7b6eb1dc5e49f0535a29a472c14e6291e5c599f1b8d8c78be42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696976616e6e6f762f6c6172617371756172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iivannov/larasquare)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](license.md)[![Total Downloads](https://camo.githubusercontent.com/8824baab9daa4da891e994f7ea0583812eb7e28d3aa85f260852a64940b01b16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696976616e6e6f762f6c6172617371756172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iivannov/larasquare)

Simple and extensible Foursquare API PHP Client with Laravel Facade and ServiceProvider based on Guzzle 6 Currently it supports only userless endpoint requests.

Install
-------

[](#install)

Via Composer

```
$ composer require iivannov/larasquare
```

Usage with Laravel
------------------

[](#usage-with-laravel)

To use the Laravel Facade you need to add the ServiceProvider and Facade classes in your `config\app.php`

```
'providers' => [
    ...
    Iivannov\Larasquare\Provider\LarasquareServiceProvider::class,
];

'aliases' => [
    ...
    'Larasquare' => Iivannov\Larasquare\Facade\Larasquare::class
];
```

You need to add your Foursquare client ID and secret in `config\services.php`

```
'foursquare' => [
    'clientId' => YOUR_FOURSQUARE_CLIENT_ID,
    'clientSecret' => YOUR_FOURSQUARE_CLIENT_SECRET
]
```

After this you can directly use the Laravel Facade

```
$venues = Larasquare::venues($searchQuery);
```

Standard Usage
--------------

[](#standard-usage)

```
$config = [
    clientId = YOUR_FOURSQUARE_CLIENT_ID,
    clientSecretT = YOUR_FOURSQUARE_CLIENT_SECRET,
    apiUrl = FOURSQUARE_API_URL, //optional
    version = SUPPORTED_VERSION, //optional, format: YYYYMMDD
];

$foursquare = new Foursquare($config);

$venues = $foursquare->venues($searchQuery);
```

Query filters
-------------

[](#query-filters)

If you need to generate, filter or transform your search query you can extract all the logic in a separate class that implements the `Iivannov\Larasquare\Filter\FilterContract`and then just inject it with `setFilter()` method.

```
$venues = Larasquare::setFilter(new MyFilter())->venues();
```

Put your filter logic in the parse() method. It will automatically receive the query passed in the search methods. You can overwrite values, generate values from your custom array or whatever you need. The returned array will be sent with the Foursquare request.

```
/**
* Generate, transform or filter your search query
*
* @param $query
* @return array
*/
public function parse($query = [])
{
    return [
        'll' => $query['location']['lat'] . ',' . $query['location']['lon'],
        'query' => $query['searchTerm'],
        'near' => $_GET['nearLocation'],
        'radius' => 200
    ];
}
```

Methods
-------

[](#methods)

\*\* Endpoints not covered by this library \*\* You can use the `request` method to query a Foursquare endpoint.

```
// get venue photos
$response = Larasquare::request("venues/$venueId/photos")

// get details about a tip,
$response = Larasquare::request("tips/$tipId")
```

\*\* Searching Venues \*\*

```
//Laravel
$venues = Larasquare::venues($query);
```

\*\* Get a single venue \*\*

```
$venues = Larasquare::venue($venueId);
```

\*\* Other venues methods \*\*

```
// get suggestion @see https://developer.foursquare.com/docs/venues/suggestcompletion
$venues = Larasquare::suggest($searchQuery);

// get trending @see https://developer.foursquare.com/docs/venues/trending
$venues = Larasquare::trending($searchQuery);
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](license.md) for more information.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3929d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7932620?v=4)[Ivan Ivanov](/maintainers/iivannov)[@iivannov](https://github.com/iivannov)

---

Tags

apiclientlaravelfoursquare

### Embed Badge

![Health badge](/badges/iivannov-larasquare/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M89](/packages/openai-php-laravel)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

74331.3k1](/packages/mozex-anthropic-laravel)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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