tarang19

tarang19

Member Since 4 Months Ago

pune

Experience Points
12,880
Total
Experience

2,120 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
99
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 3
12,880 XP
Aug
05
4 days 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 ?

Activity icon

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

I have an application that requires 3 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?

I'm still new to laravel.

Aug
03
6 days ago
Activity icon

Started a new Conversation How To Use GATE In Controller

I wanted to check if user filled form then need to redirect every time on done page i have define GATE in AuthServiceProvider now i wanted to check in controller to redirect url

Any one know how to use GATEs in Controller ?

Activity icon

Started a new Conversation Photo Upload Not Working On Laravel 7

I want to upload image but its get entry in database but file not move to public folder any one have idea what is the issue

my code

<form method="POST" action="{{ route('preference.create.step.two.post') }}" enctype="multipart/form-data">
                            	@csrf
<div class="form-group">
    <div class="form-check">
      <p>Allowed file extensions - jpeg, jpg, jpe, bmp, png, gif<br/>
Maximum file size - 1MB</p>
      <input type="file" class="file-input" id="photo" name="photo">
      @if($current_user_data){
       {{ $current_user_data->photo }}
                                        }@endif
      @error('photo')
                                <p class="help text-danger">{{ $errors->first('photo') }}</p>
                                @enderror
    </div>
  </div>
</form>

controller

$active_user = User::find(Auth::user()->id);
        
        $validate = $request->validate([
            'firstname' => ['required'],
            'middlename' => ['required'],
            'lastname' => ['required'],
            'mothername' => ['required'],
            'gender' => ['required'],
            'birthday' => ['required'],
            'birthmonth' => ['required'],
            'birthyear' => ['required'],
            'mobile' => ['required'],
            'state' => ['required'],
            'pincode' => ['required'],
            'address' => ['required'],
            'aadhar' => ['nullable'],
            'pan' => ['nullable'],
            'religion' => ['required'],
            'cast' => ['required'],
            'tongue' => ['nullable'],
            'blood' => ['required'],
            'photo' => ['nullable'],
            'enrollment' => ['required'],
            'uid' => ['required'],
            'category' => ['required'],
        ]);

        if($request->hasFile('photo')){
            $photo = $request->file('photo');
            $new =  $photo->getClientOriginalName();
            $photo->move(public_path('images'), $new);

            $validate['photo'] = $new;
        };

        $validate['user_id'] = $active_user->id;
        $validate['is_saved'] = 1;

        Personal::updateOrCreate(['user_id' => $active_user->id], $validate);
Aug
02
1 week ago
Activity icon

Replied to FirstOrCreate Not Working Laravel 7

thank you for replay

Activity icon

Started a new Conversation FirstOrCreate Not Working Laravel 7

When i try to use firstorCreate its give me sql error

SQLSTATE[HY000]: General error: 1364 Field 'preference' doesn't have a default value (SQL: insert into `preferences` (`user_id`, `updated_at`, `created_at`) values (1, 2020-08-02 13:02:40, 2020-08-02 13:02:40))
public function poststepOne(Request $request)
    {
        $active_user = User::find(Auth::user()->id);
        //dd($active_user->id);
        $validate = $request->validate([
            'preference' => ['required'],
            'branch' => ['required'],
        ]);
        $validate['user_id'] = $active_user->id;
        $validate['is_saved'] = 1;
        //dd($validate);
        Preference::firstOrCreate(['user_id' => $active_user->id], [$validate]);
        //dd($test);
        //$test->update($validate);
        //return redirect()->route('products.create.step.two');
    }
Activity icon

Replied to Dynamic Tab Change On Form Submit In Vue.js

Thank you for replay i dont know how to do dynamic can you tell me or you have any link

I wanted to do wizard form

Activity icon

Started a new Conversation Update Record If Exists Or Create New Record Laravel 7

i wanted to do update record if exists or create new record laravel 7 using updateOrCreate but its create new entry please help

public function poststepOne(Request $request)
    {
        $active_user = User::find(Auth::user()->id);
        $validate = $request->validate([
            'preference' => ['required'],
            'branch' => ['required'],
        ]);

        $validate['user_id'] = $active_user->id;
        $validate['is_saved'] = 1;
        //dd($validate);
        Preference::updateOrCreate($validate);
        //return redirect()->route('products.create.step.two');
    }

Form

