Estoy estudiando Laravel 5.4
y tengo el siguiente problema:
Al realizar una migración, en la consola de Windows
ejecuto el comando:
php artisan migrate
Al ejecutar este comando, me muestra el siguiente error:
[Symfony\Component\Debug\Exception\FatalErrorException] Class 'Market\Providers\Schema' not found
¿Cómo puedo solucionar Class Schema not found
? anexo el código de las migraciones:
-Para crear la tabla de productos:
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('products', function (Blueprint $table){
$table->increments('id');
$table->string('name',100);
$table->decimal('price',5,2);
$table->integer('marks_id')->unsigned();
$table->foreign('marks_id')->references('id')->on('marks');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('products');
}
}
-Para crear la tabla de Marcas
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMarkTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('marks', function (Blueprint $table){
$table->increments('id');
$table->string('name',50);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('marks');
}
}
-Codigo de AppServiceProvider.php
<?php
namespace Market\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
composer dump-autoload
ycomposer update
?