PHPackages                             tristanward/laravel-workable - 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. tristanward/laravel-workable

ActiveLibrary

tristanward/laravel-workable
============================

A Laravel wrapper for the Workable API. Easily access and cache Workable vacancies from your Workable account using the official Workable API.

1.1.0(7y ago)2762[1 issues](https://github.com/tristanward/laravel-workable/issues)MITPHP

Since Jan 6Pushed 6y agoCompare

[ Source](https://github.com/tristanward/laravel-workable)[ Packagist](https://packagist.org/packages/tristanward/laravel-workable)[ RSS](/packages/tristanward-laravel-workable/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

Laravel Workable
================

[](#laravel-workable)

A Laravel wrapper for the Workable API. Easily access and cache Workable vacancies from your Workable account using the official Workable API.

Installation
------------

[](#installation)

Install via composer:

```
$ composer require tristanward/laravel-workable

```

Configuration
-------------

[](#configuration)

Laravel Workable requires your Workable account `subdomain` and an `access token` for your account. For help finding these details please refer to the official Workable API documentation:

The Workable `subdomain` and `access token` should be configured in the Laravel `.env` file:

```
WORKABLE_SUBDOMAIN=your-sub-domain
WORKABLE_ACCESS_TOKEN=your-access-token

```

Cache Workable Vacancies
------------------------

[](#cache-workable-vacancies)

Workable vacancies can be cached to limit calls to the Workable API. To do this a `workable_vacancies` table must first be created using the included migration:

```
php artisan migrate

```

To cache all Workable vacancies use the `laravel-workable:cache` console command. This command will remove all previously cached vacancies and replace them with the current published vacancies.

```
php artisan laravel-workable:cache

```

This command can be used in Laravel's default scheduler, for example to cache all published Workable vacancies at 03:00 on Sundays:

```
// App/Console/Kernel.php

use Tristanward\LaravelWorkable\Console\LaravelWorkableCache;

protected $commands = [
    ...
    LaravelWorkableCache::class,
];

protected function schedule(Schedule $schedule)
{
    ...
    $schedule->command('laravel-workable:cache')
        ->sundays()
        ->at('03:00');
}
```

Using cached Workable vacancies
-------------------------------

[](#using-cached-workable-vacancies)

Once Workable vacancies have been cached they can be used like a normal Laravel eloquent model:

```
