This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from lextira/laravel-7.x
Laravel 7.x update
- Loading branch information
Showing
12 changed files
with
69 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
|
||
namespace Lucid\Console\Components; | ||
|
||
use Lucid\Console\Str; | ||
|
||
/** | ||
* @author Abed Halawi <[email protected]> | ||
*/ | ||
|
@@ -20,7 +22,7 @@ public function __construct($name, $realPath, $relativePath) | |
{ | ||
$this->setAttributes([ | ||
'name' => $name, | ||
'slug' => snake_case($name), | ||
'slug' => Str::snake($name), | ||
'realPath' => $realPath, | ||
'relativePath' => $relativePath, | ||
]); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Lucid\Console\Http; | ||
|
||
use Lucid\Console\Finder; | ||
|
||
class Controller | ||
{ | ||
use Finder; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,36 @@ | |
|
||
namespace Lucid\Console; | ||
|
||
use Illuminate\Support\Str as LaravelStr; | ||
|
||
/** | ||
* @author Abed Halawi <[email protected]> | ||
*/ | ||
class Str | ||
{ | ||
/** | ||
* Convert a value to studly caps case. | ||
* | ||
* @param string $value | ||
* @return string | ||
*/ | ||
public static function studly($value) | ||
{ | ||
return LaravelStr::studly($value); | ||
} | ||
|
||
/** | ||
* Convert a string to snake case. | ||
* | ||
* @param string $value | ||
* @param string $delimiter | ||
* @return string | ||
*/ | ||
public static function snake($value, $delimiter = '_') | ||
{ | ||
return LaravelStr::snake($value, $delimiter); | ||
} | ||
|
||
/** | ||
* Determine the real name of the given name, | ||
* excluding the given pattern. | ||
|
@@ -47,7 +72,7 @@ public static function realName($name, $pattern = '//') | |
*/ | ||
public static function feature($name) | ||
{ | ||
return studly_case(preg_replace('/Feature(\.php)?$/', '', $name).'Feature'); | ||
return self::studly(preg_replace('/Feature(\.php)?$/', '', $name).'Feature'); | ||
} | ||
|
||
/** | ||
|
@@ -63,7 +88,7 @@ public static function feature($name) | |
*/ | ||
public static function job($name) | ||
{ | ||
return studly_case(preg_replace('/Job(\.php)?$/', '', $name).'Job'); | ||
return self::studly(preg_replace('/Job(\.php)?$/', '', $name).'Job'); | ||
} | ||
|
||
/** | ||
|
@@ -79,7 +104,7 @@ public static function job($name) | |
*/ | ||
public static function operation($name) | ||
{ | ||
return studly_case(preg_replace('/Operation(\.php)?$/', '', $name).'Operation'); | ||
return self::studly(preg_replace('/Operation(\.php)?$/', '', $name).'Operation'); | ||
} | ||
|
||
/** | ||
|
@@ -93,7 +118,7 @@ public static function operation($name) | |
*/ | ||
public static function domain($name) | ||
{ | ||
return studly_case($name); | ||
return self::studly($name); | ||
} | ||
|
||
/** | ||
|
@@ -105,7 +130,7 @@ public static function domain($name) | |
*/ | ||
public static function service($name) | ||
{ | ||
return studly_case($name); | ||
return self::studly($name); | ||
} | ||
|
||
/** | ||
|
@@ -117,7 +142,7 @@ public static function service($name) | |
*/ | ||
public static function controller($name) | ||
{ | ||
return studly_case(preg_replace('/Controller(\.php)?$/', '', $name).'Controller'); | ||
return self::studly(preg_replace('/Controller(\.php)?$/', '', $name).'Controller'); | ||
} | ||
|
||
/** | ||
|
@@ -131,7 +156,7 @@ public static function controller($name) | |
*/ | ||
public static function model($name) | ||
{ | ||
return studly_case($name); | ||
return self::studly($name); | ||
} | ||
|
||
/** | ||
|
@@ -142,7 +167,7 @@ public static function model($name) | |
*/ | ||
public static function policy($name) | ||
{ | ||
return studly_case(preg_replace('/Policy(\.php)?$/', '', $name) . 'Policy'); | ||
return self::studly(preg_replace('/Policy(\.php)?$/', '', $name) . 'Policy'); | ||
} | ||
|
||
/** | ||
|
@@ -153,6 +178,6 @@ public static function policy($name) | |
*/ | ||
public static function request($name) | ||
{ | ||
return studly_case(preg_replace('/Request(\.php)?$/', '', $name) . 'Request'); | ||
return self::studly(preg_replace('/Request(\.php)?$/', '', $name) . 'Request'); | ||
} | ||
} |