Does this happened to someone else, too. I created a site and at some point my migrations just don't wanna run anymore. Laravel is retrieving error that the table does not exist then I ran php artisan migration:reset
and manually dropped all tables from database, but same error was displayed again.
Error
Base table or view not found: 1146 Table 'db_blogtech.settings' doesn't exist
Here is that migration:
public function up()
{
Schema::create('settings', function (Blueprint $table) {
$table->id();
$table->string('site_name')->default("Digy Studio");
$table->text('site_description')->nullable();
$table->string('site_facebook')->nullable();
$table->string('site_instagram')->nullable();
$table->string('site_twitter')->nullable();
$table->string('site_linkedin')->nullable();
$table->string('site_behance')->nullable();
$table->string('site_dribbble')->nullable();
$table->string('site_email')->nullable();
$table->string('site_field_one')->nullable();
$table->string('site_field_one_value')->nullable();
$table->string('site_field_two')->nullable();
$table->string('site_field_two_value')->nullable();
$table->string('site_field_three')->nullable();
$table->string('site_field_three_value')->nullable();
$table->string('site_field_four')->nullable();
$table->string('site_field_four_value')->nullable();
$table->string('site_copyright')->nullable();
$table->string('site_creator_name')->nullable();
$table->string('site_creator_link')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('settings');
}
EDIT Since the problem is that Setting model is used in AppServiceProvider here is that part of the code. I am sharing it here to all views so I need it in all views and I am trying to avoid repeating myself in code. If there is other solution please write in comment or if someone knows how to put this in try catch
Here is the part of the code:
public function boot()
{
View::share('settings', Setting::firstOrFaiL());
}