z-song / laravel-admin

Build a full-featured administrative interface in ten minutes
https://laravel-admin.org
MIT License
11.15k stars 2.82k forks source link

create controller in Laravel... #5573

Open ar-13147 opened 2 years ago

ar-13147 commented 2 years ago

Description:

Hello, i just installed laraevl-admin , everything was good , when i create controller using this command..

php artisan admin:make BillInfoController --model=app\Models\BillInfo php artisan admin:make BillInfoController --model=app\Models\BillInfo

show error ... model does not exists what is the solution ?

thanks

altwei commented 2 years ago

You can try this

php artisan admin:make BillInfoController --model="app\Models\BillInfo"

ar-13147 commented 2 years ago

You can try this

php artisan admin:make BillInfoController --model="app\Models\BillInfo"

not work same error ... model does not exists.

altwei commented 2 years ago

You can try this php artisan admin:make BillInfoController --model="app\Models\BillInfo"

not work same error ... model does not exists.

Sorry, try this again

php artisan admin:make BillInfoController --model="App\Models\BillInfo"

ar-13147 commented 2 years ago

I try with case sensitive format but showing same error and also try after delete model manually and

php artisan make:model billinfo -c

Show message successfully created model & Controller.

But when i checked model create but controller file not credited.

altwei commented 2 years ago

I try with case sensitive format but showing same error and also try after delete model manually and

php artisan make:model billinfo -c

Show message successfully created model & Controller.

But when i checked model create but controller file not credited.

I used the lower version test earlier and now try to deploy the same environment as yours.

The framework hasn't been updated for two years, your higher-release environment should have more problems.

ar-13147 commented 2 years ago

These version should be used.. Laravel Version: Laravel Framework 8.83.10 PHP Version: PHP Version 7.4.28

jurri commented 2 years ago

have u test it with \\ ?? php artisan admin:make BillInfoController --model=App\\Models\\BillInfo I got same error with only one backslash

PHP version | PHP/8.0.18 Laravel version | 8.83.1

❯ php artisan admin:make UserController --model=App\Models\User
Model does not exists !
❯ php artisan admin:make UserController --model=App\\Models\\User
App\Admin\Controllers\UserController created successfully.

Add the following route to app/Admin/routes.php:

    $router->resource('users', UserController::class);
altwei commented 2 years ago

have u test it with \\ ?? php artisan admin:make BillInfoController --model=App\\Models\\BillInfo I got same error with only one backslash

PHP version | PHP/8.0.18 Laravel version | 8.83.1

❯ php artisan admin:make UserController --model=App\Models\User
Model does not exists !
❯ php artisan admin:make UserController --model=App\\Models\\User
App\Admin\Controllers\UserController created successfully.

Add the following route to app/Admin/routes.php:

    $router->resource('users', UserController::class);

My operating system is Windows, linux is different

https://laravel-admin.org/docs/en/quick-start

ar-13147 commented 2 years ago

have u test it with \\ ?? php artisan admin:make BillInfoController --model=App\\Models\\BillInfo I got same error with only one backslash PHP version | PHP/8.0.18 Laravel version | 8.83.1

❯ php artisan admin:make UserController --model=App\Models\User
Model does not exists !
❯ php artisan admin:make UserController --model=App\\Models\\User
App\Admin\Controllers\UserController created successfully.

Add the following route to app/Admin/routes.php:

    $router->resource('users', UserController::class);

My operating system is Windows, linux is different

https://laravel-admin.org/docs/en/quick-start

`

have u test it with \\ ?? php artisan admin:make BillInfoController --model=App\\Models\\BillInfo I got same error with only one backslash

PHP version | PHP/8.0.18 Laravel version | 8.83.1

❯ php artisan admin:make UserController --model=App\Models\User
Model does not exists !
❯ php artisan admin:make UserController --model=App\\Models\\User
App\Admin\Controllers\UserController created successfully.

Add the following route to app/Admin/routes.php:

    $router->resource('users', UserController::class);

have u test it with \\ ?? php artisan admin:make BillInfoController --model=App\\Models\\BillInfo I got same error with only one backslash

PHP version | PHP/8.0.18 Laravel version | 8.83.1

❯ php artisan admin:make UserController --model=App\Models\User
Model does not exists !
❯ php artisan admin:make UserController --model=App\\Models\\User
App\Admin\Controllers\UserController created successfully.

Add the following route to app/Admin/routes.php:

    $router->resource('users', UserController::class);

My operating system is Windows,

Laravel Framework 8.83.11 Composer version 2.3.5 PHP 7.3.11 (cli) (built: Oct 22 2019 11:20:18) ( ZTS MSVC15 (Visual C++ 2017) x64 )

Capture 1 2 3

altwei commented 2 years ago

image

I tried to execute it on window and got this result

--model=App\Models\Moment\Coupon

You should try "App", Instead of "app"

@razaranta

altwei commented 2 years ago

have u test it with \\ ?? php artisan admin:make BillInfoController --model=App\\Models\\BillInfo I got same error with only one backslash

PHP version | PHP/8.0.18 Laravel version | 8.83.1

❯ php artisan admin:make UserController --model=App\Models\User
Model does not exists !
❯ php artisan admin:make UserController --model=App\\Models\\User
App\Admin\Controllers\UserController created successfully.

Add the following route to app/Admin/routes.php:

    $router->resource('users', UserController::class);

Windows requires only a single slash, linux systems require double slashes