PHP code example of slash2nl / nova-back-button

1. Go to this page and download the library: Download slash2nl/nova-back-button 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/ */

    

slash2nl / nova-back-button example snippets


use SLASH2NL\NovaBackButton\NovaBackButton;

public function cards()
{
    return [ 
        (new NovaBackButton())
            ->onlyOnDetail(),
        
        (new NovaBackButton())
            ->onlyOnDetail()
            ->width('1/3')
            ->markdown('# Hello World!'),

        (new NovaBackButton())
            ->onlyOnDetail()
            ->width('1/3')
            ->view('partials.back-button')
            ->url(sprintf('%s/resources/%s/%d', config('nova.path'), User::uriKey(), \App\Models\User::first()->id)),
     ];
}