<?php

use ExpressionEngine\Service\Migration\Migration;

class CreateactionerrordetailsajaxforaddonjcogsImgPro extends Migration
{
    /**
     * Execute the migration
     * @return void
     */
    public function up()
    {
        ee('Model')->make('Action', [
            'class' => 'Jcogs_img_pro',
            'method' => 'ErrorDetailsAjax',
            'csrf_exempt' => true, // Allow AJAX calls without CSRF token
        ])->save();
    }

    /**
     * Rollback the migration
     * @return void
     */
    public function down()
    {
        ee('Model')->get('Action')
            ->filter('class', 'Jcogs_img_pro')
            ->filter('method', 'ErrorDetailsAjax')
            ->delete();
    }
}