Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Button in Laravel Datatable not rendering

You need to define rawColumns :
public function getProductDatatable()
    {
        $Product = Product::query();
       return Datatables::eloquent($Product)
        ->addColumn('action', function($row) {
            return '<a href="/product/'. $row->id .'/edit" class="btn btn-primary">Edit</a>';
        })

        ->addColumn('add_price', function($row) {
            return '<a href="/product/'. $row->id .'/create-price" class="btn btn-primary">Add Price</a>';
        })
       ->rawColumns(['add_price', 'action'])
       ->make(true);
    }
Comment

PREVIOUS NEXT
Code Example
Php :: magento 2 isSetFlag() 
Php :: waht is middleware in laravel 
Php :: php magic __dir__ since ? 
Php :: replace key name in associative array 
Php :: fetch data from database withour restarting console php 
Php :: add image thumb on checkout woo 
Php :: fuzzy search in php with percentage 
Php :: undefined type excel 
Php :: magento 2.4.3 how to log 
Php :: listing table in laravel blade 
Php :: illuminate routing array to string conversion 
Php :: how to use php in laravel blade 
Php :: Explicit Octal numeral notation - PHP 8.1 
Php :: laravel many to many 
Php :: WooCommerce: Add Content to a Specific Order Email 
Php :: post with count greater than 1 laravel 
Php :: list.blade.php 
Php :: Argument 2 passed to AppExceptionsHandler::unauthenticated() must be an instance of AppExceptionsAuthenticationException, instance of IlluminateAuthAuthenticationException given 
Php :: wp php blog info background image 
Php :: Add text below product title on archive page + ACF 
Php :: Drupal 9 check if UUD is valid 
Php :: Josn_encode php api encoding issue 
Php :: hirudhi 
Php :: auto reload page in chat php 
Php :: search a file name and open that file phpstrom 
Php :: display PHP errors based on environment variable 
Php :: laravel components scripts 
Php :: remove the public from url in laravel 
Php :: drupal 7 hook_node_insert 
Php :: url images in CSS file link not working on PHP page| 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =