add nova
This commit is contained in:
26
nova/src/Console/Concerns/AcceptsNameAndVendor.php
Normal file
26
nova/src/Console/Concerns/AcceptsNameAndVendor.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Nova\Console\Concerns;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait AcceptsNameAndVendor
|
||||
{
|
||||
/**
|
||||
* Determine if the name argument is valid.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasValidNameArgument()
|
||||
{
|
||||
$name = $this->argument('name');
|
||||
|
||||
if (! Str::contains($name, '/')) {
|
||||
$this->error("The name argument expects a vendor and name in 'Composer' format. Here's an example: `vendor/name`.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user