Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create vouchers from laravel nova #33

Closed
leurias opened this issue Mar 17, 2021 · 1 comment
Closed

Create vouchers from laravel nova #33

leurias opened this issue Mar 17, 2021 · 1 comment

Comments

@leurias
Copy link

leurias commented Mar 17, 2021

How we can create vouchers from the laravel nova panel?

@leurias
Copy link
Author

leurias commented Mar 17, 2021

Solved.

  1. add the below line to your product:
MorphMany::make('Vouchers', 'vouchers', 'App\Nova\Voucher'),
  1. Make new Nova resource and change $model to:
\BeyondCode\Vouchers\Models\Voucher::class
  1. Add the below fields to Voucher resource:
public function fields(Request $request)
    {
        return [
            ID::make(__('ID'), 'id')->sortable(),

            Text::make(__('Code'), 'code'),

            Code::make(__('Data'), 'data')->nullable(),

            DateTime::make(__('Expires At'), 'expires_at')->nullable()
        ];
    }

@leurias leurias closed this as completed Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant