artisan

problems with database connection in laravel 5

老子叫甜甜 提交于 2019-11-29 06:39:32
I use the command php artisan migrate to migrate my database connection but I still get the same error and I checked everything, nothing wrong. I used the same connection that I always use in Laravel 4.2 Here is the message I get on my console: exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)' in C:\xampp\htdocs\Projects\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:47 Take a look at your config/database.php and .env file.Maybe your database information is different. You need to

PHP Artisan Tinker crashing from any command

瘦欲@ 提交于 2019-11-29 02:14:39
问题 I haven't had this problem before, but my php artisan tinker crashes from issuing any command - and leaves no logs whatsoever on what is causing the crash. project4 $ php artisan tinker Psy Shell v0.9.9 (PHP 7.3.0 — cli) by Justin Hileman >>> use \App\Jobs\testJob; project4 $ or even the simplest command: project4 $ php artisan tinker Psy Shell v0.9.9 (PHP 7.3.0 — cli) by Justin Hileman >>> print("Hello World!"); project4 $ I almost wonder if it isn't connecting to PHP correctly, but I can't

Vendor:Publish - Nothing to publish for tag [] - Only on production server

怎甘沉沦 提交于 2019-11-29 00:46:18
问题 I am using a third party library and locally, I installed everything using the steps that they provided. I ran composer require on the package and ran an update. This installed into the vendor folder. I then added the path into the provider in config/app and also as an aliases.. I ran php artisan vendor:publish --provider="Spatie\LaravelAnalytics\LaravelAnalyticsServiceProvider" the config file created successfully and I had no problems. I then uploaded to the production environment and kept

Laravel 5.4 create model, controller and migration in single artisan command

梦想与她 提交于 2019-11-28 13:20:01
问题 I can create a model and resource controller (binded to model) with the following command php artisan make:controller TodoController --resource --model=Todo I want to also create a migration with the above command, is it possible? 回答1: You can do it if you start from the model php artisan make:model Todo -mcr if you run php artisan make:model --help you can see all the available options -m, --migration Create a new migration file for the model. -c, --controller Create a new controller for the

Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLength()

本秂侑毒 提交于 2019-11-28 10:34:21
问题 Firstly i was getting an error in php artisan migrate as SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes and Then i found a post on laracasts to fix this as use Illuminate\Support\Facades\Schema; public function boot() { Schema::defaultStringLength(191); } After adding this, when i run php artisan optimize then i am presented with new error as below Call to undefined method Illuminate\Database\Schema\MySqlBuilder:

SQLSTATE[HY000] [2002] Connection refused within Laravel homestead

冷暖自知 提交于 2019-11-28 06:17:31
Using Mac OS X and Homestead 2.2.1 with Laravel 5.2. In terminal (within homestead in my project folder) I can do php artisan to see all the available commands. When I try to run php artisan migrate I get a connection error: SQLSTATE[HY000] [2002] Connection refused I have setup a Laravel project with these .env settings DB_HOST=127.0.0.1 DB_DATABASE=tcv DB_USERNAME=homestead DB_PASSWORD=secret I have also tried localhost for DB_HOST and root for DB_USERNAME and DB_PASSWORD. And all possible variations of these put together! In Sequel Pro (db management application) I CAN connect with these

problems with database connection in laravel 5

久未见 提交于 2019-11-28 00:00:39
问题 I use the command php artisan migrate to migrate my database connection but I still get the same error and I checked everything, nothing wrong. I used the same connection that I always use in Laravel 4.2 Here is the message I get on my console: exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)' in C:\xampp\htdocs\Projects\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:47 回答1: Take

What are the Differences Between “php artisan dump-autoload” and “composer dump-autoload”?

▼魔方 西西 提交于 2019-11-27 17:03:49
I am pretty new to Laravel 4 and Composer. While I do Laravel 4 tutorials, I couldn't understand the difference between those two commands; php artisan dump-autoload and composer dump-autoload What's the difference between them? Laravel's Autoload is a bit different: 1) It will in fact use Composer for some stuff 2) It will call Composer with the optimize flag 3) It will 'recompile' loads of files creating the huge bootstrap/compiled.php 4) And also will find all of your Workbench packages and composer dump-autoload them, one by one. php artisan dump-autoload was deprecated on Laravel 5, so

No Application Encryption Key Has Been Specified

删除回忆录丶 提交于 2019-11-27 16:53:10
I'm new to Laravel and I'm trying to use the Artisan command... php artisan serve It displays... Laravel development server started: http://127.0.0.1:8000 However, it won't automatically launch and when I manually enter http://127.0.0.1:8000 it shows this error: RuntimeException No application encryption key has been specified. Any ideas? I'm using Laravel framework 5.5-dev. From Encryption - Laravel - The PHP Framework For Web Artisans : "Before using Laravel's encrypter, you must set a key option in your config/app.php configuration file. You should use the php artisan key:generate command

What is the significance of Application URL in laravel 5

喜夏-厌秋 提交于 2019-11-27 15:45:45
问题 in Config/app.php in laravel source, what is the actual use of url ? It says Application URL to be used by artisan command line tool , so what should it be actually? I mean should it be http://mydomainname.com or should it be /var/www/laravel/ or /var/www/laravel/public Current Configuration /* |-------------------------------------------------------------------------- | Application URL |-------------------------------------------------------------------------- | | This URL is used by the