Run artisan command in laravel 5

You need to remove php artisan part and put parameters into an array to make it work: public function store(Request $request) { Artisan::call(“infyom:scaffold”, [‘name’ => $request[‘name’], ‘–fieldsFile’ => ‘public/Product.json’]); } https://laravel.com/docs/5.2/artisan#calling-commands-via-code

Artisan, creating tables in database

Migration files must match the pattern *_*.php, or else they won’t be found. Since users.php does not match this pattern (it has no underscore), this file will not be found by the migrator. Ideally, you should be creating your migration files using artisan: php artisan make:migration create_users_table This will create the file with the appropriate … Read more

Laravel migrations change default value of column

You can use change() method: Schema::table(‘users’, function ($table) { $table->integer(‘active’)->default(0)->change(); }); Then run migrate command. Update For Laravel 4 use something like this: DB::statement(‘ALTER TABLE `users` CHANGE COLUMN `active` `active` INTEGER NOT NULL DEFAULT 0;’); Inside up() method instead of Schema::table(); clause.

Artisan Error: Failed to listen on localhost:8000

Fixing Error: Failed to listen on localhost:8000 (reason: Address already in use) List processes with php in it ps -ef | grep php Example output 501 **9347** 393 0 1:29PM ttys000 0:00.21 php artisan serve 501 9351 **9347** 0 1:29PM ttys000 0:02.01 /usr/local/php5-5.6.14-20151002-085853/bin/php -S localhost:8000 …/laravel/server.php 501 9781 393 0 1:56PM ttys000 0:00.00 grep php … Read more

ReflectionException: Class ClassName does not exist – Laravel

Perform a composer update, then composer dump-autoload. If the above doesn’t solve the problem, change the classmap in your composer.json file such that it contains the project-relative path to your php files: “autoload-dev”: { “classmap”: [ “tests/TestCase.php”, “database/seeds/UserTableSeeder.php” //include the file with its path here ] }, /** … */ and soon after, perform a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)