Skip to content

Commit 89b5873

Browse files
committed
Merge branch '4.0'
* 4.0: Bump v4.10.1 🚀 added space after if and before '(' added support for Laravel 8.x if Models directory exists then use Models directory in namespace for model Add Laravel DataTables 9.x on requirements
2 parents de06c1f + d0d5e12 commit 89b5873

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Laravel DataTables Buttons Plugin CHANGELOG.
22

3+
## v4.10.1 - 10-31-2020
4+
5+
- Fix model namespace for Laravel 8.x [#117], credits to @luckys383.
6+
37
## v4.10.0 - 09-09-2020
48

59
- Add support for Laravel 8.
@@ -210,6 +214,7 @@ ajax(), dataTable(), query(), csv(), excel(), pdf(), printPreview()
210214
[#99]: https://github.com/yajra/laravel-datatables-buttons/pull/99
211215
[#102]: https://github.com/yajra/laravel-datatables-buttons/pull/102
212216
[#105]: https://github.com/yajra/laravel-datatables-buttons/pull/105
217+
[#117]: https://github.com/yajra/laravel-datatables-buttons/pull/117
213218

214219
[#19]: https://github.com/yajra/laravel-datatables-buttons/issues/19
215220
[#1558]: https://github.com/yajra/laravel-datatables/issues/1558

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This package is a plugin of [Laravel DataTables](https://github.com/yajra/larave
1212
## Requirements
1313
- [PHP >=7.0](http://php.net/)
1414
- [Laravel 5.x](https://github.com/laravel/framework)
15+
- [Laravel DataTables 9.x](https://github.com/yajra/laravel-datatables)
1516
- [jQuery DataTables v1.10.x](http://datatables.net/)
1617
- [jQuery DataTables Buttons Extension](https://datatables.net/reference/button/)
1718

src/Generators/DataTablesMakeCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ protected function getModel()
361361
return $this->option('model');
362362
}
363363

364+
// check if model namespace is not set in command and Models directory already exists then use that directory in namespace.
365+
if ($modelNamespace == '') {
366+
$modelNamespace = is_dir(app_path('Models')) ? 'Models' : $rootNamespace;
367+
}
368+
364369
return $model
365370
? $rootNamespace . '\\' . ($modelNamespace ? $modelNamespace . '\\' : '') . Str::singular($name)
366371
: $rootNamespace . '\\User';

0 commit comments

Comments
 (0)