PHP code example of ericlagarda / nova-settings-card

1. Go to this page and download the library: Download ericlagarda/nova-settings-card library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ericlagarda / nova-settings-card example snippets


KeyValue::make('Meta')->resolveUsing(function ($value) {
	return json_decode($value);
})

	composer 

	php artisan vendor:publish --tag=setting
	

	php artisan migrate
	

	use EricLagarda\SettingsCard\SettingsCard;


	/**
     * Get the cards for the dashboard.
     *
     * @return array
     */
    public function cards()
    {
	    return [
	        (new SettingsCard)->fields([
	            'General' => [
	                Text::make('Web Name'),
	                Boolean::make('Activated'),
	                Trix::make('Site Description'),
	                Image::make('Logo')->disk('s3'),
	                KeyValue::make('Meta')->resolveUsing(function ($value) {
	                    return json_decode($value);
	                }),
	            ],
	            'Scripts' => [
	                Code::make('Header Scripts')->language('javascript'),
	                Code::make('Footer Scripts')->language('javascript'),
	            ],
	            'Styles' => [
	                Code::make('Header Styles')->language('sass'),
	                Code::make('Footer Styles')->language('sass'),
	            ],
	        ])->name('My settings card'),
	    ];

        ...
    }