tarang19

tarang19

Member Since 6 Months Ago

pune

Experience Points
15,600
Total
Experience

4,400 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
110
Lessons
Completed
Best Reply Awards
1
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 4
15,600 XP
Oct
20
1 day ago
Activity icon

Started a new Conversation Facebook Sign In For Web Applications With AWS Amplify Vue CLI

How to add facbook And google sign in using Aws Amplify with Vue cli

Activity icon

Replied to Aws Amplify Facebook/ Google Login In Vuejs

Thank you for replay but i need Vue CLI code

is this can i use on Vue CLI?

Activity icon

Started a new Conversation Aws Amplify Facebook/ Google Login In Vuejs

Any one know any tutorial for Socal login using AWS amplify

if any one have please share links

Oct
16
5 days ago
Activity icon

Started a new Conversation How To Send JWT Key From Cognito To Heders

I want to send JWT Token from header but i am not able to do it i am using Vuex and Nuxt in login i can get all all data but not able to send in vuex store and heder

login.vue

async login() {
      try {
        await this.$store.dispatch('auth/login', this.form)
        nuxtStorage.localStorage.setData('email', this.form.email)
        console.log('userrr', this.$auth.user.attributes.email)
        if (this.$auth.user.challengeName === 'NEW_PASSWORD_REQUIRED') {
          this.$router.push('/register')
        } else {
          this.$router.push('/home')
        }
      } catch (error) {
        this.overlay = true
        this.error = error.message
        console.log(error.message)
      }
    },

i am getting user details from cognito but not able to dispatch in store/file.js and in heeder

Activity icon

Started a new Conversation How To Set Cognito JWT Token For In Header Using Vuex

I have create cognito login and wanted to store JWT token in header using Vuex in nuxt any one guide me how to do this

i have file.js in storage but not able to get JWT token in file.js but my Token is coming under local vue file but not in central storage

login.vue

async login() {
      try {
        await this.$store.dispatch('auth/login', this.form)
        nuxtStorage.localStorage.setData('email', this.form.email)
        console.log('userrr', this.$auth.user.attributes.email)
        if (this.$auth.user.challengeName === 'NEW_PASSWORD_REQUIRED') {
          this.$router.push('/register')
        } else {
          this.$router.push('/home')
        }
      } catch (error) {
        this.overlay = true
        this.error = error.message
        console.log(error.message)
      }
    },

i am getting user details from cognito but not able to dispatch in store/file.js

Oct
15
6 days ago
Activity icon

Replied to Eloquent. Infinite Children Into Usable Array And Render It To Nested Ul

In user model

<?php

namespace App;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];

    public function person()
    {
        return $this->hasMany('App\Person');
    }
}

Person model

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Person extends Model
{
    public function user()
    {
        return $this->belongsTo('App\User');
    }
}
Activity icon

Started a new Conversation Eloquent. Infinite Children Into Usable Array And Render It To Nested Ul

I have User table and Person table they are connected to each other with hasMany relationship wanted to display infinite children

and want to show stating of parent_id = 0 witch is come from User Table

example:

{
   "id":"root0",
   "target":"_self",
   "generation":0,
   "data":null,
   "children":[
      {
         "id":"g501",
         "target":"_self",
         "generation":50,
         "data":{
            "name":"Karamchand Gandhi",
            "gender":"male",
            "placeOfBirth":"india",
            "dob":"01-01-1870",
            "dod":"01-01-1940",
            "fatherId":null,
            "motherId":null,
            "spouse":[
               "g502"
            ]
         },
         "children":[
            {
               "id":"g511",
               "target":"_self",
               "generation":51,
               "data":{
                  "name":"Mohandas Gandhi",
                  "gender":"male",
                  "placeOfBirth":"india",
                  "dob":"01-01-1870",
                  "dod":"01-01-1940",
                  "fatherId":"g501",
                  "motherId":"g502",
                  "spouse":[
                     "g512"
                  ]
               },
               "children":[
                  {
                     "id":"g521",
                     "target":"_self",
                     "generation":52,
                     "data":{
                        "name":"Hiralal Gandhi",
                        "gender":"male",
                        "placeOfBirth":"india",
                        "dob":"01-01-1870",
                        "dod":"01-01-1940",
                        "fatherId":"g511",
                        "motherId":"g512",
                        "spouse":[
                           
                        ]
                     }
                  },
                  {
                     "id":"g521",
                     "target":"_self",
                     "generation":52,
                     "data":{
                        "name":"Manilal Gandhi",
                        "gender":"male",
                        "placeOfBirth":"india",
                        "dob":"01-01-1870",
                        "dod":"01-01-1940",
                        "fatherId":"g511",
                        "motherId":"g512",
                        "spouse":[
                           
                        ]
                     }
                  }
               ]
            },
            {
               "id":"g512",
               "target":"_blank",
               "generation":51,
               "data":{
                  "name":"Kasturba Gandhi",
                  "gender":"female",
                  "placeOfBirth":"india",
                  "dob":"01-01-1870",
                  "dod":"01-01-1940",
                  "fatherId":null,
                  "motherId":null,
                  "spouse":[
                     "g511"
                  ]
               }
            }
         ]
      },
      {
         "id":"g502",
         "target":"_self",
         "generation":50,
         "data":{
            "name":"Putlibai Gandhi",
            "gender":"female",
            "placeOfBirth":"india",
            "dob":"01-01-1870",
            "dod":"01-01-1940",
            "fatherId":null,
            "motherId":null,
            "spouse":[
               "g501"
            ]
         }
      }
   ]
}
Activity icon

Started a new Conversation Json Create Issue

I wanted to try to generate following json but getting different JSON any one tell me where i done mistake in my code ?

Actual JSON