<form action="{{ route('preference.create.step.one.post') }}" method="POST">
                @csrf

                <div class="card">
                    <div class="card-header">Step 1: Preferences</div>

                    <div class="card-body">
                            <fieldset class="mailing">  
                               <!-- <legend class="mailing__title">Fill All * Details</legend> -->
                                <div class="form-check">
                                <label for="preference">Select Year <span class="imp ml-1">*</span></label>
                                <label for="preference">
                                    <input  id="preference" name="preference" value="Second Year" 
                                    @if($current_user_data){
                                    {{ $current_user_data->preference == 'Second Year' ? 'checked' : '' }}
                                }
                                @endif
                                     autocorrect="off" type="radio" />
                                     Second Year 
                                    
                                </label>
                                <label for="preference">
                                    <input  id="preference" name="preference" value="Third Year" 
                                    @if($current_user_data){
                                    {{ $current_user_data->preference == 'Third Year' ? 'checked' : '' }}
                                }
                                @endif
                                     autocorrect="off" type="radio" />
                                     Third Year 
                                    
                                </label>
                                @error('preference')
                                <p class="help text-danger">{{ $errors->first('preference') }}</p>
                                @enderror
                                </div>

                                <div class="form-group">
                                <label for="inputState">Branch</label>
                                <select id="branch" name="branch" class="form-control">
                                    <option selected disabled>Choose...</option>
                                    @foreach($allbranch as $branch)
                                    <option value="{{ $branch->branch }}" 
                                        @if($current_user_data){
                                        {{ $current_user_data->branch == $branch->branch ? 'selected' : '' }}
                                        }@endif
                                        >{{ $branch->branch }}
                                    
                                </option>
                                    @endforeach
                                </select>
                                @error('branch')
                                <p class="help text-danger">{{ $errors->first('branch') }}</p>
                                @enderror
                                </div>
                            </fieldset>
                            
                        
                    </div>

                    <div class="card-footer text-right">
                        <button type="submit" class="btn btn-primary btn btn-success mb-5 mt-2" name="submit">Next</button>
                    </div>
                </div>
            </form>
Activity icon

Started a new Conversation How To Insert And Fetch Record Same Time Using Vue

how to insert and fetch record same time using vue js.

Aug
01
1 week ago
Activity icon

Replied to Props Undefined On Child Component

Thank you for replay but still not work

<template>
    <div class="container-fluid" id="form">
        <div class="container">
            <div class="row">
                <div class="col-md-10">
                    <div class="row">
                        <div class="col-md-12">
                            <form method="POST" action="/form"  @submit.prevent="onSubmit" enctype="multipart/form-data">
                            <div class="form-header">
                                <h1 class="form-header__title">Instructions-Preferences</h1>
                                <p class="form-header__progress">Step 1 of 1</p>
                            </div>
                            <fieldset class="mailing">
                               <!-- <legend class="mailing__title">Fill All * Details</legend> -->
                                <div class="form-check">
                                <label for="preference">Select Year <span class="imp ml-1">*</span></label>
                                <label for="preference">
                                    <input  id="preference" name="preference" value="Second Year " autocorrect="off" type="radio"  v-model="preference"/>
                                     Second Year 
                                    <input  id="preference" name="preference" value="Third Year" autocorrect="off" type="radio"  v-model="preference"/>
                                    Third Year
                                    <p class="text-danger" role="alert" v-if="errors.preference">{{ errors.preference[0] }}</p>
                                </label>
                                </div>

                                <div class="form-group">
                                <label for="inputState">Branch</label>
                                <select id="branch" name="branch" class="form-control" v-model="selectedbranch">
                                    <option selected>Choose...</option>
                                    <option v-for="branch in branchs" :key="branch.branch">{{ branch.branch }}</option>
                                </select>
                                <p class="text-danger" role="alert" v-if="errors.branch">{{ errors.branch[0] }}</p>
                                </div>
                            </fieldset>
                                    <input class="btn btn-success mb-5 mt-2" name="submit" id="submit" type="submit" value="Save and continue" />
                        </form>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        
    </div>
</template>

<script>
export default {
    props:['bmw'],
    data(){
        return{
        preference: null,
        branchs: [],
        selectedbranch: null,
        errors:[],
        }
    },

    mounted(){
        this.allbranch();
    },

    methods:{
        allbranch(){
            let self = this;
            axios.get('branch')
            .then(function (response){
                self.branchs = response.data;
            })
            .catch(function (error){
                alert(error);
            })
        },
        onSubmit(){
            // const formData = new FormData();
            // formData.append('preference', this.preference );
            // formData.append('branch', this.selectedbranch);
            // console.log(formData);
            axios.post('/form',{preference: this.preference,branch: this.selectedbranch,timeout: 120000})
            .then(response => {
                if(response.status === 200){
                    console.log('done')
                }
            }).catch((error) => {
                this.errors = error.response.data.errors;
                //alert(error.response);
            })
        }
    }

}
</script>

<style scoped>

</style>
Activity icon

Started a new Conversation Props Undefined On Child Component

I wanted to send data from parent to child component but it showing UNDEFINED any one know

Parent code

<template>
<fieldset>
                        <preferences :preferences="pre"></preferences>
                        <div align="right">
                          <input type="button" name="next" class="next action-button mt-5 btn btn-primary" value="Next" />
                        </div>
                    </fieldset>
</template>

<script>

import preferences from '../Form/Preferences'
import personal from '../Form/personal.vue'
import gardian from '../Form/gardian.vue'
import acadmic from '../Form/acadmic.vue'
import fee from '../Form/fee.vue'
import declaration from '../Form/declaration.vue'
export default {
  data(){
    return{
      isActive: true,
      isShow: true,
      preferences: [],
      personal: [],
      academic: [],
      declaration: [],
      fee: [],
      gardian: [],
    }
  },
    components: {
        preferences,
        personal,
        gardian,
        acadmic,
        fee,
        declaration
    },

    mounted(){
      let self = this;
      self.check_form_status();
    },

    methods: {
      //Check_form_status Check all status And filled form 

      check_form_status(){
        let self = this;
        axios.all([
          axios('/form'), //preferences
          axios('/personal'),
          axios('/academic'),
          axios('/declaration'),
          axios('/fee'),
          axios('/gardian')
          ])
          .then(axios.spread(( form, personal, academic, declaration, fee, gardian ) => {
            self.preferences = form.data,
            self.personal = personal.data,
            self.academic = academic.data,
            self.declaration = declaration.data,
            self.fee = fee.data,
            self.gardian = gardian.data

            
          }))
      }
    },
}
</script>

my child script

<script>
export default {
    props: ['pre'],
    data(){
        return{
        preference: null,
        branchs: [],
        selectedbranch: null,
        errors:[],
        }
    },

    created(){
        console.log(this.pre)
    },

    mounted(){
        this.allbranch();
    },

    methods:{
        allbranch(){
            let self = this;
            axios.get('branch')
            .then(function (response){
                self.branchs = response.data;
            })
            .catch(function (error){
                alert(error);
            })
        },
        onSubmit(){
            // const formData = new FormData();
            // formData.append('preference', this.preference );
            // formData.append('branch', this.selectedbranch);
            // console.log(formData);
            axios.post('/form',{preference: this.preference,branch: this.selectedbranch,timeout: 120000})
            .then(response => {
                if(response.status === 200){
                    console.log('done')
                }
            }).catch((error) => {
                this.errors = error.response.data.errors;
                //alert(error.response);
            })
        }
    }

}
</script>
Activity icon

Started a new Conversation Dynamic Tab Change On Form Submit In Vue.js

Hello Friend i wanted to create bootstrap 4 pills dynamic active and show when user fill form like (From - steps)

Can anyone tell me hear is my present code in vue

<template>
    <div class="container-fluid" id="dashboard">
    <div class="container">
        <div class="row card shadow-lg p-3 mb-5 bg-white rounded">
            <div class="col-md-12 card-body">
                <ul class="nav nav-pills nav-fill">
          <li class="nav-item">
            <a :class="[{ active: isActive }, 'nav-link']" data-toggle="pill" href="#Preferences" role="tab" aria-controls="pills-Preferences" aria-selected="true">Preferences</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="pill" href="#Personal" role="tab" aria-controls="pills-Personal" aria-selected="false">Personal</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="pill" href="#Gardian" role="tab" aria-controls="pills-Gardian" aria-selected="false">Gardian</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="pill" href="#Acadmic" role="tab" aria-controls="pills-Acadmic" aria-selected="false">Acadmic</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="pill" href="#fee" role="tab" aria-controls="pills-fee" aria-selected="false">Fee</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="pill" href="#declaration" role="tab" aria-controls="pills-declaration" aria-selected="false">Declaration</a>
          </li>
        </ul>
        <div class="tab-content mt-3">
        <div :class="[{ active: isActive, show: isShow }, 'tab-pane fade mt-5']" id="Preferences" role="tabpanel" aria-labelledby="Preferences-tab">
          <preferences></preferences>
        </div>
        <div class="tab-pane fade mt-5" id="Personal" role="tabpanel" aria-labelledby="Personal-tab">
          <personal></personal>
        </div>
        <div class="tab-pane fade mt-5" id="Gardian" role="tabpanel" aria-labelledby="Gardian-tab">
          <gardian></gardian>
        </div>
        <div class="tab-pane fade mt-5" id="Acadmic" role="tabpanel" aria-labelledby="Acadmic-tab">
          <acadmic></acadmic>
        </div>
        <div class="tab-pane fade mt-5" id="fee" role="tabpanel" aria-labelledby="fee-tab">
          <fee></fee>
        </div>
        <div class="tab-pane fade mt-5" id="declaration" role="tabpanel" aria-labelledby="declaration-tab">
          <declaration></declaration>
        </div>
      </div>
            </div>
        </div>
    </div>
</div>
</template>

<script>
import preferences from '../Form/Preferences'
import personal from '../Form/personal.vue'
import gardian from '../Form/gardian.vue'
import acadmic from '../Form/acadmic.vue'
import fee from '../Form/fee.vue'
import declaration from '../Form/declaration.vue'
export default {
  data(){
    return{
      isActive: true,
      isShow: true,
      preferences: [],
      personal: [],
      academic: [],
      declaration: [],
      fee: [],
      gardian: [],
    }
  },
    components: {
        preferences,
        personal,
        gardian,
        acadmic,
        fee,
        declaration
    },

    mounted(){
      let self = this;
      self.check_form_status();
    },

    methods: {
      //Check_form_status Check all status And filled form 

      check_form_status(){
        let self = this;
        axios.all([
          axios('/form'), //preferences
          axios('/personal'),
          axios('/academic'),
          axios('/declaration'),
          axios('/fee'),
          axios('/gardian')
          ])
          .then(axios.spread(( form, personal, academic, declaration, fee, gardian ) => {
            self.preferences = form.data,
            self.personal = personal.data,
            self.academic = academic.data,
            self.declaration = declaration.data,
            self.fee = fee.data,
            self.gardian = gardian.data

            if(self.preferences.is_saved){
              this.isActive =  false;
              this.isShow = false;
            }
          }))
      }
    },
}
</script>

<style scoped>

</style>
Jul
31
1 week ago
Activity icon

Replied to Laravel 7 Give Me 500 Error

Get same error

Activity icon

Replied to Laravel 7 Give Me 500 Error

Thank you but still not work

Activity icon

Started a new Conversation Laravel 7 Give Me 500 Error

When i try to pass my value to controller its give me 500 error Wanted to give validation error but not working

When i try $request->all(); it will get all value

Please help

exception: "Illuminate\Database\QueryException"
file: "D:\svcp\vendor\laravel\framework\src\Illuminate\Database\Connection.php"
line: 671
message: "SQLSTATE[HY000]: General error: 1364 Field 'mothername' doesn't have a default value (SQL: insert into `personals` (`firstname`, `middlename`, `lastname`, `user_id`, `is_saved`, `updated_at`, `created_at`) values (null, null, null, 1, 1, 2020-07-31 07:05:16, 2020-07-31 07:05:16))"
trace: [{file: "D:\svcp\vendor\laravel\framework\src\Illuminate\Database\Connection.php", line: 631,…},…]

Web.php

Route::resource('/personal','PersonalController');

my controller

$active_user = 1;
        
        $validate = $request->validate([
            'firstname' => ['required'],
            'middlename' => ['required'],
            'lastname' => ['required'],
            'mothername' => ['required'],
            'gender' => ['required'],
            'birthday' => ['required'],
            'birthmonth' => ['required'],
            'birthyear' => ['required'],
            'mobile' => ['required'],
            'state' => ['required'],
            'pincode' => ['required'],
            'address' => ['required'],
            'aadhar' => ['nullable'],
            'pan' => ['nullable'],
            'religion' => ['required'],
            'cast' => ['required'],
            'tongue' => ['nullable'],
            'blood' => ['required'],
            'photo' => ['nullable'],
            'enrollment' => ['required'],
            'uid' => ['required'],
            'category' => ['required'],
        ]);

        if($request->hasFile('photo')){
            $validate = $request->validate([
                'photo' => ['required','image','mimes:jpg,jpeg','max:1000'],
            ]);
            $photo = $request->file('photo');
            $new =  $photo->getClientOriginalName();
            $photo->move(public_path('images'), $new);
        };

        $validate['user_id'] = $active_user;
        $validate['is_saved'] = 1;

        Personal::create($validate);

my Vue file

<template>
    <div class="container-fluid" id="form">
        <div class="container">
            <div class="row">
                <div class="col-md-3">

                </div>

                <div class="col-md-9">
                    <div class="row">
                        <div class="col-md-12">
                            <form method="POST" action="/personal"  @submit.prevent="onSubmit" enctype="multipart/form-data">
                            <div class="form-header">
                                <h1 class="form-header__title">Instructions-Preferences</h1>
                                <p class="form-header__progress">Step 2 of 1</p>
                            </div>
                            <fieldset class="mailing">
                               <!-- <legend class="mailing__title">Fill All * Details</legend> -->
                                <div class="form-row">
    <div class="form-group col-md-3">
      <label for="firstname">First Name</label>
      <input type="text" class="form-control" id="firstname" name="firstname" v-model="firstname">
      <p class="text-danger" role="alert" v-if="errors.firstname">{{ errors.firstname[0] }}</p>
    </div>
    <div class="form-group col-md-3">
      <label for="middlename">Middle Name</label>
      <input type="text" class="form-control" id="middlename" name="middlename" v-model="middlename">
      <p class="text-danger" role="alert" v-if="errors.middlename">{{ errors.middlename[0] }}</p>
    </div>
    <div class="form-group col-md-3">
      <label for="lastname">Last Name</label>
      <input type="text" class="form-control" id="lastname" name="lastname" v-model="lastname">
      <p class="text-danger" role="alert" v-if="errors.lastname">{{ errors.lastname[0] }}</p>
    </div>
    <div class="form-group col-md-3">
      <label for="mothername">Mother Name</label>
      <input type="text" class="form-control" id="mothername" name="mothername" v-model="mothername">
      <p class="text-danger" role="alert" v-if="errors.mothername">{{ errors.mothername[0] }}</p>
    </div>
  </div>

  <div class="form-row">
    <div class="form-group col-md-3">
      <label for="gender">Gender</label>
      <select id="gender" name="gender" class="form-control" v-model="gender">
        <option selected>Choose...</option>
        <option value="Male">Male</option>
        <option value="Female">Female</option>
        <option value="Transgender">Transgender</option>
      </select>
      <p class="text-danger" role="alert" v-if="errors.gender">{{ errors.gender[0] }}</p>
    </div>
    <div class="form-group col-md-3">
      <label for="birthday">Birth Day</label>
      <select id="birthday" name="birthday" class="form-control" v-model="birthday">
        <option selected>Choose...</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        <option value="9">9</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
        <option value="20">20</option>
        <option value="21">21</option>
        <option value="22">22</option>
        <option value="23">23</option>
        <option value="24">24</option>
        <option value="25">25</option>
        <option value="26">26</option>
        <option value="27">27</option>
        <option value="28">28</option>
        <option value="29">29</option>
        <option value="30">30</option>
        <option value="31">31</option>
      </select>
      <p class="text-danger" role="alert" v-if="errors.birthday">{{ errors.birthday[0] }}</p>
    </div>
    <div class="form-group col-md-3">
      <label for="birthmonth">Birth Month</label>
      <select id="birthmonth" name="birthmonth" class="form-control" v-model="birthmonth">
        <option selected>Choose...</option>
        <option value="1">January</option>
        <option value="2">February</option>
        <option value="3">March</option>
        <option value="4">April</option>
        <option value="5">May</option>
        <option value="6">June</option>
        <option value="7">July</option>
        <option value="8">August</option>
        <option value="9">September</option>
        <option value="10">October</option>
        <option value="11">November</option>
        <option value="12">December</option>
      </select>
      <p class="text-danger" role="alert" v-if="errors.birthmonth">{{ errors.birthmonth[0] }}</p>
    </div>
    <div class="form-group col-md-3">
      <label for="birthyear">Birth Year</label>
      <select id="birthyear" name="birthyear" class="form-control" v-model="birthyear">
        <option selected>Choose...</option>
        <option v-for="year in years" :value="year">{{ year }}</option>
      </select>
      <p class="text-danger" role="alert" v-if="errors.birthyear">{{ errors.birthyear[0] }}</p>
    </div>
  </div>

  <div class="form-row">
    <div class="form-group col-md-4">
      <label for="mobile">Mobile number</label>
      <input type="text" class="form-control" id="mobile" name="mobile" v-model="mobile">
      <p class="text-danger" role="alert" v-if="errors.mobile">{{ errors.mobile[0] }}</p>
    </div>
    <div class="form-group col-md-4">
      <label for="state">State</label>
      <select id="state" name="state" class="form-control" v-model="state_name">
        <option selected>Choose...</option>
        <option v-for="states in allstates" :value="states.state_list">{{ states.state_list }}</option>
      </select>
      <p class="text-danger" role="alert" v-if="errors.state">{{ errors.state[0] }}</p>
    </div>
    <div class="form-group col-md-4">
      <label for="pincode">Pincode</label>
      <input type="text" class="form-control" id="pincode" name="pincode" v-model="pincode">
      <p class="text-danger" role="alert" v-if="errors.pincode">{{ errors.pincode[0] }}</p>
    </div>
  </div>

  <div class="form-group">
    <label for="address">Local Address</label>
    <input type="text" class="form-control" id="address" name="address" v-model="address">
    <p class="text-danger" role="alert" v-if="errors.address">{{ errors.address[0] }}</p>
  </div>
  
  <div class="form-row">
    <div class="form-group col-md-6">
      <label for="aadhar">Aadhar Number</label>
      <input type="text" class="form-control" id="aadhar" name="aadhar" v-model="aadhar">
    </div>
    <div class="form-group col-md-6">
      <label for="pan">Pan Number</label>
      <input type="text" class="form-control" id="pan" name="pan" v-model="pan">
    </div>
  </div>

  <div class="form-row">
    <div class="form-group col-md-6">
      <label for="religion">Religion</label>
      <input type="text" class="form-control" id="religion" name="religion" v-model="religion">
      <p class="text-danger" role="alert" v-if="errors.religion">{{ errors.religion[0] }}</p>
    </div>
    <div class="form-group col-md-6">
      <label for="cast">Cast Category</label>
      <select id="cast" name="cast" class="form-control" v-model="cast">
        <option selected>Choose...</option>
        <option value="Open">Open</option> 
              <option value="SC">SC</option>
              <option value="ST">ST</option>
              <option value="VJ">VJ</option>          
              <option value="DT">DT</option>
              <option value="NT-A">NT-A</option>         
              <option value="NT-B">NT-B</option>           
              <option value="NT-C">NT-C</option>
              <option value="OBC">OBC</option>
              <option value="SBC">SBC</option>  
              <option value="SEBC">SEBC</option>
              <option value="EWS">EWS</option>           
              <option value="Other">Other</option>
      </select>
      <p class="text-danger" role="alert" v-if="errors.cast">{{ errors.cast[0] }}</p>
    </div>
  </div>

  <div class="form-row">
    <div class="form-group col-md-6">
      <label for="tongue">Mother Tongue</label>
      <input type="text" class="form-control" id="tongue" name="tongue" v-model="tongue">
    </div>
    <div class="form-group col-md-6">
      <label for="blood">Blood Group</label>
      <select id="blood" name="blood" class="form-control" v-model="blood">
        <option selected>Choose...</option>
        <option value="A+">A +</option>   
              <option value="B+">B +</option>
              <option value="AB+">AB +</option>      
              <option value="o+">O +</option>
              <option value="A-">A -</option>
              <option value="B-">B -</option>
              <option value="AB-">AB -</option>
              <option value="o-">O -</option>
              <option value="Unknown">Unknown</option>
      </select>
      <p class="text-danger" role="alert" v-if="errors.blood">{{ errors.blood[0] }}</p>
    </div>
  </div>

  <div class="form-group">
    <div class="form-check">
      <p>Allowed file extensions - jpeg, jpg, jpe, bmp, png, gif<br/>
