Laravel
php artisan
Hello,
When I typed php artisan in command prompt it does not recognize the syntax, any clue why?
What do I need to install to make it works?
@jlrdw Don't be a dick!
You need to make sure that you're in the directory of your Laravel project. Also you need to run composer install so all dependencies are available!
D:\xampp72\htdocs\redbuzz>laravel
'laravel' is not recognized as an internal or external command, operable program or batch file.
what about when you try to run artisan command. What do you type / see
D:\xampp72\htdocs\redbuzz>php artisan
'php' is not recognized as an internal or external command, operable program or batch file.
Then you need to add the folder your php.exe is in to your path.
From a year ago
davy_yg
•
a year ago
172
4
Laravel
migration
When trying to migrate table I get this:
C:\xampp\htdocs\shopee_lvl\framework>php artisan migrate Migration table created successfully.
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users2 add unique users2_email_unique(email))
at C:\xampp\htdocs\shopee_lvl\framework\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {
664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|
Exception trace:
1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes") C:\xampp\htdocs\shopee_lvl\framework\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458
2 PDOStatement::execute() C:\xampp\htdocs\shopee_lvl\framework\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458
Please use the argument -v to see more details.
C:\xampp\htdocs\shopee_lvl\framework>
The table does exist yet I cannot view it from the table tree structure.
He knows about php artisan. He has run migrations.
I usually know of what I speak.
I am sure one of the above will willingly forget, but that person has mentioned in the past to the OP that they have used laravel for quite a while, yet asked already learned question numerous times.
But just my 2 cents.
Reference: https://laracasts.com/discuss/channels/laravel/migration-7
Don't be a dick!
Ditto.
did you installed php??
If not, download and install it: https://windows.php.net/download/
If installed, then include your php execution file into your system environment PATH variable
Please or to participate in this conversation.