{
	"id": "1",
	"data": {
		"name": "user",
		"gender": "male",
		"dob": "21-09-1985",
		"dod": null
	},
	"_parents": [

		{
			"id": "1.1",
			"data": {
				"name": "father",
				"gender": "male",
				"dob": "21-09-1985",
				"dod": null
			},
			"_parents": []
		},

		{
			"id": "1.2",
			"data": {
				"name": "mother",
				"gender": "female",
				"dob": "21-09-1985",
				"dod": null
			},
			"_parents": []
		}

	],

	"_children": [

		{
			"id": "1.3",
			"data": {
				"name": "son",
				"gender": "male",
				"dob": "21-09-1985",
				"dod": null
			},
			"_children": []
		},

		{
			"id": "1.4",
			"data": {
				"name": "daughter",
				"gender": "female",
				"dob": "21-09-1985",
				"dod": null
			},
			"_children": []
		}

	],

	"_spouses": [],

	"_siblings": []

}

Generated JSON

{
"id": 1,
"data": {
"name": "user",
"gender": "Male",
"dob": "11-02-2020",
"dod": null
},
"_father": [
{
"id": 1,
"first_name": "father",
"middle_name": "a",
"last_name": "a",
"birth_date": "12-12-12",
"alive": "Yes",
"sex": "Male",
"user_id": "1",
"relationship_id": "1",
"persone_type_id": "1"
}
],
"_mother": [
{
"id": 2,
"first_name": "Mother",
"middle_name": "a",
"last_name": "a",
"birth_date": "12-12-12",
"alive": "Yes",
"sex": "Female",
"user_id": "1",
"relationship_id": "5",
"persone_type_id": "1"
}
]
}

Controller Code

public function tree(User $user)
    {
        $user = Auth::user();
        $result = $user->person;

        //filter data saprate father, mother, etc

        $collection = collect($result);

        $father_data = [];
        $mother_data = [];

        //Father data
        $father = $collection->each(function ($value, $key) use(&$father_data) {

            if ($value->relationship_id == '1') {
                # code...
                $data['id'] = $value->id;
                $data['first_name'] = $value->first_name;
                $data['middle_name'] = $value->middle_name;
                $data['last_name'] = $value->last_name;
                $data['birth_date'] = $value->birth_date;
                $data['alive'] = $value->alive;
                $data['sex'] = $value->sex;
                $data['user_id'] = $value->user_id;
                $data['relationship_id'] = $value->relationship_id;
                $data['persone_type_id'] = $value->persone_type_id;
                array_push($father_data, $data);
            }
            
        });
        //return $father_data;

        //Mother data
        $mother = $collection->filter(function ($value, $key) use(&$mother_data) {
            if ($value->relationship_id == '5') {
                # code...
                $data['id'] = $value->id;
                $data['first_name'] = $value->first_name;
                $data['middle_name'] = $value->middle_name;
                $data['last_name'] = $value->last_name;
                $data['birth_date'] = $value->birth_date;
                $data['alive'] = $value->alive;
                $data['sex'] = $value->sex;
                $data['user_id'] = $value->user_id;
                $data['relationship_id'] = $value->relationship_id;
                $data['persone_type_id'] = $value->persone_type_id;
                array_push($mother_data, $data);
            }
        });
        //return $mother_data;

        return response()->json([
            'id' => $user->id,
            'data' => [
                "name" => $user->name,
                "gender" => $user->gender,
                "dob" => $user->dob,
                "dod" =>$user->dod
            ],
            "_father" => $father_data,
            "_mother" => $mother_data,

        ]);
    }
Activity icon

Replied to Create JSON For Family Tree Using Laravel 7

Hello , In DB i have two table one is user and person in user table i have store root person and person all relative info so how can i get filter data

Activity icon

Started a new Conversation Recursive Function To Create Multi Level Menu In Laravel 7

Any one know how to create multi level menu using laravel 7 with database please guide me

Activity icon

Replied to Create JSON For Family Tree Using Laravel 7

Thank for replay one question if i have _spouses and _siblings in that there parents (Nested Family) still this logic will work ?

Thank you

Oct
14
1 week ago
Activity icon

Replied to Create Json Usign Collection Filter Laravel 7

now i am giving only 1 user_id in Person table and add relationship with one to many

can you please guide me on this ?

how can i restructure database and get json object?

Thank you

Activity icon

Replied to Create JSON For Family Tree Using Laravel 7

Thank you for response Can you share database structure if you have ?

Thank you

Activity icon

Started a new Conversation Create JSON For Family Tree Using Laravel 7

I wanted to create JOSN for Family tree and i am new in Laravel Wanted to create following JSON using Database

{
	"id": "1",
	"data": {
		"name": "user",
		"gender": "male",
		"dob": "21-09-1985",
		"dod": null
	},
	"_parents": [

		{
			"id": "1.1",
			"data": {
				"name": "father",
				"gender": "male",
				"dob": "21-09-1985",
				"dod": null
			},
			"_parents": []
		},

		{
			"id": "1.2",
			"data": {
				"name": "mother",
				"gender": "female",
				"dob": "21-09-1985",
				"dod": null
			},
			"_parents": []
		}

	],

	"_children": [

		{
			"id": "1.3",
			"data": {
				"name": "son",
				"gender": "male",
				"dob": "21-09-1985",
				"dod": null
			},
			"_children": []
		},

		{
			"id": "1.4",
			"data": {
				"name": "daughter",
				"gender": "female",
				"dob": "21-09-1985",
				"dod": null
			},
			"_children": []
		}

	],

	"_spouses": [],

	"_siblings": []

}

any one know logic to create this type of JSON?

Activity icon

Replied to Create Json Usign Collection Filter Laravel 7

Thank you sir for replay

in my relationships table i have following entry

id & type

in type i have parents children siblings spouses

in person Model i dont have related_user_id so need to create one Relationship table ?

And after done relationship in user table what type of query or eloquent in controller so i can get JSON

Thank you

Oct
13
1 week ago
Activity icon

Replied to Laravel 7 Collection Fillter Issue

Thank you sir for response filter is the first step i wanted to achieve a nested JSON like flowing is that any function to achieve this ?