Maximum file size - 1MB</p>
      <input type="file" class="file-input" id="photo" name="photo">
      <p class="text-danger" role="alert" v-if="errors.photo">{{ errors.photo[0] }}</p>
    </div>
  </div>

  <div class="form-row">
    <div class="form-group col-md-4">
      <label for="enrollment">Enrollment No.</label>
      <input type="text" class="form-control" id="enrollment" name="enrollment" v-model="enrollment">
      <p class="text-danger" role="alert" v-if="errors.enrollment">{{ errors.enrollment[0] }}</p>
    </div>
    <div class="form-group col-md-4">
      <label for="uid">Student UID</label>
      <input type="text" class="form-control" id="uid" name="uid" v-model="uid">
      <p class="text-danger" role="alert" v-if="errors.uid">{{ errors.uid[0] }}</p>
    </div>
    <div class="form-group col-md-4">
      <label for="category">Category of admission</label>
      <select id="category" name="category" class="form-control" v-model="category">
        <option selected>Choose...</option>
        <option value="TFWS">TFWS</option>
        <option value="EBC">EBC</option>
      </select>
      <p class="text-danger" role="alert" v-if="errors.category">{{ errors.category[0] }}</p>
    </div>
  </div>
                            </fieldset>
                                    <input class="btn btn-success mb-5 mt-2" name="submit" id="submit" type="submit" value="Save and continue" />
                        </form>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        
    </div>
</template>

<script>
export default {
    data(){
      return{
        firstname: null,
        middlename: null,
        lastname: null,
        mothername: null,
        gender: null,
        birthday: null,
        birthmonth: null,
        birthyear: null,
        mobile: null,
        state: null,
        pincode: null,
        state_name: null,
        address: null,
        aadhar: null,
        pan: null,
        religion: null,
        cast: null,
        tongue: null,
        blood: null,
        photo: null,
        enrollment: null,
        uid: null,
        category: null,
        allstates:[],
        errors:[],
      }
    },

    mounted(){
        this.all_states();
    },

    computed : {
      years () {
      const year = new Date().getFullYear()
      return Array.from({length: year - 1900}, (value, index) => 1901 + index)
    }
    },

    methods:{
      all_states(){
        let self = this;
            axios.get('state')
            .then(function (response){
                self.allstates = response.data;
            })
            .catch(function (error){
                alert(error);
            })
      },

      onSubmit(){
        const config = {
                            headers: {
                              'content-type': 'multipart/form-data'
                            }
                          };
            const fileInput = document.querySelector( '#photo' );
            const formData = new FormData();
            formData.append('firstname', this.firstname);
            formData.append('middlename', this.middlename);
            formData.append('lastname', this.lastname);
            formData.append('mothername', this.mothername);
            formData.append('gender', this.gender);
            formData.append('birthday', this.birthday);
            formData.append('birthmonth', this.birthmonth);
            formData.append('birthyear', this.birthyear);
            formData.append('mobile', this.mobile);
            formData.append('state', this.state_name);
            formData.append('pincode', this.pincode);
            formData.append('address', this.address);
            formData.append('aadhar', this.aadhar);
            formData.append('pan', this.pan);
            formData.append('religion', this.religion);
            formData.append('cast', this.cast);
            formData.append('tongue', this.tongue);
            formData.append('blood', this.blood);
            formData.append('photo', fileInput.files[0]);
            formData.append('enrollment', this.enrollment);
            formData.append('uid', this.uid);
            formData.append('category', this.category);
            //console.log(formData)
            axios.post( '/personal', formData,config, {timeout: 120000 })
                        .then( response => {

                            if (response.status === 200 ){
                                alert('done');
                                }
                                
                        }).catch((error) => {
                          console.log(error.response.data.errors)
                          this.errors = error.response.data.errors;
                        })
        }
    }
}
</script>

<style scoped>

</style>
Jun
29
1 month ago
Activity icon

Replied to WebRTC In Laravel 7

Any one Know?

Activity icon

Replied to Bigbluebutton How To Use

Any One know ?

Jun
24
1 month ago
Activity icon

Started a new Conversation WebRTC In Laravel 7

Any one know how to use WebRTC for video call in laravel any links or git repository ?

https://webrtc.github.io/

Thank you

Jun
23
1 month ago
Activity icon

Replied to Laravel With Video Conferences

Thank for replay can you give any tutorial or code for guideline?

Activity icon

Started a new Conversation Laravel With Video Conferences

Any one know how to create Laravel with video conferences

Min. participants = n person, and we can share some attachment in real time and chat , Polls

Anyone idea how to do and any npm package that i can use or any open source project

Please let me know

Thanks in Advance

Jun
21
1 month ago
Activity icon

Started a new Conversation Where I Can Learn Laravel Broadcast From Scratch To Advance

Hello All, Any one know where i can start learning laravel broadcast mostly required video tutorial any one have links please share

Thank you

Jun
18
1 month ago
Activity icon

Started a new Conversation Bigbluebutton How To Use

How to use bigbluebutton in laravel anyone know please help

Link:https://docs.bigbluebutton.org/

Jun
04
2 months ago
Activity icon

Started a new Conversation Axios Always Returns A Null Data And Status

I am using axios in nativescript + laravel when i try to use axios to get data its return null my axios code

axios({ method: "GET", "url": "http://api.sinhgadcollegeofscience.com/api/todos" }).then(result => {
                console.log(result.data)
                commit('setTodos', result.data)
            }, error => {     	
                console.log('errorsssss')
            });

