dimanche 25 mars 2018

Creating a "tenancy between two users"

I'm creating a property app and I need to let users start a "tenancy with eachother". I have two types of users in one database. One as a landlord, and one as a tenant. I want the landlord to go to the tenants profile, click create, open a form and then the landlord picks one of his assoicated properties. The tenant can can accept/reject this.

I took a friend system, and changed it to tennacy and of course that worked. But when I tried to add a property to the table I ran into all sorts of issue. I don't think it's written well as I didn't even get responses here.

So whats the best way to go about this. I have user profiles, landlords can upload properties ect. But I need a specific property assoicated with the tenancny.

Here is a scalled down property table.

Schema::create('property_adverts', function (Blueprint $table) {
            $table->increments('id');
            $table->string("photo");
            $table->string('address');
});

Here is the tenancy table

Schema::create('tenancies', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->integer('tenancy_id');

  //Works find without the below column. I need to associate a property with a tenancy.
            $table->string('property_address');
            $table->boolean('accepted')->default('0');
        });



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2IRXYhh
via IFTTT

Aucun commentaire:

Enregistrer un commentaire