I'm using yajra/laravel-datatables-buttons and I can't find a doc useful enough to help me.
I'm using the create button from the package which looks like this:
It should redirect me to my route which is: http://laravel.blog/admin/posts/create
But it keeps on redirecting me to http://laravel.blog/admin/posts/creer
it translates 'create' into 'creer' and I have no idea why it would do that. I'm building the app in english only and never used french for routes or anything.
AdminPostsDatatable.php:
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('adminpostsdatatable-table')
->columns($this->getColumns())
->minifiedAjax()
->dom('Bfrtip')
->orderBy(1, 'desc')
->buttons(
Button::make('create'),
Button::make('export'),
Button::make('print'),
Button::make('reset'),
Button::make('reload')
);
}
admin.posts.index view:
@extends("layouts.app")
@section('content')
<h1>Posts</h1>
@if (session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div>
@endif
{!! $dataTable->table() !!}
@endsection
@push('scripts')
{!! $dataTable->scripts() !!}
@endpush
routes:
| | GET|HEAD | admin | admin. | Closure | web,auth |
| | POST | admin/posts | admin.posts.store | App\Http\Controllers\AdminPostsController@store | web,auth |
| | GET|HEAD | admin/posts | admin.posts.index | App\Http\Controllers\AdminPostsController@index | web,auth |
| | GET|HEAD | admin/posts/create | admin.posts.create | App\Http\Controllers\AdminPostsController@create | web,auth |
| | PUT|PATCH | admin/posts/{post} | admin.posts.update | App\Http\Controllers\AdminPostsController@update | web,auth |
| | DELETE | admin/posts/{post} | admin.posts.destroy | App\Http\Controllers\AdminPostsController@destroy | web,auth |
| | GET|HEAD | admin/posts/{post}/edit | admin.posts.edit | App\Http\Controllers\AdminPostsController@edit | web,auth
Thanks in advance.