{
    "id": "1",
    "data": {
        "name": "user",
        "gender": "male",
        "dob": "21-09-1985",
        "dod": null
    },
    "_parents": [

 

        {
            "id": "1.1",
            "data": {
                "name": "father",
                "gender": "male",
                "dob": "21-09-1985",
                "dod": null
            },
            "_parents": []
        },

 

        {
            "id": "1.2",
            "data": {
                "name": "mother",
                "gender": "female",
                "dob": "21-09-1985",
                "dod": null
            },
            "_parents": []
        }

 

    ],

 

    "_children": [

 

        {
            "id": "1.3",
            "data": {
                "name": "son",
                "gender": "male",
                "dob": "21-09-1985",
                "dod": null
            },
            "_children": []
        },

 

        {
            "id": "1.4",
            "data": {
                "name": "daughter",
                "gender": "female",
                "dob": "21-09-1985",
                "dod": null
            },
            "_children": []
        }

 

    ],

 

    "_spouses": [],

 

    "_siblings": []

 

}

Thank you

Activity icon

Started a new Conversation Create Json Usign Collection Filter Laravel 7

I wanted to generate json using collection fillter

added relationship in model (hasMany)

i have two table one is User and Person

I am getting stuck on after fillter data what will be the next stape

json example

{
    "id": "1",
    "data": {
        "name": "user",
        "gender": "male",
        "dob": "21-09-1985",
        "dod": null
    },
    "_parents": [

 

        {
            "id": "1.1",
            "data": {
                "name": "father",
                "gender": "male",
                "dob": "21-09-1985",
                "dod": null
            },
            "_parents": []
        },

 

        {
            "id": "1.2",
            "data": {
                "name": "mother",
                "gender": "female",
                "dob": "21-09-1985",
                "dod": null
            },
            "_parents": []
        }

 

    ],

 

    "_children": [

 

        {
            "id": "1.3",
            "data": {
                "name": "son",
                "gender": "male",
                "dob": "21-09-1985",
                "dod": null
            },
            "_children": []
        },

 

        {
            "id": "1.4",
            "data": {
                "name": "daughter",
                "gender": "female",
                "dob": "21-09-1985",
                "dod": null
            },
            "_children": []
        }

 

    ],

 

    "_spouses": [],

 

    "_siblings": []

 

}

controller code

public function index(User $user)
    {   
        $user = auth()->user();
        $a = $user->person->id;
       $records = $user->person;
       //dd($records);

       //$dd = Relationship::all();

        // $s = $user->person->relationship_id;
        
        $collection = collect($records);

        $filter = $collection->filter(function ($value, $key){
            
            return $value->relationship_id == '1'; //returns true or false

            //dd($value->id);

        });
        return $filter;

        // $article = User::with(['person'])->first();
        // return $article;
    }   

any one know what will be the next stap to get json as shown in example

Activity icon

Started a new Conversation Laravel 7 Collection Fillter Issue

I wanted to get filter data using collection fillter but i am getting all data i dont understand what is my mistake

wanted only whos relationship_id == 1 but i get all data from database

my code

public function index(User $user)
    {   
        $user = auth()->user();
        //$a = $user->person->id;
       $records = $user->person;

       $dd = Relationship::all();

        // $s = $user->person->relationship_id;
        
        $collection = collect($records);

        $filter = $collection->filter(function ($value, $key){
            
            //dd($value->relationship_id);
            if ($value->relationship_id == '1') {
                # code...
                return;
            }
            //dd($value->id);

        });
        return $collection;
    }   

output data

[
{
"id": 1,
"first_name": "father",
"middle_name": "a",
"last_name": "a",
"birth_date": "12-12-12",
"birth_place": null,
"alive": "Yes",
"sex": "Male",
"day_death": null,
"death_place": null,
"marriage_date": null,
"user_id": "1",
"relationship_id": "1",
"persone_type_id": "1",
"created_at": null,
"updated_at": null
},
{
"id": 2,
"first_name": "Mother",
"middle_name": "a",
"last_name": "a",
"birth_date": "12-12-12",
"birth_place": null,
"alive": "Yes",
"sex": "Female",
"day_death": null,
"death_place": null,
"marriage_date": null,
"user_id": "1",
"relationship_id": "4",
"persone_type_id": "1",
"created_at": null,
"updated_at": null
}
]

Any one please tell me where i have done mistake ?

Oct
12
1 week ago
Activity icon

Replied to How To Format Nested Set Table Data To Work In JsTree?

Can you tell me how to design database?

Activity icon

Replied to How To Create Nested Json Object Query From 5 Tables?

Any one know kindly tell me

Activity icon

Started a new Conversation How To Create Nested Json Object Query From 5 Tables?

I wanted to create Dynamic Json using database table how can i achieve this

Following JOSN is expected from my function

{
   "id":"root0",
   "target":"_self",
   "generation":0,
   "data":null,
   "children":[
      {
         "id":"g501",
         "target":"_self",
         "generation":50,
         "data":{
            "name":"Karamchand Gandhi",
            "gender":"male",
            "placeOfBirth":"india",
            "dob":"01-01-1870",
            "dod":"01-01-1940",
            "fatherId":null,
            "motherId":null,
            "spouse":[
               "g502"
            ]
         },
         "children":[
            {
               "id":"g511",
               "target":"_self",
               "generation":51,
               "data":{
                  "name":"Mohandas Gandhi",
                  "gender":"male",
                  "placeOfBirth":"india",
                  "dob":"01-01-1870",
                  "dod":"01-01-1940",
                  "fatherId":"g501",
                  "motherId":"g502",
                  "spouse":[
                     "g512"
                  ]
               },
               "children":[
                  {
                     "id":"g521",
                     "target":"_self",
                     "generation":52,
                     "data":{
                        "name":"Hiralal Gandhi",
                        "gender":"male",
                        "placeOfBirth":"india",
                        "dob":"01-01-1870",
                        "dod":"01-01-1940",
                        "fatherId":"g511",
                        "motherId":"g512",
                        "spouse":[
                           
                        ]
                     }
                  },
                  {
                     "id":"g521",
                     "target":"_self",
                     "generation":52,
                     "data":{
                        "name":"Manilal Gandhi",
                        "gender":"male",
                        "placeOfBirth":"india",
                        "dob":"01-01-1870",
                        "dod":"01-01-1940",
                        "fatherId":"g511",
                        "motherId":"g512",
                        "spouse":[
                           
                        ]
                     }
                  }
               ]
            },
            {
               "id":"g512",
               "target":"_blank",
               "generation":51,
               "data":{
                  "name":"Kasturba Gandhi",
                  "gender":"female",
                  "placeOfBirth":"india",
                  "dob":"01-01-1870",
                  "dod":"01-01-1940",
                  "fatherId":null,
                  "motherId":null,
                  "spouse":[
                     "g511"
                  ]
               }
            }
         ]
      },
      {
         "id":"g502",
         "target":"_self",
         "generation":50,
         "data":{
            "name":"Putlibai Gandhi",
            "gender":"female",
            "placeOfBirth":"india",
            "dob":"01-01-1870",
            "dod":"01-01-1940",
            "fatherId":null,
            "motherId":null,
            "spouse":[
               "g501"
            ]
         }
      }
   ]
}

