<?php

use Illuminate\Database\Migrations\Migration;

class AddPermissionForUpcomingCourse extends Migration
{
    public function up()
    {
        $routes = [
            ['name' => 'Upcoming Courses', 'route' => 'admin.upcoming_courses', 'type' => 1, 'parent_route' => null, 'module' => 'UpcomingCourse'],
            ['name' => 'List', 'route' => 'admin.upcoming_courses.index', 'type' => 2, 'parent_route' => 'admin.upcoming_courses', 'module' => 'UpcomingCourse'],
            ['name' => 'Followers', 'route' => 'admin.upcoming_courses.followers', 'type' => 3, 'parent_route' => 'admin.upcoming_courses.index', 'module' => 'UpcomingCourse'],
            ['name' => 'Pre Booking', 'route' => 'admin.upcoming_courses.pre_booking', 'type' => 3, 'parent_route' => 'admin.upcoming_courses.index', 'module' => 'UpcomingCourse'],
            ['name' => 'Publish', 'route' => 'admin.upcoming_courses.publish', 'type' => 3, 'parent_route' => 'admin.upcoming_courses.index', 'module' => 'UpcomingCourse'],
            ['name' => 'Upcoming Courses', 'route' => 'upcoming_courses', 'type' => 1, 'parent_route' => null, 'backend' => 0, 'module' => 'UpcomingCourse'],

        ];

        if (function_exists('permissionUpdateOrCreate')) {
            permissionUpdateOrCreate($routes);
        }
    }
}
