title: Showing only Boolean 1 as published in laravel 8
body: <p>I using boolean for publish and draft, publish = 1 and draft = 0</p>
  <p>How do i show data in my view only for data that have value 1 or publish in laravel ?</p>
  <p>Here's my controller</p>
  <pre><code>public function index()
      {
          
          $posts = Post::where('is_active', '1');
          
  
          return view('pages/home', compact('posts'));
      }
  </code></pre>
  <p>Here's my database for Posts:</p>
  <pre><code>Schema::create('posts', function (Blueprint $table) {
              $table-&gt;id();
              $table-&gt;string('post_title', 60);
              $table-&gt;string('post_slug')-&gt;unique();
              $table-&gt;integer('post_seq');
              $table-&gt;string('post_thumbnail');
              $table-&gt;string('post_excerpt', 500);
              $table-&gt;text('post_description');
              $table-&gt;string('post_meta_title');
              $table-&gt;string('post_meta_description');
              $table-&gt;string('post_meta_keyword');
              $table-&gt;boolean('is_active')-&gt;default(0);
              $table-&gt;timestamps();
              $table-&gt;blameable();
          });
  </code></pre>
  <p>And here's my Post Model:</p>
  <pre><code>class Post extends Model
  {
      use HasFactory;
      protected $table = 'posts';
      protected $fillable = ['post_title', 'post_slug', 'post_thumbnail', 'post_seq', 'post_excerpt', 'post_description', 'post_meta_title', 'post_meta_description', 'post_meta_keyword', 'is_active', 'created_by'];
  
  } 
  </code></pre>
  <p>Here's my database in mysql</p>
  <p><a href="https://i.stack.imgur.com/bq7bn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bq7bn.png" alt="enter image description here" /></a></p>
  <p>Anyone can solve it?</p>