FormEntryManager::routes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace FormEntries;
4
5
use Illuminate\Support\Facades\Route;
6
7
class FormEntryManager
8
{
9
    /**
10
     * Indicates if laravel should run migrations for package.
11
     *
12
     * @var bool
13
     */
14
    public static bool $runsMigrations = true;
15
16
    /**
17
     * Configure laravel to not register current package migrations.
18
     *
19
     * @return static
20
     */
21 1
    public static function ignoreMigrations(): static
22
    {
23 1
        static::$runsMigrations = false;
24
25 1
        return new static;
26
    }
27
28 22
    public function routes(): static
29
    {
30 22
        Route::post(
31 22
            config('forms-entries.routing.path'),
32 22
            \FormEntries\Http\Controllers\SendFormEntryController::class
33 22
        )->name('forms-entries.submit');
34
35 22
        return $this;
36
    }
37
}
38