|
@@ -311,8 +311,13 @@ class GenController {
|
|
|
$newMethod->data[] = $method->data[$i];
|
|
|
}
|
|
|
$newMethod->parentSub = $this->name . '-' . $method->name;
|
|
|
- $newMethod->table = explode(":", $method->data[1])[1];
|
|
|
+ $parts = explode(":", $method->data[1]);
|
|
|
+ $newMethod->table = $parts[1];
|
|
|
+ if(count($parts) === 3) {
|
|
|
+ $newMethod->api = $parts[2];
|
|
|
+ }
|
|
|
$newMethod->exitURL = $method->exitURL;
|
|
|
+ $newMethod->showLink = false;
|
|
|
$newMethods[] = $newMethod;
|
|
|
$method->childAddRoute = $this->name . '-' . $methodName;
|
|
|
}
|
|
@@ -461,7 +466,7 @@ class GenController {
|
|
|
$subLinksView = resource_path("views/{$controller->root}/{$controller->parentControllerName}/subs.blade.php");
|
|
|
$subLinks = [];
|
|
|
foreach ($controller->methods as $meth) {
|
|
|
- if (strpos($meth->name, "SUB_") !== 0) continue;
|
|
|
+ if (strpos($meth->name, "SUB_") !== 0 || $meth->showLink === false) continue;
|
|
|
$display = $this->snakeToTitleCase(substr($meth->name, 4));
|
|
|
$subLinks[] = ($meth->show ? "@if(\$record->{$meth->show}) " : "") .
|
|
|
"<a " .
|
|
@@ -486,7 +491,7 @@ class GenController {
|
|
|
$actionLinksView = resource_path("views/{$controller->root}/{$controller->parentControllerName}/actions.blade.php");
|
|
|
$actionLinks = [];
|
|
|
foreach ($controller->methods as $meth) {
|
|
|
- if (strpos($meth->name, "ACTION_") !== 0) continue;
|
|
|
+ if (strpos($meth->name, "ACTION_") !== 0 || $meth->showLink === false) continue;
|
|
|
$display = $this->camelToTitleCase(substr($meth->name, 7));
|
|
|
$actionLinks[] = ($meth->show ? "@if(\$record->{$meth->show}) " : "") .
|
|
|
"<a " .
|
|
@@ -522,7 +527,7 @@ class GenController {
|
|
|
$text = str_replace("_API_", "/api/{$this->snakeToCamelCase($controller->dbTable)}/" . substr($method->name, 7), $text);
|
|
|
}
|
|
|
else {
|
|
|
- $text = str_replace("_API_", "/api/{$this->snakeToCamelCase($method->table)}/create", $text);
|
|
|
+ $text = str_replace("_API_", "/api/{$this->snakeToCamelCase($method->table)}/{$method->api}", $text);
|
|
|
}
|
|
|
|
|
|
$text = str_replace("_RETURN_ROUTE_", "{$controller->name}-{$method->name}", $text);
|
|
@@ -749,6 +754,7 @@ class GenControllerMethod {
|
|
|
public $show = null;
|
|
|
public $viewURL = false;
|
|
|
public $exitURL = false;
|
|
|
+ public $showLink = true;
|
|
|
public function __construct($name, $route)
|
|
|
{
|
|
|
$this->name = $name;
|