language: php
sudo: required
dist: trusty
group: edge

php:
  - 7.3
  - 7.4

sudo: false

services:
  - mysql

before_script:
  - mysql -u root -e 'create database laravelblocker;'
  - curl -s http://getcomposer.org/installer | php
  - php composer.phar install
  - composer create-project --prefer-dist laravel/laravel laravelblocker
  - cp .env.travis laravelblocker/.env
  - cd laravelblocker
  - composer self-update
  - composer install --prefer-source --no-interaction
  - composer dump-autoload
  - composer require jeremykenedy/laravel-blocker
  - php artisan key:generate
  - php artisan vendor:publish --provider="jeremykenedy\LaravelBlocker\LaravelBlockerServiceProvider"
  - composer require laravel/ui --dev
  - composer dump-autoload
  - php artisan clear-compiled
  - sudo chgrp -R www-data storage bootstrap/cache
  - sudo chmod -R ug+rwx storage bootstrap/cache
