/twill-capsule-cities

A Twill Capsule to manage Cities

Primary LanguagePHPMIT LicenseMIT

Cities Capsule

A Twill Capsule to help you manage a list of Cities

screenshot

screenshot

Description

This is a simple and translatable list of cities.

Please make sure your users have the proper permissions to edit/unpublish the homepage.

Installing

You can clone, copy the zip or do it via

php artisan twill:capsule:install cities

Enable the Capsule adding it to config/twill.php

return [
    'capsules' => [
        'list' => [
            [
                'name' => 'Cities',
                'enabled' => true,
            ],
            ...
        ],
    ],

Navigation

Add this to twill-navigation.php to make your homepage link go directly to the edit page:

return [
    'destinations' => [
        'title' => 'Destinations',

        'route' => 'admin.destinations.countries.index',

        'primary_navigation' => [
            'countries' => [
                'title' => 'Countries',
                'module' => true,
            ],

            'cities' => [
                'title' => 'Cities',
                'module' => true,
            ],
        ],
    ],
];

Seeder

This Capsule contains a seeder to seed cities and countries, to use use it, you just need to call on your databaase/seeders/DatabaseSeeder.php:

<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Twill\Capsules\Countries\Database\Seeds\DatabaseSeeder as CountriesDatabaseSeeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        app(CountriesDatabaseSeeder::class)->run();
    }
}

It depends on Countries and ForceUTF8 packages that can be installed using:

composer require pragmarx/countries
composer require neitanod/forceutf8

Dependencies