Skip to content

Commit ce9f054

Browse files
committed
uang persediaan
1 parent f345d41 commit ce9f054

File tree

4 files changed

+202
-0
lines changed

4 files changed

+202
-0
lines changed

app/Models/UangPersediaan.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace App\Models;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class UangPersediaan extends Model
8+
{
9+
//
10+
}

app/Nova/UangPersediaan.php

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?php
2+
3+
namespace App\Nova;
4+
5+
use Laravel\Nova\Http\Requests\NovaRequest;
6+
7+
class UangPersediaan extends Resource
8+
{
9+
/**
10+
* The model the resource corresponds to.
11+
*
12+
* @var class-string<\App\Models\UangPersediaan>
13+
*/
14+
public static $model = \App\Models\UangPersediaan::class;
15+
16+
public static function label()
17+
{
18+
return 'UangPersediaan';
19+
}
20+
21+
/**
22+
* The single value that should be used to represent the resource when being displayed.
23+
*
24+
* @var string
25+
*/
26+
public static $title = 'id';
27+
28+
public function subtitle(){
29+
return $this->id;
30+
}
31+
32+
/**
33+
* The columns that should be searched.
34+
*
35+
* @var array
36+
*/
37+
public static $search = [
38+
'id',
39+
];
40+
41+
/**
42+
* Get the fields displayed by the resource.
43+
*
44+
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
45+
* @return array
46+
*/
47+
public function fields(NovaRequest $request)
48+
{
49+
return [
50+
51+
];
52+
}
53+
54+
/**
55+
* Get the cards available for the request.
56+
*
57+
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
58+
* @return array
59+
*/
60+
public function cards(NovaRequest $request)
61+
{
62+
return [];
63+
}
64+
65+
/**
66+
* Get the filters available for the resource.
67+
*
68+
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
69+
* @return array
70+
*/
71+
public function filters(NovaRequest $request)
72+
{
73+
return [];
74+
}
75+
76+
/**
77+
* Get the lenses available for the resource.
78+
*
79+
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
80+
* @return array
81+
*/
82+
public function lenses(NovaRequest $request)
83+
{
84+
return [];
85+
}
86+
87+
/**
88+
* Get the actions available for the resource.
89+
*
90+
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
91+
* @return array
92+
*/
93+
public function actions(NovaRequest $request)
94+
{
95+
return [];
96+
}
97+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
3+
namespace App\Policies;
4+
5+
use App\Helpers\Policy;
6+
7+
class UangPersediaanPolicy
8+
{
9+
/**
10+
* Determine whether the user can view any models.
11+
*/
12+
public function viewAny(): bool
13+
{
14+
return Policy::make()
15+
->allowedFor('admin')
16+
->get();
17+
}
18+
19+
/**
20+
* Determine whether the user can view the model.
21+
*/
22+
public function view(): bool
23+
{
24+
return Policy::make()
25+
->allowedFor('admin')
26+
->get();
27+
}
28+
29+
/**
30+
* Determine whether the user can create models.
31+
*/
32+
public function create(): bool
33+
{
34+
return Policy::make()
35+
->allowedFor('admin')
36+
->get();
37+
}
38+
39+
/**
40+
* Determine whether the user can update the model.
41+
*/
42+
public function update(): bool
43+
{
44+
return Policy::make()
45+
->allowedFor('admin')
46+
->get();
47+
}
48+
49+
/**
50+
* Determine whether the user can delete the model.
51+
*/
52+
public function delete(): bool
53+
{
54+
return Policy::make()
55+
->allowedFor('admin')
56+
->get();
57+
}
58+
59+
/**
60+
* Determine whether the user can replicate the model.
61+
*/
62+
public function replicate(): bool
63+
{
64+
return Policy::make()
65+
->allowedFor('admin')
66+
->get();
67+
}
68+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('uang_persediaans', function (Blueprint $table) {
15+
$table->id();
16+
$table->timestamps();
17+
});
18+
}
19+
20+
/**
21+
* Reverse the migrations.
22+
*/
23+
public function down(): void
24+
{
25+
Schema::dropIfExists('uang_persediaans');
26+
}
27+
};

0 commit comments

Comments
 (0)