Skip to content

Commit

Permalink
prepare order resource
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Nov 13, 2023
1 parent 0be94ed commit 379d216
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Resources/OrderResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Cone\Bazar\Resources;

use Cone\Bazar\Models\Order;
use Cone\Root\Fields\BelongsTo;
use Cone\Root\Fields\ID;
use Cone\Root\Resources\Resource;
use Illuminate\Http\Request;

class OrderResource extends Resource
{
/**
* The model class.
*/
protected string $model = Order::class;

/**
* Define the fields.
*/
public function fields(Request $request): array
{
return [
ID::make(),

BelongsTo::make(__('Customer'), 'user')
->display('name'),
];
}
}

0 comments on commit 379d216

Please sign in to comment.