SitemapGenerateCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 5 1
1
<?php
2
3
namespace Adminetic\Website\Console\Commands;
4
5
use Illuminate\Console\Command;
6
use Spatie\Sitemap\SitemapGenerator;
7
8
class SitemapGenerateCommand extends Command
9
{
10
    /**
11
     * The console command name.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'sitemap:generate';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Generate the sitemap.';
23
24
    /**
25
     * Execute the console command.
26
     *
27
     * @return mixed
28
     */
29
    public function handle()
30
    {
31
        SitemapGenerator::create(config('app.url'))
32
            ->writeToFile(public_path('sitemap.xml'));
33
        $this->info('Sitemap Generated');
34
    }
35
}
36