in my database i have 5 different table that connected to each other using Many to Many relationship

User, Family_tree, relationships, roles, relationship_types,

Oct
11
1 week ago
Activity icon

Started a new Conversation Family Tree Database Design

Any one know how to design database for family tree database i am new in database anyone help me

(ancestry database design)

Activity icon

Replied to Relationships Within A Family If The Base-object Is A Person

Have any video tutorial that how to use api in vue js?

Oct
10
1 week ago
Activity icon

Replied to Relationships Within A Family If The Base-object Is A Person

Thank you for replay family search provid any api to create Family tree ?

Activity icon

Started a new Conversation Relationships Within A Family If The Base-object Is A Person

any one know any pre created DB for family tree (ancestor tree) please let me know if any one know

What's the best db structure to represent the relationships within a family if the base-object is a Person

Oct
08
1 week ago
Activity icon

Started a new Conversation Any One Tell Me Capacitor Js Vs Nativescript

I want to decide to go with witch technology for native development any one can tell me which is better and use with vue JS

Oct
07
2 weeks ago
Activity icon

Started a new Conversation On Page Refresh Getting Error Unexpected Token 'export' Nuxt

I am getting error on page refresh dont know what happened can some one help me

Using vuetify

index.vue

<template>
  <v-container-float>
    <v-row class="mt-0">
      <v-col cols="12" sm="12" md="12" class="pr-6">
        <v-btn
          v-if="showTable === true"
          color="primary"
          class="mt-0 mr-0 float-right"
          @click="createNewEntry(true)"
          >Create New Person Entry</v-btn
        >
        <v-btn
          v-if="showEntryForm === true || ShowLanguageEntryForm === true"
          color="primary"
          class="mt-0 mr-0 float-right"
          @click="back"
          >Back</v-btn
        >
      </v-col>
    </v-row>
    <v-row>
      <v-col cols="12" sm="6" md="6" class="pl-6">
        <v-card class="pa-0" outlined tile>
          <pdf-viewer v-if="hidePdf === false" />
          <v-img
            v-if="hidePdf === true"
            :src="editData.imageUrl"
            max-height="700px"
            max-width="700px"
            class="image-view"
          ></v-img>
        </v-card>
      </v-col>
      <v-col cols="6" md="6" class="pr-6">
        <v-card
          class="pa-2"
          style="max-height: 700px; height: 671px"
          outlined
          tile
        >
          <div v-if="showTable === true">
            <person-table
              id="style-8"
              style="max-height: 650px; overflow-x: auto"
              :persons="person"
              @updateTable="edited"
            ></person-table>
          </div>
          <v-row v-if="showTable === false">
            <v-tabs
              v-model="tab"
              background-color="primary"
              class="elevation-2 pa-2"
              dark
              :centered="centered"
              :grow="grow"
              :vertical="vertical"
              :prev-icon="
                prevIcon ? 'mdi-arrow-left-bold-box-outline' : undefined
              "
              :next-icon="
                nextIcon ? 'mdi-arrow-right-bold-box-outline' : undefined
              "
              :icons-and-text="icons"
            >
              <v-tab v-if="language != 'English'" :href="search">
                {{ language }}
                <v-icon v-if="icons">mdi-phone</v-icon>
              </v-tab>
              <v-tab-item key="search">
                <PersonDetails
                  :edit-data="editData"
                  :category="category"
                  @personData="getPersonData"
                ></PersonDetails>
                <v-btn
                  v-if="language === 'English'"
                  class="mr-4"
                  @click="createData"
                  >Save</v-btn
                >
                <v-btn v-if="language === 'English'" @click="clear"
                  >clear</v-btn
                >
              </v-tab-item>
              <v-tab :href="regional">
                English
                <v-icon v-if="icons">mdi-phone</v-icon>
              </v-tab>
              <v-tab-item key="regional">
                <v-card>
                  <PersonRegionalLanguage
                    :edit-data="editData"
                    :category="category"
                    @personLangData="getPersonLangData"
                  ></PersonRegionalLanguage>
                  <v-btn class="mr-4" @click="createData">Save</v-btn>
                  <v-btn @click="clear">clear</v-btn>
                </v-card>
              </v-tab-item>
            </v-tabs>
          </v-row>
        </v-card>
      </v-col>
    </v-row>
    <v-row>
      <v-col cols="12" sm="6" md="12" class="pl-6 pr-6">
        <v-card class="pa-0 pl-2 mt-2" outlined tile>
          <v-card-title>{{ filename }}</v-card-title>
          <v-card-subtitle>{{ fileSourceDate }}</v-card-subtitle>
          <v-card-text>
            <div class="row">
              <div class="col-md-6">Source : {{ fileSource }}</div>
            </div>
            <div class="row">
              <div class="col-md-6">Owner : {{ creator }}</div>
            </div>
          </v-card-text>
        </v-card>
      </v-col>
    </v-row>
  </v-container-float>
