Skip to content

Instantly share code, notes, and snippets.

@Krato
Last active November 25, 2020 23:02
Show Gist options
  • Save Krato/b3f5891b917dadeb696b4aa36dda06d4 to your computer and use it in GitHub Desktop.
Save Krato/b3f5891b917dadeb696b4aa36dda06d4 to your computer and use it in GitHub Desktop.
A set of snippets I use in Laravel Nova

A set of snippets I use in Laravel Nova

Snippets

Vue,js devtools (Only with manual installation)

cd ./nova 
yarn
mv webpack.mix.js.dist webpack.mix.js
yarn dev
cd ../
php artisan nova:publish

Credits: laravel/nova-issues#33 (comment)

Vue,js devtools (via composer)

cd ./vendor/laravel/nova
yarn
cp webpack.mix.js.dist webpack.mix.js
yarn dev
cd ....
php artisan nova:publish

Set default value

Text::make("Your Field")
    ->withMeta(["value" => "Some Value"]),

Credits: laravel/nova-issues#58 (comment)

Set default value to BelongsTo

BelongsTo::make('User')
    ->withMeta([
        'belongsToId' => auth()->user()->id
    ]),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment