laravel-artisan

Generate Model, Controller outside of app folder in Laravel

喜夏-厌秋 提交于 2021-02-17 02:34:33
问题 How to create controller and model files outside of app folder. For example, when we do php artisan make:model ModelName it creates Model file inside app folder. When we specify namespace like php artisan make:model SomeFolder/ModelName it creates Model file inside app/SomeFolder/ModelName. I wanted to create model files outside of app folder. How to achieve this? 回答1: I don't see the reason, but I managed to make it on my local computer by php artisan make:model ../../mOdel . Probably in

Generate Model, Controller outside of app folder in Laravel

二次信任 提交于 2021-02-17 02:32:30
问题 How to create controller and model files outside of app folder. For example, when we do php artisan make:model ModelName it creates Model file inside app folder. When we specify namespace like php artisan make:model SomeFolder/ModelName it creates Model file inside app/SomeFolder/ModelName. I wanted to create model files outside of app folder. How to achieve this? 回答1: I don't see the reason, but I managed to make it on my local computer by php artisan make:model ../../mOdel . Probably in

Getting error while migrating laravel 7 to 8

爷,独闯天下 提交于 2021-02-11 06:30:51
问题 I am using library upeg/sybase 2.1 . when I am upgrading laravel 8 , i am getting below error. How can I resolve this error? Getting error while applyig command composer update composer.json "require": { "php": "^7.3.0", "ext-curl": "*", "ext-json": "*", "abram/laravel-odbc": "dev-master", "agomez/laravel-odbc-driver": "^1.0", "alipek/rtf2html": "dev-master", "doctrine/dbal": "^2.10", "fideloper/proxy": "^4.2", "google/recaptcha": "^1.2", "guzzlehttp/guzzle": "^7.0", "laravel/framework": "^8

Why does php artisan migrate nothing?

99封情书 提交于 2021-02-08 14:00:12
问题 Running "php artisan migrate" does nothing: no database modifications, no message(olso no "nothing to migrate"), no error. No records are being added to table migrations as well. Previously, the command "php artisan migrate" was working fine. One of the migration files in folder database/migrations has this content: <?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class VidsTableEdit14 extends Migration { /** * Run the migrations. * * @return void

How to schedule Artisan commands in a package?

家住魔仙堡 提交于 2021-02-05 20:09:49
问题 I have a package that contains Artisan commands. I’ve registered these commands with Artisan via my service provider like so: /** * Register the application services. * * @return void */ public function register() { // Register Amazon Artisan commands $this->commands([ 'App\Marketplace\Amazon\Console\PostProductData', 'App\Marketplace\Amazon\Console\PostProductImages', 'App\Marketplace\Amazon\Console\PostProductInventory', 'App\Marketplace\Amazon\Console\PostProductPricing', ]); } However,

How to schedule Artisan commands in a package?

…衆ロ難τιáo~ 提交于 2021-02-05 20:09:38
问题 I have a package that contains Artisan commands. I’ve registered these commands with Artisan via my service provider like so: /** * Register the application services. * * @return void */ public function register() { // Register Amazon Artisan commands $this->commands([ 'App\Marketplace\Amazon\Console\PostProductData', 'App\Marketplace\Amazon\Console\PostProductImages', 'App\Marketplace\Amazon\Console\PostProductInventory', 'App\Marketplace\Amazon\Console\PostProductPricing', ]); } However,

Laravel 7 Artisan error - Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request

天涯浪子 提交于 2021-01-29 15:40:29
问题 First of all I am kind of new in Laravel but I do like to learn and I really need your help fixing this error. my project is cloned from my GitHub and all the steps i think I have done them as by the book :) however running Laravel installation at the end I've got the error to be more specified. config.php is not present in config folder (in order to try as one suggestion rename it as config_ ) I did tried without success all commands suggested in different resolutions php artisan cache:clear

“No such file or directory” or “No such host is known” when running migrations

断了今生、忘了曾经 提交于 2021-01-09 12:30:30
问题 I deleted the migrations table from a Laravel 5.4 database named laravel . When I run php artisan migrate:install , I get this error: [Illuminate\Database\QueryException] SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations) I deleted and recreated the database. I also ran composer update . No luck. I can run the command in phpMyAdmin and create the table manually. This problem sometimes also

“No such file or directory” or “No such host is known” when running migrations

被刻印的时光 ゝ 提交于 2021-01-09 12:30:06
问题 I deleted the migrations table from a Laravel 5.4 database named laravel . When I run php artisan migrate:install , I get this error: [Illuminate\Database\QueryException] SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations) I deleted and recreated the database. I also ran composer update . No luck. I can run the command in phpMyAdmin and create the table manually. This problem sometimes also

PHP Error: Call to undefined method stdClass::save() in Psy Shell code on line 1

こ雲淡風輕ζ 提交于 2021-01-05 12:56:53
问题 I'm new in Laravel, I'm using tinker to create a record: $Profile=new \App\Profile(); => App\Profile {#3038} >>> $profile->title='Premier Titre' PHP Warning: Creating default object from empty value in Psy Shell code on line 1 >>> $profile->title='Premier Titre'; => "Premier Titre" >>> $profile->description='Description'; => "Description" >>> $profile->user_id=1; => 1 >>> $profile->save() PH I have the following error:PHP Error: Call to undefined method stdClass::save() in Psy Shell code on