/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('property_portals', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name');
         $table->integer('sort_order')->default(0);
     });
     Schema::create('property_property_portal', function (Blueprint $table) {
         $table->integer('property_id')->unsigned();
         $table->integer('property_portal_id')->unsigned();
         $table->integer('user_id')->unsigned()->nullable();
         $table->timestamps();
         $table->foreign('property_id')->references('id')->on('properties')->onDelete('CASCADE');
         $table->foreign('property_portal_id')->references('id')->on('property_portals')->onDelete('CASCADE');
         $table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL');
     });
     \GoProp\Models\PropertyPortal::create(['name' => 'Rumah 123']);
     \GoProp\Models\PropertyPortal::create(['name' => 'Rumah.com']);
     \GoProp\Models\PropertyPortal::create(['name' => 'Rumah Dijual']);
     \GoProp\Models\PropertyPortal::create(['name' => 'Lamudi']);
 }
Example #2
0
            </div>
            <div class="col-sm-6 col-md-2">
                {!! Form::select('search[status]', $statusOptions, [Request::input('search.status')], ['class' => 'form-control select-chosen', 'id' => 'search-status']) !!}
            </div>
            <div class="col-sm-6 col-md-2">
                {!! Form::text('search[upload_date]', Request::input('search.upload_date'), ['class' => 'form-control input-datepicker-close', 'data-date-format' => 'dd-mm-yyyy', 'placeholder' => 'Upload Date', 'id' => 'search-upload-date']) !!}
            </div>
            <div class="col-sm-6 col-md-1">
                {!! Form::button('Filter', ['type' => 'submit', 'class' => 'btn btn-info']) !!}
            </div>
        </div>
        {!! Form::close() !!}
        @endif

        <?php 
$allPortals = \GoProp\Models\PropertyPortal::getAllPortals();
?>
        <div class="table-responsive">
            <table class="table table-bordered table-striped table-condensed table-hover">
                <thead>
                    <tr>
                        <th class="text-center">#</th>
                        <th>Code</th>
                        <th>Name</th>
                        <th>Location</th>
                        <th>For</th>
                        <th>Owner</th>
                        <th>Status</th>
                        <th>Upload Date</th>
                        @if($isAdmin)
                        <th>Portals</th>