</template>
<script>
import nuxtStorage from 'nuxt-storage'
import { mapState } from 'vuex'
import PdfViewer from './../components/PdfViewer.vue'
// import PersonTable from './../components/PersonTable.vue'
import PersonDetails from './../components/PersonDetails.vue'
import PersonRegionalLanguage from './../components/PersosnRegionalLanguage.vue'
export default {
  components: {
    PdfViewer,
    // PersonTable,
    PersonDetails,
    PersonRegionalLanguage
  },

  computed: {
    getDatas() {
      return this.$store.getters.getData
    },
    ...mapState(
      { person: (state) => state.person.data },
      { detail: (state) => state.details.data }
    )
  },
  // eslint-disable-next-line vue/require-prop-types
  props: ['persons', 'lang', 'editData', 'category'],
  data: () => ({
    tab: null,
    text: '',
    icons: false,
    centered: false,
    grow: true,
    vertical: false,
    prevIcon: false,
    nextIcon: false,
    tabs: 2,
    files: [],
    creator: '',
    persons: [],
    editperson: {},
    fileSource: '',
    fileSourceDate: '',
    category: '',
    filename: '',
    language: '',
    lang: '',
    showEntryForm: false,
    ShowLanguageEntryForm: false,
    showTable: true,
    hideLanguageInput: false,
    hidePdf: false,
    testData: {},
    testLangData: {},
    editData: {}
  }),
  mounted() {
    const fileDetails = nuxtStorage.localStorage.getData('url')
    this.id = fileDetails.id
    this.category = fileDetails.category
    this.creator = fileDetails.creator
    this.fileSource = fileDetails.fileSource
    this.fileSourceDate = fileDetails.fileSourceDate
    this.filename = fileDetails.name
    this.language = fileDetails.language
    if (this.language === 'English') {
      this.tabs = 1
      this.lang = this.language
    } else {
      this.tabs = 2
    }
    this.personsDetails(this.id)
    this.getFileDetails()
  },
  methods: {
    async getFileDetails() {
      await this.$store.dispatch('details/getDetails')
    },
    getPersonData(data) {
      this.testData = data
    },
    getPersonLangData(data) {
      this.testLangData = data
    },
    async personsDetails(id) {
      this.persons = await this.$store.dispatch('person/getPersons', { id })
      // const personDetails = await this.$axios.$get(
      //   'http://localhost:3000/persons/getPersons/' + id
      // )
      // console.log('personDetails', personDetails)
      // this.persons = personDetails
    },
    createData() {
      if (this.editData._id) {
        this.editP(this.editData._id)
      } else {
        const formData = new FormData()
        formData.append('image', this.testData.image)
        const image = formData
        this.$axios
          .$post('https://data-insertion-api.sptr.co/image-upload', image, {
            headers: {
              'Content-Type': 'multipart/form-data'
            }
          })
          .then((resp) => {
            console.log('resposne', resp.imageUrl)
            if (this.language === 'English') {
              const data = {
                name: this.testData.name,
                middleName: this.testData.middleName,
                lastName: this.testData.lastName,
                village: this.testData.village,
                dateOfDeath: this.testData.dateOfDeath,
                dateOfBirth: this.testData.dateOfBirth,
                pId: this.id,
                sex: this.testData.sex,
                age: this.testData.age,
                spouce: this.testData.spouce,
                language: this.language,
                imageUrl: resp.imageUrl
              }
              this.$axios
                .$post(
                  'https://data-insertion-api.sptr.co/persons/createPersons/',
                  data
                )
                .then((resp) => {
                  this.personsDetails(this.id)
                  this.back()
                })
            } else {
              const data = {
                name: this.testLangData.nameLanguage,
                middleName: this.testLangData.middleNameLanguage,
                lastName: this.testLangData.lastNameLanguage,
                village: this.testLangData.villageLanguage,
                dateOfDeath: this.testData.dateOfDeath,
                dateOfBirth: this.testData.dateOfBirth,
                pId: this.id,
                sex: this.testData.sex,
                age: this.testData.age,
                spouce: this.testData.spouce,
                language: this.language,
                regionalName: this.testData.name,
                regionalMiddleName: this.testData.middleName,
                regionalLastName: this.testData.lastName,
                regionalVillage: this.testData.village,
                imageUrl: resp.imageUrl
              }
              this.$axios
                .$post(
                  'https://data-insertion-api.sptr.co/persons/createPersons/',
                  data
                )
                .then((resp) => {
                  this.personsDetails(this.id)
                  this.back()
                })
            }
          })
      }
    },
    edited(data) {
      console.log('edited', data)
      this.editData = data
      this.hidePdf = true
      this.showEntryForm = true
      this.showTable = false
    },
    editP(id) {
      if (this.language === 'English') {
        const data = {
          name: this.testData.name,
          middleName: this.testData.middleName,
          lastName: this.testData.lastName,
          village: this.testData.village,
          dateOfDeath: this.testData.dateOfDeath,
          dateOfBirth: this.testData.dateOfBirth,
          pId: this.id,
          sex: this.testData.sex,
          age: this.testData.age,
          spouce: this.testData.spouce,
          language: this.language
        }
        const editPerson = this.$axios.$put(
          'https://data-insertion-api.sptr.co/persons/updatePersons/' + id,
          data
        )
        this.personsDetails(this.id)
        this.back()
        console.log('editPerson', editPerson)
        this.editperson = editPerson
      } else {
        const data = {
          name: this.testLangData.nameLanguage,
          middleName: this.testLangData.middleNameLanguage,
          lastName: this.testLangData.lastNameLanguage,
          village: this.testLangData.villageLanguage,
          dateOfDeath: this.testData.dateOfDeath,
          dateOfBirth: this.testData.dateOfBirth,
          pId: this.id,
          sex: this.testData.sex,
          age: this.testData.age,
          spouce: this.testData.spouce,
          language: this.language,
          regionalName: this.testData.name,
          regionalMiddleName: this.testData.middleName,
          regionalLastName: this.testData.lastName,
          regionalVillage: this.testData.village,
          imageUrl: this.editData.imageUrl
        }
        const editPerson = this.$axios.$put(
          'https://data-insertion-api.sptr.co/persons/updatePersons/' + id,
          data
        )
        this.personsDetails(this.id)
        this.back()
        console.log('editPerson', editPerson)
        this.editperson = editPerson
      }
    },
    back() {
      this.hidePdf = false
      this.showTable = true
      this.showEntryForm = false
      this.ShowLanguageEntryForm = false
    },
    createNewEntry(val) {
      this.editData = {}
      this.showEntryForm = val
      this.showTable = false
      this.personsDetails(this.id)
    },
    regionalLanguageEntry(val) {
      this.showEntryForm = false
      this.showTable = false
      this.ShowLanguageEntryForm = val
      this.hideLanguageInput = true
    }
  }
}
</script>
<style scoped>
#style-8::-webkit-scrollbar-track {
  border: 1px solid #2196f3;
  background-color: #f5f5f5;
}

