Skip to content

Commit 93c23df

Browse files
authored
Merge pull request #6 from codecoz/dev
Added Config publish functionality.
2 parents da912d9 + 2c21419 commit 93c23df

File tree

85 files changed

+8048
-7985
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+8048
-7985
lines changed

resources/views/crudboard/show.blade.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<div class="card">
44
<div class="card-header">
55
<h5 class="card-title">
6-
@if($show->getTitle())
7-
{{ $show->getTitle() }}
6+
@if($show->getTitle())
7+
{{ $show->getTitle() }}
88
@else
9-
{{ $attributes['title']}}
9+
{{ $attributes['title']}}
1010
@endif
1111
</h5>
1212
</div>
@@ -21,8 +21,11 @@
2121
@php
2222
$value = $field->getValue() ;
2323
$record = $show->getRecord();
24+
if($formaterFunc = $field->getFormatValueCallable()){
25+
$value = $formaterFunc($value,$record);
26+
}
2427
@endphp
25-
<x-dynamic-component :component="$component" :$value :$record />
28+
<x-dynamic-component :component="$component" :$value :$record/>
2629
@else
2730
{{$field->getValue()}}
2831
@endif

src/Admin.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<?php
2-
3-
namespace CodeCoz\AimAdmin;
4-
5-
class Admin
6-
{
7-
// Build wonderful Aim Admin Package
8-
9-
public static function packagePath($path): string
10-
{
11-
return __DIR__ . "/../$path";
12-
}
13-
14-
}
1+
<?php
2+
3+
namespace CodeCoz\AimAdmin;
4+
5+
class Admin
6+
{
7+
// Build wonderful Aim Admin Package
8+
9+
public static function packagePath($path): string
10+
{
11+
return __DIR__ . "/../$path";
12+
}
13+
14+
}

src/AdminServiceProvider.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function register(): void
5353
$this->interfacesBindings();
5454

5555
// Register user service provider.
56-
// $this->app->register(UserServiceProvider::class);
56+
// $this->app->register(UserServiceProvider::class);
5757

5858
// Register the Menu service provider.
5959
$this->app->register(MenuServiceProvider::class);
@@ -72,15 +72,15 @@ protected function registerBladeExtensions($bladeCompiler): void
7272
{
7373
$bladeMethodWrapper = '\\CodeCoz\\AimAdmin\\AdminServiceProvider::bladeMethodWrapper';
7474

75-
$bladeCompiler->directive('hasanypermission', fn($args) => "<?php if({$bladeMethodWrapper}('hasAnyPermission', {$args})): ?>");
76-
$bladeCompiler->directive('elsehasanypermission', fn($args) => "<?php elseif({$bladeMethodWrapper}('hasAnyPermission', {$args})): ?>");
77-
$bladeCompiler->directive('endhasanypermission', fn() => '<?php endif; ?>');
75+
$bladeCompiler->directive('hasanypermission', fn ($args) => "<?php if({$bladeMethodWrapper}('hasAnyPermission', {$args})): ?>");
76+
$bladeCompiler->directive('elsehasanypermission', fn ($args) => "<?php elseif({$bladeMethodWrapper}('hasAnyPermission', {$args})): ?>");
77+
$bladeCompiler->directive('endhasanypermission', fn () => '<?php endif; ?>');
7878

79-
$bladeCompiler->directive('hasrole', fn($args) => "<?php if({$bladeMethodWrapper}('hasRole', {$args})): ?>");
80-
$bladeCompiler->directive('endhasrole', fn() => '<?php endif; ?>');
79+
$bladeCompiler->directive('hasrole', fn ($args) => "<?php if({$bladeMethodWrapper}('hasRole', {$args})): ?>");
80+
$bladeCompiler->directive('endhasrole', fn () => '<?php endif; ?>');
8181

82-
$bladeCompiler->directive('hasanyrole', fn($args) => "<?php if({$bladeMethodWrapper}('hasAnyRole', {$args})): ?>");
83-
$bladeCompiler->directive('endhasanyrole', fn() => '<?php endif; ?>');
82+
$bladeCompiler->directive('hasanyrole', fn ($args) => "<?php if({$bladeMethodWrapper}('hasAnyRole', {$args})): ?>");
83+
$bladeCompiler->directive('endhasanyrole', fn () => '<?php endif; ?>');
8484

8585
}
8686

