@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @param \Illuminate\Http\UploadedFile $file |
| 76 | 76 | * |
| 77 | - * @return \Closure|mixed|null|string |
|
| 77 | + * @return string |
|
| 78 | 78 | */ |
| 79 | 79 | public function getUploadPath(UploadedFile $file) |
| 80 | 80 | { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * |
| 108 | 108 | * @param \Illuminate\Http\UploadedFile $file |
| 109 | 109 | * |
| 110 | - * @return mixed|string |
|
| 110 | + * @return string |
|
| 111 | 111 | */ |
| 112 | 112 | public function getUploadFileName(UploadedFile $file) |
| 113 | 113 | { |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | * |
| 101 | 101 | * @param Request $request |
| 102 | 102 | * |
| 103 | - * @return \Illuminate\Http\Response |
|
| 103 | + * @return \Illuminate\Http\RedirectResponse |
|
| 104 | 104 | */ |
| 105 | 105 | public function logout(Request $request) |
| 106 | 106 | { |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Sco\Admin\Http\Controllers; |
| 4 | 4 | |
| 5 | +use Illuminate\Foundation\Auth\AuthenticatesUsers; |
|
| 5 | 6 | use Illuminate\Foundation\Validation\ValidatesRequests; |
| 6 | 7 | use Illuminate\Http\Request; |
| 7 | 8 | use Illuminate\Routing\Controller; |
| 8 | -use Illuminate\Foundation\Auth\AuthenticatesUsers; |
|
| 9 | 9 | |
| 10 | 10 | class LoginController extends Controller |
| 11 | 11 | { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * Check if the entity have access to delete. |
| 73 | 73 | * |
| 74 | - * @return mixed |
|
| 74 | + * @return boolean |
|
| 75 | 75 | */ |
| 76 | 76 | public function isDelete() |
| 77 | 77 | { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | /** |
| 131 | 131 | * Get the observable ability names. |
| 132 | 132 | * |
| 133 | - * @return array |
|
| 133 | + * @return string[] |
|
| 134 | 134 | */ |
| 135 | 135 | public function getObservableAbilities() |
| 136 | 136 | { |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * register ability to access. |
| 148 | 148 | * |
| 149 | 149 | * @param string $ability |
| 150 | - * @param string|\Closure $callback |
|
| 150 | + * @param string $callback |
|
| 151 | 151 | */ |
| 152 | 152 | public function registerAbility($ability, $callback) |
| 153 | 153 | { |
@@ -3,7 +3,6 @@ discard block |
||
| 3 | 3 | namespace Sco\Admin\Display; |
| 4 | 4 | |
| 5 | 5 | use Sco\Admin\Contracts\Display\ColumnFactoryInterface; |
| 6 | -use Sco\Admin\Traits\AliasBinder; |
|
| 7 | 6 | use Sco\Admin\Display\Columns\Custom; |
| 8 | 7 | use Sco\Admin\Display\Columns\DateTime; |
| 9 | 8 | use Sco\Admin\Display\Columns\Html; |
@@ -12,6 +11,7 @@ discard block |
||
| 12 | 11 | use Sco\Admin\Display\Columns\Mapping; |
| 13 | 12 | use Sco\Admin\Display\Columns\Tags; |
| 14 | 13 | use Sco\Admin\Display\Columns\Text; |
| 14 | +use Sco\Admin\Traits\AliasBinder; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * @method static Text text($name, $label) text type column |
@@ -221,6 +221,10 @@ |
||
| 221 | 221 | return $this->getValueFromObject($this->getModel(), $this->getName()); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | + /** |
|
| 225 | + * @param Model $instance |
|
| 226 | + * @param string $name |
|
| 227 | + */ |
|
| 224 | 228 | protected function getValueFromObject($instance, $name) |
| 225 | 229 | { |
| 226 | 230 | $parts = explode('.', $name); |
@@ -4,18 +4,18 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Illuminate\Support\ServiceProvider; |
| 6 | 6 | use Sco\Admin\Admin; |
| 7 | +use Sco\Admin\Contracts\Display\ColumnFactoryInterface; |
|
| 8 | +use Sco\Admin\Contracts\Display\DisplayFactoryInterface; |
|
| 9 | +use Sco\Admin\Contracts\Display\FilterFactoryInterface; |
|
| 7 | 10 | use Sco\Admin\Contracts\Form\ElementFactoryInterface; |
| 8 | 11 | use Sco\Admin\Contracts\Form\FormFactoryInterface; |
| 9 | 12 | use Sco\Admin\Contracts\RepositoryInterface; |
| 10 | -use Sco\Admin\Contracts\Display\ColumnFactoryInterface; |
|
| 11 | -use Sco\Admin\Contracts\Display\FilterFactoryInterface; |
|
| 12 | -use Sco\Admin\Contracts\Display\DisplayFactoryInterface; |
|
| 13 | +use Sco\Admin\Display\ColumnFactory; |
|
| 14 | +use Sco\Admin\Display\DisplayFactory; |
|
| 15 | +use Sco\Admin\Display\FilterFactory; |
|
| 13 | 16 | use Sco\Admin\Form\ElementFactory; |
| 14 | 17 | use Sco\Admin\Form\FormFactory; |
| 15 | 18 | use Sco\Admin\Repositories\Repository; |
| 16 | -use Sco\Admin\Display\ColumnFactory; |
|
| 17 | -use Sco\Admin\Display\FilterFactory; |
|
| 18 | -use Sco\Admin\Display\DisplayFactory; |
|
| 19 | 19 | |
| 20 | 20 | class AdminServiceProvider extends ServiceProvider |
| 21 | 21 | { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Sco\Admin\Display; |
| 4 | 4 | |
| 5 | -use Illuminate\Database\Eloquent\Builder; |
|
| 6 | 5 | use Illuminate\Database\Eloquent\Model; |
| 7 | 6 | use Illuminate\Support\Collection; |
| 8 | 7 | use Sco\Admin\Contracts\Display\ColumnInterface; |
@@ -220,6 +220,9 @@ discard block |
||
| 220 | 220 | return $model; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | + /** |
|
| 224 | + * @param string $model |
|
| 225 | + */ |
|
| 223 | 226 | protected function getViewColumns($model) |
| 224 | 227 | { |
| 225 | 228 | $columns = $this->getTableColumns($model); |
@@ -250,11 +253,17 @@ discard block |
||
| 250 | 253 | return $column->getComment() ?? studly_case($column->getName()); |
| 251 | 254 | } |
| 252 | 255 | |
| 256 | + /** |
|
| 257 | + * @param string $name |
|
| 258 | + */ |
|
| 253 | 259 | protected function getViewColumnType($name) |
| 254 | 260 | { |
| 255 | 261 | return $this->columnTypeMappings[$name] ?? 'text'; |
| 256 | 262 | } |
| 257 | 263 | |
| 264 | + /** |
|
| 265 | + * @param string $model |
|
| 266 | + */ |
|
| 258 | 267 | protected function getFormElements($model) |
| 259 | 268 | { |
| 260 | 269 | $columns = $this->getTableColumns($model); |
@@ -283,6 +292,9 @@ discard block |
||
| 283 | 292 | ); |
| 284 | 293 | } |
| 285 | 294 | |
| 295 | + /** |
|
| 296 | + * @param string $name |
|
| 297 | + */ |
|
| 286 | 298 | protected function getFormElementType($name) |
| 287 | 299 | { |
| 288 | 300 | return $this->elementTypeMappings[$name] ?? 'text'; |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | - * @return \Illuminate\Database\Eloquent\Model|mixed |
|
| 146 | + * @return Model |
|
| 147 | 147 | */ |
| 148 | 148 | protected function makeModel() |
| 149 | 149 | { |
@@ -2,17 +2,16 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Sco\Admin\Component; |
| 4 | 4 | |
| 5 | -use BadMethodCallException; |
|
| 6 | 5 | use Illuminate\Database\Eloquent\Model; |
| 7 | -use InvalidArgumentException; |
|
| 8 | 6 | use Illuminate\Foundation\Application; |
| 7 | +use InvalidArgumentException; |
|
| 9 | 8 | use Sco\Admin\Component\Concerns\HasAccess; |
| 10 | 9 | use Sco\Admin\Component\Concerns\HasEvents; |
| 11 | 10 | use Sco\Admin\Component\Concerns\HasNavigation; |
| 12 | 11 | use Sco\Admin\Contracts\ComponentInterface; |
| 12 | +use Sco\Admin\Contracts\Display\DisplayInterface; |
|
| 13 | 13 | use Sco\Admin\Contracts\Form\FormInterface; |
| 14 | 14 | use Sco\Admin\Contracts\RepositoryInterface; |
| 15 | -use Sco\Admin\Contracts\Display\DisplayInterface; |
|
| 16 | 15 | |
| 17 | 16 | abstract class Component implements ComponentInterface |
| 18 | 17 | { |