#style-8::-webkit-scrollbar {
  width: 10px;
  background-color: #f5f5f5;
}

#style-8::-webkit-scrollbar-thumb {
  background-color: #2196f3;
}
</style>
Activity icon

Replied to Missing Stack Frames In Vue Nuxt

home.vue

<template>
  <v-layout>
    <v-flex>
      <div class="pa-0">
        <v-row class="mt-0">
          <v-col cols="12" sm="12" md="12" class="">
            <v-btn
              v-if="showForm === false"
              color="primary"
              class="mt-3 mr-2 float-right"
              @click="createNewEntry()"
              >Create New File Entry</v-btn
            >
            <v-text-field
              v-if="showForm === false"
              v-model="search"
              label="Search"
              class="mt-0 ml-2 float-left"
            ></v-text-field>
            <v-btn
              v-if="showForm === true"
              color="primary"
              class="mt-0 mr-2 float-right"
              @click="back"
              >Back</v-btn
            >
          </v-col>
        </v-row>
        <!-- <v-row
          ><v-col cols="12" sm="12" md="12" class="pr-6"
            ></v-col
        ></v-row> -->
        <v-card v-if="showForm === true" class="pa-4 mb-4"
          ><file-details @fileData="getFileData"></file-details>
          <v-btn class="ml-2 mr-4" @click="createData">Save</v-btn>
          <v-btn @click="clear">clear</v-btn></v-card
        >
        <v-data-table
          v-if="showForm === false"
          :headers="headers"
          :items="files"
          :search="search"
          sort-by="calories"
          class="col-md-12 elevation-1"
        >
          <template v-slot:item.fileSourceDate="{ item }">
            <span>{{ $moment(item.fileSourceDate).format('MM/DD/YYYY') }}</span>
          </template>
          <template v-slot:item.actions="{ item }">
            <v-icon small class="mr-2"></v-icon>
            <nuxt-link to="/view">
              <v-btn
                class="mb-2 mt-2"
                color="primary"
                depressed
                @click="
                  openPdf(
                    item._id,
                    item.category,
                    item.fileType,
                    item.fileUrl,
                    item.fileName,
                    item.fileSource,
                    $moment(item.fileSourceDate).format('MM/DD/YYYY'),
                    item.language,
                    item.creator
                  )
                "
                >Open</v-btn
              >
            </nuxt-link>
          </template>
        </v-data-table>
      </div>
    </v-flex>
  </v-layout>
</template>

<script>
import nuxtStorage from 'nuxt-storage'
import { mapState } from 'vuex'
import FileDetails from '../components/FileDetails.vue'

export default {
  components: {
    FileDetails
  },
  data: () => ({
    fileData: {},
    showForm: false,
    search: '',
    dialog: false,
    headers: [
      {
        text: 'File',
        align: 'left',
        sortable: false,
        value: 'fileUrl'
      },
      { text: 'Title', align: 'center', value: 'fileName' },
      { text: 'File Source', align: 'center', value: 'fileSource' },
      { text: 'Language', align: 'center', value: 'language' },
      { text: 'Source Date', align: 'center', value: 'fileSourceDate' },
      { text: 'Category', align: 'center', value: 'category' },
      { text: 'Actions', align: 'center', value: 'actions', sortable: false }
    ],
    filesPDFS: [],
    editedIndex: -1,
    editedItem: {
      fileUrl: '',
      fileName: '',
      fileSource: '',
      creator: '',
      fileSourceDate: ''
    },
    defaultItem: {
      fileUrl: '',
      fileName: '',
      fileSource: '',
      creator: '',
      fileSourceDate: ''
    }
  }),

  computed: {
    ...mapState(
      { files: (state) => state.file.data },
      { details: (state) => state.details.data }
    )
  },

  watch: {
    dialog(val) {
      val || this.close()
    }
  },

  mounted() {
    this.filesPDFS = this.files
    console.log(process.env.PRD)
    this.getAllFiles()
  },

  methods: {
    getFileData(data) {
      this.fileData = data
    },
    createNewEntry() {
      this.showForm = true
    },
    createData() {
      //   if (this.editData._id) {
      //     this.editP(this.editData._id)
      //   } else {
      if (this.fileData.fileType === 'Image') {
        console.log('in image', this.fileType)
        const formData = new FormData()
        formData.append('image', this.fileData.image)
        const image = formData
        this.$axios
          .$post('https://data-insertion-api.sptr.co/image-upload', image, {
            headers: {
              'Content-Type': 'multipart/form-data'
            }
          })
          .then((resp) => {
            const data = {
              fileName: this.fileData.fileName,
              fileSource: this.fileData.fileSource,
              fileType: this.fileData.fileType,
              fileSourceDate: this.fileData.fileSourceDate,
              language: this.fileData.language,
              fileUrl: resp.imageUrl,
              category: this.fileData.category,
              creator: this.fileData.creator
            }
            this.$axios
              .$post(
                'https://data-insertion-api.sptr.co/files/createFiles/',
                data
              )
              .then((resp) => {
                this.back()
                this.getAllFiles()
              })
          })
      } else {
        console.log('out', this.fileType)
        const data = {
          fileName: this.fileData.fileName,
          fileSource: this.fileData.fileSource,
          fileType: this.fileData.fileType,
          fileSourceDate: this.fileData.fileSourceDate,
          language: this.fileData.language,
          fileUrl: this.fileData.fileUrl,
          category: this.fileData.category,
          creator: this.fileData.creator
        }
        this.$axios
          .$post('https://data-insertion-api.sptr.co/files/createFiles/', data)
          .then((resp) => {
            this.back()
            this.getAllFiles()
          })
      }
    },
    back() {
      this.showForm = false
    },
    async getAllFiles() {
      this.files = await this.$store.dispatch('file/getFiles')
      //   console.log('file', this.files)
      // const files = await this.$axios.$get(
      //   'http://localhost:3100/files/getFiles'
      // )
    },

    openPdf(id, category, type, url, name, src, srcDate, language, creator) {
      const fileDetails = {
        id,
        category,
        type,
        url,
        name,
        fileSource: src,
        fileSourceDate: srcDate,
        language,
        creator
      }
      this.$store.dispatch('details/getDetails', { fileDetails })
      nuxtStorage.localStorage.setData('url', fileDetails, 120)
    }
  }
}
</script>