error: LOG from device Tarang shah: null

Jun
02
2 months ago
Activity icon

Started a new Conversation Laravel With Nativescript

I'm new to nativescript-vue, I'm working on my own nativescript-vue app, I created a laravel project which is basically the API of my native app, my app has to "call" my laravel API endpoints, this is in my local dev machine and I'm currently not using emulators but a connected device, how can I hit my laravel app routes with my app? I usually use axios in my vue projects so I downloaded it in nativescript-vue.

Do I just have to make a Get request to "http://127.0.0.1:8000/api/posts"with axios

Jun
01
2 months ago
Activity icon

Replied to Cannot Read Property 'getters' Of Undefined

thanks issue solve

Activity icon

Replied to Cannot Read Property 'getters' Of Undefined

Giving me following output on vue devtool (vuex getters and state) witch is correct

{"todos":{"todos":[{"id":1,"title":"Todo One"},{"id":2,"title":"Todo two"}]}}

Activity icon

Replied to Cannot Read Property 'getters' Of Undefined

thanks for replay but error remain same

Activity icon

Replied to Cannot Read Property 'getters' Of Undefined

in index.js (store)

import Vuex from 'vuex';
import Vue from 'vue';
import todos from './modules/todos';

Vue.use(Vuex);

export default new Vuex.Store({

	modules: {
		todos
	}

});
Activity icon

Started a new Conversation Cannot Read Property 'getters' Of Undefined

'getters' of undefined my code

todo.vue

<template>
<div>
<h3>Todos</h3>
<div class="todos">
	<div v-for="todo in allTodos" :key="todo.key" class="todo">
		{{ todo.title }}
	</div>
</div>
</div>
</template>

<script>
	import { mapGetters } from 'vuex'; 
export default {
    name: 'Todos',
    computed: mapGetters(["allTodos"]),
    
  };
</script>

<style>
	.todos {
  border: 1px solid #ccc;
  background: #41b883;
  padding: 1rem;
  border-radius: 5px;
  text-align: center;
  position: relative;
  cursor: pointer;
}
</style>

vuex js

//import axios from 'axios';

const state = {
	todos: [
		{
			id:1,
			title: 'Todo One'
		},
		{
			id:2,
			title: 'Todo two'
		},
	]
};

const getters = {
	allTodos:(state) => state.todos
};

const actions = {};

const mutations = {};

export default {
	state,
	getters,
	actions,
	mutations
};

main.js

import Vue from 'vue';
import App from '~/App.vue';
import Store from '~/store';
import 'bootstrap';

var $ = require("jquery");
window.jQuery = $;

Vue.config.productionTip = false;

new Vue({
	Store,
  render: (h) => h(App),
}).$mount('#app');
May
26
2 months ago
Activity icon

Replied to Laravel 7 Passort Guzzlehttp

any one have ans .....?

May
25
2 months ago
Activity icon

Started a new Conversation Laravel 7 Passort Guzzlehttp

I want to try to get client token using guzzlehttp with postman guzzlehttp hangs and not work

I am using window and xampp server not able to find out what is the issue and how to solve

my api routes

<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::post('/login','[email protected]')->name('login');

Route::get('/todos','[email protected]');
Route::post('/todos','[email protected]');
Route::patch('/todos/{todo}','[email protected]');
Route::patch('/todoscheckall','[email protected]');
Route::delete('/todos/{todo}','[email protected]');
Route::delete('/todosdeletecomplited','[email protected]');

my controller

<?php

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use GuzzleHttp\Client;

class AuthController extends Controller
{     
    //$http = new GuzzleHttp\Client;
     public function login(Request $request)
     {
     	  $response = (new \GuzzleHttp\Client)->post('http://127.0.0.1:8000/oauth/token', [ 
        'form_params' => [
        'grant_type' => 'password',
        'client_id' => 2,
        'client_secret' => 'zXfWLi7qkEvE5UsOOoeFXhT8bAXUW1tRhZ4wlGrk',
        'username' => $request->username,
        'password' => $request->password,
        'scope' => '*',
    ],
]);
    //die;
    return json_decode((string) $response->getBody(), true);
     }
}
May
12
2 months ago
Activity icon

Started a new Conversation Laravel Passport Any Video Tutorial

Any one know Any Video tutorial link for passport or in laracasts

Activity icon

Started a new Conversation Vue Nativescript + Laravel

Any one have any tutorial links or guideline for vue nativescript + laravel ?

May
11
2 months ago
Activity icon

Replied to Axios Request Failed With Status Code Null In Native Js

do you have any link or working demo so i can see or any tutorial ?

Activity icon

Replied to Axios Request Failed With Status Code Null In Native Js

is necessary get records from passport Api or we can get directly from laravel project

Activity icon

Replied to Axios Request Failed With Status Code Null In Native Js

its from json call not from axios

Activity icon

Replied to Axios Request Failed With Status Code Null In Native Js

http://127.0.0.1:8000/user/all

