Featured Posts, Companies? Idea for store?

Posted 7 months ago by gidaban79

I am looking for idea how to proper store in database featured companies in listings or something similar.

Store only one feature time in one table? with dates from to?

        Schema::create('company_features', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('company_id');
            $table->boolean('is_featured')->default(0);
            $table->timestamp('featured_from')->nullable();
            $table->timestamp('featured_to')->nullable();
            $table->timestamps();
            $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
        });

however i need also store like history of featured times. Make another table for it?

Please sign in or create an account to participate in this conversation.