package.json

{
  "name": "kutumb",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .",
    "lint": "yarn lint:js",
    "test": "jest"
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.12.0",
    "@nuxtjs/dotenv": "^1.4.1",
    "@nuxtjs/moment": "^1.6.1",
    "@nuxtjs/pwa": "^3.0.0-beta.20",
    "@pdftron/webviewer": "^7.0.1",
    "nuxt": "^2.14.0",
    "nuxt-moment": "^1.0.5",
    "nuxt-storage": "^1.2.2",
    "store": "^2.0.12",
    "vee-validate": "^3.3.9",
    "vue": "^2.6.12",
    "vuetify": "^2.3.13"
  },
  "devDependencies": {
    "@mdi/font": "^5.6.55",
    "@nuxt/types": "^2.14.6",
    "@nuxtjs/eslint-config": "^3.1.0",
    "@nuxtjs/eslint-module": "^2.0.0",
    "@vue/test-utils": "^1.0.3",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^26.1.0",
    "eslint": "^7.5.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-nuxt": "^1.0.0",
    "eslint-plugin-prettier": "^3.1.4",
    "jest": "^26.1.0",
    "prettier": "^2.0.5",
    "vue-jest": "^3.0.4"
  }
}
Activity icon

Started a new Conversation How To Install Vuetify In Nuxt Js

Any one know how to install Vuetify in nuxt js

Activity icon

Started a new Conversation Missing Stack Frames In Vue Nuxt

I got an issue with nuxt route showing error of Unexpected token 'export'

Any one know how to solve

Sep
29
3 weeks ago
Activity icon

Started a new Conversation Any One Know Zend Framework Vs Laravel

Can anyone tell me difference between zend framework vs laravel

Thank you

Sep
24
3 weeks ago
Activity icon

Replied to Any One Know NativeScript Vue Tutorial

Thank you sir for replay , Is that any video tutorial available from scratch to deployment

Activity icon

Started a new Conversation Any One Know NativeScript Vue Tutorial

Any one know where i can start learning NativeScript Vue from scratch

Sep
23
4 weeks ago
Activity icon

Started a new Conversation Wanted To Create Multi Language Form In Vue Js

Any one know How to create multi language form save form data in reginal language and English to

Sep
16
1 month ago
Activity icon

Started a new Conversation How To Create Custom Template Using Orgchart In Vue Js

How to create Custom template using custom template using orgchart in vue js any know please let me know

this is in JavaScript

https://balkangraph.com/OrgChartJS/Docs/CreatingCustomTemplate
Activity icon

Started a new Conversation Not Able To Get Data From Axios Using Nuxt Js

Wanted to fetch data from central store using nuxt js but it not working but when i try in using mounted in component its work any one know what is the issue

store/file.js

export const state = () => ({
  filesPDF: []
})

export const mutations = {
  SET_FILES(state, filesPDF) {
    state.filesPDF = filesPDF
  }
}

export const actions = {
  async getFiles({ commit }) {
    const filesPDF = await this.$axios.$get(
      'http://localhost:3000/files/getFiles'
    )
    commit('SET_FILES', filesPDF)
  }
}

App.vue

<template>
  <v-layout>
    <v-flex>
      <div class="row ml-30 pl-5 mt-2">hii {{ file }}</div>
      <div class="row text-center pa-5">
        <ul>
          <li v-for="f in filesPdf" :key="f">{{ f.name }}</li>
        </ul>
        <v-data-table
          :headers="headers"
          :items="filesPdf"
          sort-by="calories"
          class="col-md-12 elevation-1"
        >
          <template :item="{ item }">
            <v-icon small class="mr-2"> </v-icon>
            <nuxt-link to="/view"
              ><v-btn
                class="mb-5"
                color="primary"
                depressed
                @click="
                  openPdf(
                    item._id,
                    item.fileUrl,
                    item.fileName,
                    item.fileSource,
                    item.fileSourceDate,
                    item.creator
                  )
                "
              >
                Open {{ file }}
              </v-btn></nuxt-link
            >
          </template>
        </v-data-table>
      </div>
    </v-flex>
  </v-layout>
</template>

<script>
import nuxtStorage from 'nuxt-storage'
import { mapState } from 'vuex'

export default {
  data: () => ({
    dialog: false,
    headers: [
      {
        text: 'File',
        align: 'left',
        sortable: false,
        value: 'fileUrl'
      },
      { text: 'Title', align: 'center', value: 'fileName' },
      { text: 'File Source', align: 'center', value: 'fileSource' },
      { text: 'Owner', align: 'center', value: 'creator' },
      { text: 'Source Date', align: 'center', value: 'fileSourceDate' },
      { text: 'Actions', align: 'center', value: 'actions', sortable: false }
    ],
    filesPdf: [],
    editedIndex: -1,
    editedItem: {
      fileUrl: '',
      fileName: '',
      fileSource: '',
      creator: '',
      fileSourceDate: ''
    },
    defaultItem: {
      fileUrl: '',
      fileName: '',
      fileSource: '',
      creator: '',
      fileSourceDate: ''
    }
  }),

  computed: {
    ...mapState({ file: (state) => state.file.filesPDF }),
    formTitle() {
      return this.editedIndex === -1 ? 'New Entry' : 'Edit Entry'
    }
  },

  watch: {
    dialog(val) {
      val || this.close()
    }
  },

  // mounted() {
  //   this.getAllFiles()
  // },

  // methods: {
  //   getAllFiles() {
  //     const files = this.$axios.$get(
  //       'https://jsonplaceholder.typicode.com/comments'
  //     )
  //     this.filesPdf = files
  //   },

    openPdf(id, url, name, src, srcDate, creator) {
      const fileDetails = {
        id,
        url,
        name,
        fileSource: src,
        fileSourceDate: srcDate,
        creator
      }
      nuxtStorage.localStorage.setData('url', fileDetails, 120)
    }
  }
}
</script>
Sep
15
1 month ago
Activity icon

