-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
113 additions
and
22 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"/app.js": "/app.js?id=cac522b00977fe684e6c", | ||
"/app.js": "/app.js?id=1e7802b8e9706be294d9", | ||
"/manifest.js": "/manifest.js?id=8991394a854ee5cdffc3", | ||
"/vendor.js": "/vendor.js?id=df0be4950fcb717193ba" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
|
||
namespace SmallRuralDog\Admin\Form; | ||
|
||
|
||
use SmallRuralDog\Admin\Form; | ||
use SmallRuralDog\Admin\Layout\Row; | ||
use SmallRuralDog\Admin\Traits\AdminJsonBuilder; | ||
|
||
class FormTab extends AdminJsonBuilder | ||
{ | ||
protected $name; | ||
protected $rows = []; | ||
protected $form; | ||
|
||
public function __construct($name,Form $form) | ||
{ | ||
$this->name = $name; | ||
$this->form = $form; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* @param mixed $name | ||
* @return FormTab | ||
*/ | ||
public function name($name) | ||
{ | ||
$this->name = $name; | ||
return $this; | ||
} | ||
|
||
|
||
/** | ||
* @param Row|\Closure $closure | ||
* @return $this | ||
*/ | ||
public function row($closure) | ||
{ | ||
if ($closure instanceof \Closure) { | ||
$row = new Row(); | ||
call_user_func($closure, $row, $this->form); | ||
$this->rows = collect($this->rows)->add($row); | ||
} else { | ||
$this->rows = collect($this->rows)->add($closure); | ||
} | ||
return $this; | ||
} | ||
|
||
public function jsonSerialize() | ||
{ | ||
return ['name' => $this->name, 'rows' => $this->rows]; | ||
} | ||
|
||
|
||
} |