/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$path = $this->getFilePath();
$directory = dirname($path);
if ($this->file->exists($path)) {
$this->error("A view already exists at {$path}!");
return false;
}
if (!$this->file->exists($directory)) {
$this->file->makeDirectory($directory, 0777, true);
}
$this->file->put($path, $this->getViewContents());
$this->info("Created a new view at {$path}");
}