Replied to How To Use OrgChart JS In Vue

Thank you for replay But how to add tree item using vue method?

Activity icon

Replied to How To Use OrgChart JS In Vue

Any one Know ? please ans

Sep
14
1 month ago
Activity icon

Started a new Conversation How To Use OrgChart JS In Vue

Wanted to use OrgChart JS and want to add card dynamically any one know how to create or any one have demo code eg. https://balkangraph.com/OrgChartJS/Demos/FirstLook

How to integrate in Vuejs

Activity icon

Replied to Wanted To Create Family Tree With Vue JS

Wanted to add name, age, photo, birthrate when user add two new tree created dynamically and user can enter there father and mother details after submit more two component created for there father and mother and so on

For EG Me A-> father A & mother A -> Father A father & Mother of A Mother

Just like in https://www.familysearch.org/

Activity icon

Started a new Conversation Wanted To Create Family Tree With Vue JS

Hello, Is that any one know any plugin or script that i can create dynamically Family tree in Vue js Like:OrgChart JS

Any other script please let me know

Sep
01
1 month ago
Activity icon

Started a new Conversation Avoid Mutating A Prop Directly

i need to send props to parent to child but when i send data i get following warning

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "userAge"

Parent Code

<template>
    <div class="component">
        <h1>The User Component</h1>
        <p>I'm an awesome User!</p>
       <button @click="chnageName">Change my Name</button>
      <p>Name is {{ name }}</p>
        <hr>
        <div class="row">
            <div class="col-xs-12 col-sm-6">
                <app-user-detail :name="name" @nameWasChange="name = $event" :userAge="age"></app-user-detail>
            </div>
            <div class="col-xs-12 col-sm-6">
                <app-user-edit :userAge="age" @ageWasChange="chnaged"></app-user-edit>
            </div>
        </div>
    </div>
</template>

<script>
    import UserDetail from './UserDetail.vue';
    import UserEdit from './UserEdit.vue';

    export default {
      data: function (){
        return {
          name: 'mAX',
          age: 27
        };
      },
      methods: {
        chnageName(){
          this.name = "Ana";
        },
        chnaged(value){
          this.age = value;
        },
      },
        components: {
            appUserDetail: UserDetail,
            appUserEdit: UserEdit
        }
    }
</script>

<style scoped>
    div {
        background-color: lightblue;
    }
</style>

child code

<template>
    <div class="component">
        <h3>You may edit the User here</h3>
        <p>Edit me!</p>
      <p>Age: {{ userAge }}</p>
      <button @click="editAge">Edit age</button>
    </div>
</template>

<script>
export default {
  props: ['userAge'],
  methods: {
    editAge(event) {
      this.userAge = 20;
      this.$emit('ageWasChange', this.userAge);
    }
  }
}
</script>

<style scoped>
    div {
        background-color: lightgreen;
    }
</style>

secound child

<template>
    <div class="component">
        <h3>You may view the User Details here</h3>
        <p>Many Details</p>
      <p>User Name: {{ switchName() }}</p>
      <p>User age: {{ userAge }}</p>
      <button @click="resetName">Reset Name</button>
    </div>
</template>

<script>
export default {
  props: {
    name: {
      type: String,
      required: true,
      default: 'MAx'
    },
    userAge: Number
  },
  methods:{
    switchName(){
      return this.name.split("").reverse().join("");
    },
    resetName(){
      this.name = 'Max';
      this.$emit('nameWasChange', this.name);
    }
  },
}
</script>

<style scoped>
    div {
        background-color: lightcoral;
    }
</style>
Aug
22
1 month ago
Activity icon

Replied to Vue Js Formdata Append Not Working

FormData {}
__proto__: FormData
append: ƒ append()
delete: ƒ delete()
entries: ƒ entries()
forEach: ƒ forEach()
get: ƒ ()
getAll: ƒ getAll()
has: ƒ has()
keys: ƒ keys()
set: ƒ ()
values: ƒ values()
constructor: ƒ FormData()
Symbol(Symbol.iterator): ƒ entries()
Symbol(Symbol.toStringTag): "FormData"
__proto__: Object
Activity icon

Started a new Conversation Vue Js Formdata Append Not Working

I try to append data in Vue js but when i try to console log its show undefined any one know what is the issue

export default {
    data() {
        return{
            name: '',
            email: '',
            mobile: '',
            address: '',
            comapnyName: '',
            city: '',
            state: '',
            country: 'India',
            pincode: '',
        }
    },

    methods: {
        onFormSubmit() {
           
                    const formData = new FormData();
                    formData.append('name', this.name);
                    formData.append('email', this.email);
                    formData.append('mobile', this.mobile);
                    formData.append('address', this.address);
                    formData.append('comapnyName', this.comapnyName);
                    formData.append('city', this.city);
                    formData.append('state', this.state);
                    formData.append('country', this.country);
                    formData.append('pincode', this.pincode);
                    console.log(formData.data);
        }
    },
};
</script>
Aug
05
2 months ago
Activity icon

Started a new Conversation Restricting Page Access Before Submitting Other Page In Laravel

I have an application that requires 6 step to register. Those steps where separated as pages.

Now my question is, how can I prevent access to /step/2 if the user doesn't submit the form from /step/1 properly and same with /step/3 if the user doesn't submit /step/2 properly?

if user add url directly 6 it will redirect back to 1 or shown 403

Activity icon

Replied to Restricting Page Access Before Submitting Other Page In Laravel

Can you tell me how to write this in controller ?