@@ -98,7 +98,7 @@ private function interfacesBindings(): void
9898
{
9999
// Register the service the package provides.
100100
$this->app->singleton($this->packagePrefix, function ($app) {
101-
return new Admin;
101+
return new Admin();
102102
});
103103

104104
// Register the extra Interfaces to the package provides.
@@ -199,9 +199,9 @@ private function loadMigration(): void
199199
*/
200200
private function registerGlobalMiddleware(): void
201201
{
202-
// $this->app['router']->aliasMiddleware('role', RoleMiddleware::class);
203-
// $this->app['router']->aliasMiddleware('acl', CheckPermission::class);
204-
// $this->app['router']->pushMiddlewareToGroup('web', ForcePasswordChange::class);
202+
// $this->app['router']->aliasMiddleware('role', RoleMiddleware::class);
203+
// $this->app['router']->aliasMiddleware('acl', CheckPermission::class);
204+
// $this->app['router']->pushMiddlewareToGroup('web', ForcePasswordChange::class);
205205
}
206206

207207
/**

src/Collection/AbstractCollection.php

+63-62
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,63 @@
1-
<?php declare(strict_types=1);
2-
3-
/*
4-
* This file is part of the Aim Admin package.
5-
*
6-
* (c) CodeCoz <[email protected]>
7-
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
12-
namespace CodeCoz\AimAdmin\Collection;
13-
14-
15-
/**
16-
* This class is a collection abstract class abstract.
17-
*
18-
* @author CodeCoz <[email protected]>
19-
*/
20-
abstract class AbstractCollection implements \ArrayAccess, \Countable, \IteratorAggregate
21-
{
22-
protected array $items;
23-
24-
abstract function offsetGet(mixed $offset): mixed;
25-
26-
public function isEmpty(): bool
27-
{
28-
return 0 === \count($this->items);
29-
}
30-
31-
public function offsetExists(mixed $offset): bool
32-
{
33-
return \array_key_exists($offset, $this->items);
34-
}
35-
36-
37-
public function offsetSet(mixed $offset, mixed $value): void
38-
{
39-
$this->items[$offset] = $value;
40-
}
41-
42-
public function offsetUnset(mixed $offset): void
43-
{
44-
unset($this->items[$offset]);
45-
}
46-
47-
public function getIterator(): \ArrayIterator
48-
{
49-
return new \ArrayIterator($this->items);
50-
}
51-
52-
public function count(): int
53-
{
54-
return \count($this->items);
55-
}
56-
57-
public function all(): array
58-
{
59-
return $this->items;
60-
}
61-
62-
}
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the Aim Admin package.
7+
*
8+
* (c) CodeCoz <[email protected]>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
namespace CodeCoz\AimAdmin\Collection;
15+
16+
/**
17+
* This class is a collection abstract class abstract.
18+
*
19+
* @author CodeCoz <[email protected]>
20+
*/
21+
abstract class AbstractCollection implements \ArrayAccess, \Countable, \IteratorAggregate
22+
{
23+
protected array $items;
24+
25+
abstract public function offsetGet(mixed $offset): mixed;
26+
27+
public function isEmpty(): bool
28+
{
29+
return 0 === \count($this->items);
30+
}
31+
32+
public function offsetExists(mixed $offset): bool
33+
{
34+
return \array_key_exists($offset, $this->items);
35+
}
36+
37+
38+
public function offsetSet(mixed $offset, mixed $value): void
39+
{
40+
$this->items[$offset] = $value;
41+
}
42+
43+
public function offsetUnset(mixed $offset): void
44+
{
45+
unset($this->items[$offset]);
46+
}
47+
48+
public function getIterator(): \ArrayIterator
49+
{
50+
return new \ArrayIterator($this->items);
51+
}
52+
53+
public function count(): int
54+
{
55+
return \count($this->items);
56+
}
57+
58+
public function all(): array
59+
{
60+
return $this->items;
61+
}
62+
63+
}

0 commit comments

Comments
 (0)