[{"id":1,"name":"Sinhgad Data Center","email":"[email protected]","avatar":"https:\/\/lh5.googleusercontent.com\/-J4UWflUadho\/AAAAAAAAAAI\/AAAAAAAAAAA\/AAKWJJN3ewKGIOmS1bVJc3SZLWhSyNvCMA\/photo.jpg"},{"id":2,"name":"tarang shah","email":"[email protected]","avatar":"https:\/\/lh3.googleusercontent.com\/a-\/AOh14GjJZ-HrxLjwjoFBZIGQuVMZrQ7LqUOV8s-nryHGTw"},
{"id":3,"name":"Tarang Shah","email":"[email protected]","avatar":"https:\/\/lh5.googleusercontent.com\/-6GkwxPfSZio\/AAAAAAAAAAI\/AAAAAAAAAAA\/AAKWJJPP4mW_7W_8iq2BUxC522TR_q3Lxg\/photo.jpg"},
{"id":4,"name":"sdc bakup","email":"[email protected]","avatar":"https:\/\/lh4.googleusercontent.com\/-9GQFjHgIFms\/AAAAAAAAAAI\/AAAAAAAAAAA\/AAKWJJMd-EgXicetxpV4Gv-v6fa6-OFWBA\/photo.jpg"},
{"id":5,"name":"tarang shah","email":"[email protected]","avatar":"https:\/\/lh3.googleusercontent.com\/-rUE5FqWm4z4\/AAAAAAAAAAI\/AAAAAAAAAAA\/AAKWJJMSydKxCwKIYXszos9v1tiPA5w7Uw\/photo.jpg"}]
Activity icon

Replied to Axios Request Failed With Status Code Null In Native Js

not use routes

my code


<template>
    <Page>
        <ActionBar title="Welcome to NativeScript-Vue!"/>
        <ListView for="item in listOfItems" @itemTap="onItemTap">
          <v-template>
            <!-- Shows the list item label in the default color and style. -->
            <Label>{{ item.title }}</Label>
          </v-template>
        </ListView>
    </Page>
</template>

<script >
    import axios from 'axios';
  export default {
    data() {
      return {
        msg: 'Hello World',
        listOfItems:null,
      }
    },

    mounted(){
        this.onItemTap()
    },
    methods:{
        onItemTap(){
            let self = this;

            axios
    .get('http://localhost:8000/user/all', {
      timeout: 5000
    })
    .then(res => {  
        self.listOfItems = res.data
        console.log(self.listOfItems)
    })
    .catch(err => console.error(err));
        }
    },
  }
</script>

<style scoped>
    ActionBar {
        background-color: #53ba82;
        color: #ffffff;
    }

    .message {
        vertical-align: center;
        text-align: center;
        font-size: 20;
        color: #333333;
    }
</style>
Activity icon

Started a new Conversation Axios Request Failed With Status Code Null In Native Js

I am try to do communicate my vue nativescript application with Laravel(backend) using axios but when i try it will give me an error (Request failed with status code null)

my Axios query in nativescript App

 onItemTap(){
            let self = this;

            axios
    .get('https://localhost:8000/user/all', {
      timeout: 5000
    })
    .then(res => {  
        self.listOfItems = res.data
        console.log(self.listOfItems)
    })
    .catch(err => console.error(err));
        }
    },

and my laravel controller

public function index(Request $request)
    {
        $active_user = User::all();

        return $active_user;
    } 

All projects are runing on different ip network please help to solve my issue

May
09
3 months ago
Activity icon

Replied to Wanted To Start Lerning Nativejs Using Backend Laravel

Which one to use Nativescript or Nativescript-Vue

And how to design mobile vue Can we use bostrap?

Activity icon

Replied to How To Link All 5 Tables With User Table. Using Polymorphic Table Or Any Other Idea

as i understand you need to store table id in parent table and add relationship using laravel relationship

for example use this url for guide may be help you

Links: https://www.codechief.org/article/polymorphic-relationship-in-laravel https://blog.logrocket.com/polymorphic-relationships-in-laravel/ https://appdividend.com/2018/05/18/laravel-polymorphic-relationship-tutorial-example/

           https://stackoverflow.com/questions/55784729/belongstomany-with-4-tables-in-laravel
Activity icon

Started a new Conversation Wanted To Start Lerning Nativejs Using Backend Laravel

! i wanted to start learn native.js with Vue + axios + laravel any one know any tutorial for this

! And difference between nativescript or vue-native which one is good for development ?

Links: https://www.nativescript.org/ https://vue-native.io/

May
08
3 months ago
Activity icon

Replied to Select From OctoberCMS, AsgardCMS Or Lavalite?

OctoberCMS is stable and more effective to use and can modify if you read the proper documentation and its depends up to what to achieve with this plugin if you want proper cms functionality i will suggest go for drupal.org

May
05
3 months ago
Activity icon

Replied to Export Csv In Laravel With Multiple Array In Single

use laravel collection

for e.g.

$total = [];

            $collection = collect($total_submited_form);
            
            $collection->each(function ($item, $key) use(&$total) {
        		
    		$a['sr_no'] = $item->id;
    		$a['user_id'] = $item->user->student->fullname;
    		$a['email_id'] = $item->user->email;
    		$a['contact_number'] = $item->user->student->contact;
    		$a['Grade_Name'] = $item->grade;
    		$a['Transaction_Details'] = $item->transaction_detail;
    		$a['Transaction_Number'] = $item->transaction_number;
    		array_push($total, $a);

    	});


        return collect($total);