i just install this package its working fine on my local server but when i deploy my code its giving me errors
" production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Class 'App\Datatables\DataTableBase' not found in"
i dont know why i double checked namespace is fine i deploy my code via git local to production(ssh)
thanks
and my DataTableBase
```
namespace App\DataTables;
use Illuminate\Contracts\View\Factory;
use Illuminate\Database\Query\Builder;
use Yajra\Datatables\Datatables;
use Yajra\Datatables\Engines\BaseEngine;
use Yajra\Datatables\Services\DataTable;
class DataTableBase extends DataTable
{
/*
* The reason why this class exists is that Yajra/Datatables requires this service class for export methods to work
* properly.
*/
/** @var Builder The query that will be used to get the data from the db. */
private $mQuery;
/** @var array An array of columns */
private $mColumns;
/** @var BaseEngine The DataTable */
private $mDataTable;
/**
* @param $query
* @param BaseEngine $dataTable
* @param array $columns
*/
public function __construct($query, BaseEngine $dataTable, $columns) {
parent::__construct(app(Datatables::class), app(Factory::class));
$this->mQuery = $query;
$this->mColumns = $columns;
$this->mDataTable = $dataTable;
}
/**
* Display ajax response.
*
* @return \Illuminate\Http\JsonResponse
*/
public function ajax()
{
return $this->mDataTable->make(true);
}
/**
* Get the query object to be processed by dataTables.
*
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Support\Collection
*/
public function query()
{
return $this->mQuery;
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\Datatables\Html\Builder
*/
public function html()
{
return $this->builder()->columns($this->mColumns);
}
/**
* Get columns.
*
* @return array
*/
// protected function getColumns()
// {
// return [
// 'id',
// // add your columns
// 'created_at',
// 'updated_at',
// ];
// }
/**
* Get filename for export.
*
* @return string
*/
protected function filename()
{
return 'datatablebases_' . time();
}
}
```
namespace App\DataTables;
'App\Datatables\DataTableBase' not found
Check your namespace capitalization.
Also, use three backticks instead of just one when formatting multiple lines of code. That's why it doesn't show up properly above.
i just double checked everything is fine even on my mac i tested it working but when its goes live throwing errors
here this is the filestrucutre on my server
you are declaring DataTableBase in the the App\DataTables\DataTableBase namespace but referencing App\Datatables\DataTableBase Notice, Datatables vs DataTables
It is probably working locally because that version of php is case-insensitive but it appears to be case-sensitive on your server.
thanks , problem fixed
Most helpful comment
you are declaring
DataTableBasein the theApp\DataTables\DataTableBasenamespace but referencingApp\Datatables\DataTableBaseNotice,DatatablesvsDataTablesIt is probably working locally because that version of php is case-insensitive but it appears to be case-sensitive on your server.