File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ public static function makeEmptyHelper($name)
31
31
if (!File::isDirectory ($ path = (new self )->getHelperDirectory ()))
32
32
mkdir ($ path , 0777 , true );
33
33
34
+ dd ((new self )->ensureHelperDoesntAlreadytExist ($ name ));
35
+
34
36
$ template = (new self )->getEmptyHelperStub ();
35
37
36
38
file_put_contents ((new self )->getHelperFilePath ($ name ), $ template );
Original file line number Diff line number Diff line change 2
2
3
3
namespace Miladimos \Toolkit \Traits ;
4
4
5
- use InvalidArgumentException ;
6
5
7
6
trait ValidateModel
8
7
{
9
8
10
9
protected function ensureHelperDoesntAlreadytExist ($ file )
11
10
{
12
- if (file_exists ($ this ->getHelperPath ($ file ), false )) {
13
- throw new InvalidArgumentException ( "{ $ file } already exists. " ) ;
11
+ if (! file_exists ($ this ->getHelperFilePath ($ file ))) {
12
+ return false ;
14
13
}
14
+
15
+ return true ;
15
16
}
16
17
}
You can’t perform that action at this time.
0 commit comments