vipin93

Self Coder at home

Experience

58,360

58 Best Reply Awards

  • Member Since 2 Years Ago
  • 13 Lessons Completed
  • 0 Favorites

1st November, 2017

vipin93 started a new conversation What I S The Best Table Strucure For Quiz Based App ? • 3 weeks ago

i made for like , questions, questions_options, users, answerKEY now here is problem what i facing some issue some times a question have more questions somthing like group question

I tried to make somthing like this

here is questions table structure

vipin93 left a reply on How To Select Max Array Object From Collection? • 3 weeks ago

ping

31st October, 2017

vipin93 started a new conversation How To Select Max Array Object From Collection? • 3 weeks ago

something I trying to make QUIZE system now problem is that i have answers table and its contains a section_id now I want select max correct answer group by user_id but also section_id now i have colection

[
{
"user_id": "24",
"section_id": "1",
"total": "5"
},
{
"user_id": "24",
"section_id": "2",
"total": "2"
},
{
"user_id": "24",
"section_id": "3",
"total": "2"
},
{
"user_id": "25",
"section_id": "2",
"total": "1"
},
{
"user_id": "25",
"section_id": "3",
"total": "1"
}
]

and my query here is

 $newmaxmarks = DB::table('question_answers')
                           ->whereRaw('answer_id = answerByUser')
                           ->select('user_id','section_id', DB::raw('count(*) as total'))
                           ->groupBy('user_id') 
                           ->groupBy('section_id')                
                           ->get(); 

now here i want something like

[
{
"user_id": "24",
"section_id": "1",
"total": "5"
},
{
"user_id": "24",
"section_id": "2",
"total": "2"
},
{
"user_id": "24",
"section_id": "3",
"total": "2"
}
]

27th October, 2017

vipin93 left a reply on Saving Form With Multiple Fieald Radio Button? • 4 weeks ago

I solved by this


                    <form action="/save/answere" method="post">

                    {{ csrf_field() }}  

                       @foreach($questions as $question)

                        <input type="hidden" class="form-control" name="question[]" value="{{$question->id}}">
                        <h4>Question no: {{ $question->id }}</h4>
                        <h5>{{ $question->title }}</h5>
                        <span>{{ $question->description }}</span>                                
                        
                        @if($question->questiontype == "text")

                        <input id="answer" type="text" class="form-control" name="answer[{{$question->id}}]">
                        @else


                        @foreach($question->question_options as  $key => $question_option)

                           <label>
                                <input id="optradio" type="radio" name="optradio[{{$question->id}}]" 
                                    value="{{$question_option->id}}">
                                    {{$question_option->option_value}}
                                </input>
                           </label>

                        @endforeach

                        @endif
                        
                        @endforeach

                        <button type="submit">Submit<button>

                    </form>

vipin93 left a reply on Saving Form With Multiple Fieald Radio Button? • 4 weeks ago

@mushood no I have form here is live view see http://fcf7ae80.ngrok.io/save/answere

and my saving method

$auth = \App\User::where('id',25)->first();

        foreach($r->question as $key => $value) {


            $data = [
                'question_id' => $value,
                'option_id'   => $r->optradio[$key],
                'answer'      => $r->answer[$key]
            ];

            $auth->questionansweres()->create($data);

        }

        return back();

vipin93 started a new conversation Saving Form With Multiple Fieald Radio Button? • 4 weeks ago

I tried to save multiple fieald with included radio button, but problem is that I given radio name sotmhing like


<label>
          <input id="optradio[]" type="radio" name="optradio[]" value="{{$question_option->id}}">
       {{$question_option->option_value}}
    </input>
 </label>

so its treated as single group only one selected

here is my full form


 <form action="/save/answere" method="post">

                    {{ csrf_field() }}  

                       @foreach($questions as $question)

                        <input type="hidden" class="form-control" name="question[]" value="{{$question->id}}">
                        <h4>Question no: {{ $question->id }}</h4>                              
                        
                        @if($question->questiontype == "text")
                        <input id="answer" type="text" class="form-control" name="answer[]">
                        @else
                        <input id="answer" type="hidden" class="form-control" name="answer[]">
                        @endif 

                        @if($question->questiontype == "radio")
                        @foreach($question->question_options as $question_option)

                           <label>
                           <input id="optradio[]" type="radio" name="optradio[]" 
                             value="{{$question_option->id}}">
                             {{$question_option->option_value}}
                             </input>
                           </label>

                        @endforeach
                        @endif
                        @endforeach

                        <button type="submit">Submit<button>

                    </form>

15th October, 2017

vipin93 left a reply on Vuex Not Dispatching Store • 1 month ago

i just removed

mounted () {
       this.$store.dispatch('setUserObject', null)
    },

and everything is fine

vipin93 left a reply on How Can Pass Props With Vue-router? • 1 month ago

never mind yes I used props but I switch to vuex which much easier and its fast because I'm not calling another request

14th October, 2017

vipin93 left a reply on Vuex Not Dispatching Store • 1 month ago

I tried to log

storeuser (value) {
      var some = this.$store.dispatch('setUserObject', value)
      console.log(some);
    }

I got error

Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}

vipin93 started a new conversation Vuex Not Dispatching Store • 1 month ago

I tried to use Vuex to store user data but its seems like its not working in my one fo child component in other its working here is my method

export default {
  props: ['email','id'],
  data () {
    return {
      password: '',
      email1: this.email,
      confirm_password: '',
      errors: new Errors(),
      error: false,
      disablebutton: false,
      message: ''
    }
  },

  computed: {
      ...mapState({
        userStore: state => state.userStore
      })
    },

   mounted () {
       this.$store.dispatch('setUserObject', null)
    },

  methods: {
    onSubmit (e) {
      this.disable(e)
      axios.post('/auth/id_pass/'+ this.id + '/create',
      {
        password: this.password,
        email: this.email1,
        confirm_password: this.confirm_password
      }).then((response) => {
          this.storeuser(response.data.user)
          
          console.log(response.data.user);
      }).catch((error) => {
      });
    },

    storeuser(value) {
        this.$store.dispatch('setUserObject', value) //its not dispatching 
    }
  }

}

</script>

and here is my vuex

const state = {
  user: {}
}

const mutations = {
  SET_USER (state, userObj) {
    state.user = userObj
  }
}

const actions = {
  setUserObject: ({commit}, userObj) => {
    commit('SET_USER', userObj)
  }
}

export default {
  state,
  mutations,
  actions
}

but same thing I tried in another component its working fine like

methods: {
       fetchPost() {
            axios.get('/customer/' + this.id)
            .then((response) => {
              this.customer = response.data
              this.$store.dispatch('setUserObject', response.data.user) //here its dispatching 
            }).catch((error) => {
              console.log(error);
            });
     },

vipin93 left a reply on How Can Pass Props With Vue-router? • 1 month ago

I try using push method

actionbutton (value) {
         this.$router.push({name: 'customeraction', params: {id:value.id}});
    }

now I want pass props "customer" how can pass this from this router my routes.js

{
      path: '/customer/:id/action',
      name: 'customeraction',
      component: require('./components/CustomerAction'),
      props: true

    },

vipin93 started a new conversation How Can Pass Props With Vue-router? • 1 month ago

I tried to pass props data and in from parent to child components using vue router but when I clicked on my route in parent component my route only changed but my child component not open I want something like its open new view and I can use as back button to go back

here is my routes

      path: '/',
      component: require('./components/Home'),
      children: [
        {
            path: '/customer/:id/action',
          name: 'customeraction',
          component: require('./components/CustomerAction')
          }
      ]
    },```

here is my Home component

            <tr  v-for="(customer, index) in customers">

               <td>{{customer.name}}</td>
                 <router-link :to="{ name: 'customeraction', params: { id: customer.id }}">
                   <i class="fa fa-bars" aria-hidden="true"></i>
                 </router-link>
               </td>

             </tr>  //here I want click on this route so my new CustomerAction(component) should open but when I click nothing happen only my route change 
here is CustomerAction

{{ customer.email }} export default { props: ['customer'], } ```

9th October, 2017

vipin93 left a reply on Convert View To Pdf File • 1 month ago

use Storage and laravel-snappy

28th September, 2017

vipin93 started a new conversation Hey How Can Use Guzzle Response Data ? • 1 month ago

Hey I'm posting a post request for my api and getting data like this

{
"200": "OK",
"somdata": [
"Commercial versions of Word are licensed as a standalone product or as a component of Microsoft Office, Windows RT or the discontinued Microsoft Works suite."
]
}

now how can print only somdata

I tried something

echo($response['somdata'][0])

But its not working I know its just a basic question but I'm stuck

thanks

vipin93 started a new conversation Slack And Laravel Botman/botman Error? • 1 month ago

Hey I'm trying to use laravel and Slack to make Bot I'm following this http://marcelpociot.de/blog/2016-10-19-write-your-own-slack-bot-using-laravel now prolem is that evry time when I try to veryfy my my challenge http://18ac9818.ngrok.io/slack its give me error

 "Your URL didn't respond with the value of the challenge parameter."

but I register route for this

Route::post('/slack', '[email protected]');
public function connect(Request $request) {

        $payload = $request->json();

        if ($payload->get('type') === 'url_verification') {

            return $payload->get('challenge');

        }
    }
```
I double checked everything was right but again and again I'm getting  that error 

26th September, 2017

vipin93 started a new conversation How Can I Access PDF File? • 1 month ago

I'm trying to use https://github.com/spatie/pdf-to-text problem now I'm successfully able to upload file but I can not retrieve every time I'm getting error

2017-09-26 17:53:10] local.ERROR: could not find pdf E:\laragon\www\precilyl\storage.\.3KHzY2cOUkWyAuf0ziwIxqkS1n62QmNtaetzMwWv.pdf {"exception":"[object] (Spatie\\PdfToText\\Exceptions\\PdfNotFound(code: 0): could not find pdf 

here is my code

// $return = Storage::disk('local')->put('file.pdf', $request->filename);

    $filename = $request->file('filename')->store('');
    // $path = storage_path() . '\' . $name;
    // $file = Storage::get('app/'.$name);
    $return = \Spatie\PdfToText\Pdf::getText($filename, '/mingw64/bin/pdftotext');

     return $return;

22nd September, 2017

vipin93 left a reply on How Can I Highlight Some Words From A Paragraph • 2 months ago

mounted () {
    let cardTextList = document.querySelectorAll('.highlights-go-here');  
    cardTextList.forEach((element) => {
      let instance = new Mark(element);
      this.tagged.forEach((tagItem) => {
        instance.mark(tagItem.tag, {
          element: 'span',
          className: 'highlighted'
        });
      });
    });
  }

but problem with is that every time when My

  bots: [ {botwelcome: 'Good Morning!', bottrue: true}, {botwelcome: 'Please give some paragraph for summarizing. Please give some paragraph for summarizing', bottrue: false} ],///here when it updated my mounted not
      tagged: [{ tag: 'please' }] ///here when it updated my mounted not working 

vipin93 started a new conversation How Can I Highlight Some Words From A Paragraph • 2 months ago

like here is my view

<div id="app">
  <v-app id="inspire">
    
    <template>
    <v-container grid-list-xl>
        <v-layout row wrap>
               <v-flex>
         <v-layout row wrap v-for="bot in bots">
            <v-card   
                            :class="{ 'green mt-2 xs7 sm7 md7 mt-2': bot.bottrue, 'purple xs7 offset-xs0 
                           offset-mg2 offset-lg5 mt-2 text-xs-righ': !bot.bottrue }">
                           <v-card-text v-html="bot.botwelcome.replace(/\b(here i want replace this from tagged array abject)\b/g, 
                            '<strong>$1</strong>')"> {{ bot.botwelcome }}</v-card-text>
              </v
                     </v-layout>
         </v-flex>      
        </v-layout>
    </v-container>
</template>
 
  </v-app>
</div>

new Vue({ el: '#app', data () { return { bots: [ {botwelcome: 'Good Morning!', bottrue: true}, {botwelcome: 'Please give some paragraph for summarizing. Please give some paragraph for summarizing', bottrue: false} ], tagged: [{ tag: 'please' }] ///here I want this to be highlighted } } })


I really do not getting idea how can do this should i use for loop

thanks  

12th September, 2017

vipin93 left a reply on How Can Print Index Value In V-text Or V-for? • 2 months ago

problem is that How can add my response api data in my return

data () {
      return {
        valid: false,
        editing: false,
        apiresonse //here after submit button I want here to add api response bodytexts so that I can use 
      }
    },

vipin93 left a reply on How Can Print Index Value In V-text Or V-for? • 2 months ago

I'm not using blade

vipin93 started a new conversation How Can Print Index Value In V-text Or V-for? • 2 months ago

I'm trying to print value which I'm getting from my api but problem is that I'm getting it only in index format which I do not know how can I print

<template>
  <v-layout column justify-center>
    <v-card class="white--text" text-sm-center style="padding:10px;">
      <h4 class="text-sm-center">
        <div v-if="editing">
          Summary
        </div>
        <div v-else>
          Paste Paragraph
        </div>
    </h4>
      <v-layout row>
        <v-flex xs12>
          <div v-if="editing">
              <p  v-for="(item, index) in items">
              //here how can print response api value in on line 
              </p>
            <v-btn @click="back">back</v-btn>
          </div>
          <div v-else>
            <v-form  ref="form" v-model="valid">
              <v-text-field   v-model="body" name="body" rows="15"
              required textarea dark></v-text-field>
              <v-btn success class="elevation-0" @click="submit">Submit</v-btn>
              <v-btn @click="clear">clear</v-btn>
            </v-form>
          </div>
        </v-flex>
      </v-layout>
    </v-card>
  </v-layout>
</template>

<script>
  import axios from 'axios'
  function getbody (body) {
    var jsonData
    axios({
      method: 'post',
      url: 'http://api.foobar.com',
      data: (body),
      contentType: 'application/json',
      dataType: 'json',
      async: false,
      success: function (data) {
        jsonData = data
      }
    })
    return jsonData
  }
  export default {
    data () {
      return {
        valid: false,
        editing: false,
      }
    },
    methods: {
      submit () {
        var apiResponse = getbody({'body_text': this.body})
        var bodyfinal = apiResponse.bodytexts   ///here i want print bodytexts 
        this.editing = true
        this.body = summaryfinal
        console.log(apiResponse.bodytexts.length)
      },
      clear () {
        this.$refs.form.reset()
      },
      back () {
        this.editing = false
        this.body = ''
      }
    }

  }
</script>

api response I'm getting


  "200": "OK", 
  "bodytexts": [,...]
    [0]:"Word 2008, released on January 15, 2008, included a Ribbon-like feature, called the Elements Gallery, that can be used to select page layouts and insert custom diagrams and images.", 
    [1]:"Word 2011, released in October 2010, replaced the Elements Gallery in favor of a Ribbon user interface that is much more similar to Office for Windows,[40] and includes a full-screen mode that allows users to focus on reading and writing documents, and support for Office Web Apps.", 
    [2]:"[41]"
  


11th September, 2017

vipin93 started a new conversation How Can I Convert Jquery To Axios? • 2 months ago

here is I try to convert this jquery ajax call jqery to axios but could not getting clue here is my code

chrome.runtime.onInstalled.addListener(function() {
  var body = "selection";
  var name = "jhone doe";
  var all_col = chrome.contextMenus.create({"name": name, "contexts":[body],"id": "context_selection"});  
});

var open_window_ids=[]

function getSummary(body_resp) {

    var body_data;

    $.ajax({
        url: 'http://mereac.dev/',
        type: 'POST',
        data: JSON.stringify(body_resp),
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        async: false,
        success: function(data) {
            body_data = data;
        }
    });

    return body_data;
}

8th September, 2017

vipin93 left a reply on How Create Nested Relationship Over Three Models • 2 months ago

and first you should check value availability if not available then print null or something like $products->some->nnnn or 'mesg'

vipin93 left a reply on Real Time Simulation (Web App And Phone App) • 2 months ago

use pusher or socket.io

vipin93 left a reply on How Create Nested Relationship Over Three Models • 2 months ago

try to use eager loading with('products.perr')..

6th September, 2017

vipin93 started a new conversation Its Look Like Laracasts.com Is Now A PWA Web App. • 2 months ago

I just noticed that laracasts.com now a PWA web app. Its nice to see some series on PWA development. PWA a great alternative of mobile app.

29th August, 2017

vipin93 left a reply on Getting Data Between Two Dates • 2 months ago

use first where clause then pluck

5th August, 2017

vipin93 started a new conversation Is Thee Any Libraries Or Tutorial To Make Real Time Vehicle Tracking Web App? • 3 months ago

I'm building a web app for school, for tracking school bus I required to make real time tracking system with help of GPS and google map, I search a lot but could not find. if any one have experience please share some idea.(L5.4)

Thank you

25th July, 2017

vipin93 left a reply on Is It Possible To Integrate Biomatric Attedence System In Laravel? • 3 months ago

@Snapey thanks i'll ask to provider

vipin93 left a reply on Is It Possible To Integrate Biomatric Attedence System In Laravel? • 3 months ago

I will use Identix-Biometric for this purpose

vipin93 left a reply on Is It Possible To Integrate Biomatric Attedence System In Laravel? • 3 months ago

@topvillas I already but not found

vipin93 left a reply on Is It Possible To Integrate Biomatric Attedence System In Laravel? • 3 months ago

can you give some idea are any blog post

vipin93 started a new conversation Is It Possible To Integrate Biomatric Attedence System In Laravel? • 3 months ago

Now in my app a auth user fill day, entry time, leave time mannully, but i want to make automatic with biomatric. so it is possible?

17th July, 2017

vipin93 left a reply on Serialization Of 'Closure' Is Not Allowed? • 4 months ago

@lars6 instead of job should i use event?

vipin93 started a new conversation Serialization Of 'Closure' Is Not Allowed? • 4 months ago

I tried to dispatch job for my app but its giving me errors

Serialization of 'Closure' is not allowed

here is my in controller

dispatch(new AuthSendMessage($students,$r,$user));

and my AuthSendMessage

class AuthSendMessage implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

     protected $students;
     protected $r;
     protected $user;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($students,$r,$user)
    {
       
        $this->students      = $students;
         $this->r                  = $r;
         $this->user            = $user;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        foreach ($this->students as $student)
         {       
            $data = [
         
             'student_id'       => $student->id ,
             'teacher_id'       => null,
             'by_owner_id'   => Auth::id(),
             'by_teacher_id' => null,
             'message'          => $this->r->message

            ];

                $numbers[] = $student->emer_no; 
          
                $this->user->messages()->create($data);
         }
    }

16th July, 2017

vipin93 left a reply on How Can I Combine Two Objects? • 4 months ago

I did like

$combine =  $timetables->merge($subjectnames);

and in view

@foreach($combine as $classe_section) {{ $i }} {{ $classe_section->courses['name'] }} {{ $classe_section->sections['name'] }}
                          @endforeach 
getting error 

Undefined index: name on line

{{ $classe_section->courses['name'] }} and when i try this {{ $classe_section->courses->name }}

Property [name] does not exist on this collection instance.

here is my $combine

[ { "id": 2, "user_id": 1, "name": "English", "remarks": null, "created_at": "2017-07-14 23:26:09", "updated_at": "2017-07-14 23:26:09" }, { "id": 3, "section_id": 1, "course_id": 2, "asession_id": 2, "user_id": 1, "start": "2017-07-16 07:40:00", "end": "2017-07-16 08:20:00", "created_at": "2017-07-16 00:38:54", "updated_at": "2017-07-16 00:38:54", "courses": { "id": 2, "user_id": 1, "name": "I", "remarks": null, "created_at": "2017-07-14 23:05:01", "updated_at": "2017-07-14 23:05:01" }, "sections": { "id": 1, "user_id": 1, "name": "A", "remarks": null, "created_at": "2017-07-14 23:25:51", "updated_at": "2017-07-14 23:25:51" } }, { "id": 1, "user_id": 1, "name": "Hindi", "remarks": null, "created_at": "2017-07-14 23:26:04", "updated_at": "2017-07-14 23:26:04" } ]


vipin93 started a new conversation How Can I Combine Two Objects? • 4 months ago

I try to show some value using foreach loop but problem is that i have two objects and when i try to use in foreach loop its run 4 times 2+2 but i want only 2 times how can i combine them here is my code

 <tbody class="text-center">
                                 <?php $i = 0 ?>
                                @foreach($timetables as $classe_section)
                                 @foreach($subjectnames as $subject)
                                <?php $i++ ?>
                                <tr>
                                    <td>{{ $i }}</td>
                                    <td>{{ $classe_section->courses['name'] }}</td>
                                    <td>{{ $classe_section->sections['name'] }}</td>
                                    <td>{{ $subject['name'] }}</td>
                                    <td>
                                      @foreach($testnames as $testname)
                                        <a class="btn btn-primary" href="/teacher/student/{{$classe_section->courses['id']}}/{{$classe_section->sections['id']}}/{{$subject['id']}}/{{$testname['id']}}/test_amrks_upload">{{ $testname['name'] }}
                                        </a>
                                      @endforeach
                                    </td>
                                </tr>
                                @endforeach
                                @endforeach
                            </tbody>

here i want merge $timetables and $subjectnames

vipin93 started a new conversation How To Avoid Duplicate Foreign Key For Different Colmn Name? • 4 months ago

I'm stuck with group by in my project , my problem is that i have table with 5 column name which stored foreign key value from one table now i want to group them by foreign key and if all column have same foreign key then show only one not all 5 time how can i do. here is my model and logic


      $timetables = TimeTable::where(function($q) use($userID,$activesessionidID){
                                      $q->where('user_id',$userID)
                                         ->where('asession_id',$activesessionidID);
                                   })->where(function($q){
                                      $q->orWhere('sunday_teacher_id',Auth::id())
                                         ->orWhere('monday_teacher_id',Auth::id())
                                         ->orWhere('tuesday_teacher_id',Auth::id())
                                         ->orWhere('wednesday_teacher_id',Auth::id())
                                         ->orWhere('thursday_teacher_id',Auth::id())
                                         ->orWhere('friday_teacher_id',Auth::id())
                                         ->orWhere('saturday_teacher_id',Auth::id());
                                   })->groupBy(['sunday_subject_id','monday_subject_id','tuesday_subject_id','wednesday_subject_id','thursday_subject_id','friday_subject_id','saturday_subject_id'])->get();

my time table model

   <?php

namespace App\Model\Staff\Acadmic;

use Illuminate\Database\Eloquent\Model;
use App\Model\Staff\Acadmic\TimeTable;
use Carbon\Carbon;
use App\Model\Day;
use App\Subject;
use App\Teacher;
use App\User;
use App\Course;
use App\Section;
use App\Asession;

class TimeTable extends Model
{
 
  
    protected $fillable = [
       'start','end','asession_id','section_id','course_id','sunday_subject_id','sunday_teacher_id','monday_subject_id','monday_teacher_id','tuesday_subject_id','tuesday_teacher_id','wednesday_subject_id','wednesday_teacher_id','thursday_subject_id','thursday_teacher_id','friday_subject_id','friday_teacher_id','saturday_subject_id','saturday_teacher_id','sunday_remarks', 'monday_remarks' ,'tuesday_remarks','wednesday_remarks' ,'thursday_remarks' ,'friday_remarks', 'saturday_remarks'
    ];
     //'break_start','break_end',
     protected $dates = ['start','end'];


     public function setStartAttribute($value)
    {
        
        $this->attributes['start'] = Carbon::createFromFormat('g:i A',$value);
    }

    public function setEndAttribute($value)
    {
         
        $this->attributes['end'] = Carbon::createFromFormat('g:i A',$value);
    }

    public function sundaysubjects()
    {
        return $this->belongsTo(Subject::class,'sunday_subject_id');
    }

    public function sundayteachers()
    {
        return $this->belongsTo(Teacher::class,'sunday_teacher_id');
    }

    public function mondaysubjects()
    {
        return $this->belongsTo(Subject::class,'monday_subject_id');
    }

    public function mondayteachers()
    {
        return $this->belongsTo(Teacher::class,'monday_teacher_id');
    }

    public function tuesdaysubjects()
    {
        return $this->belongsTo(Subject::class,'tuesday_subject_id');
    }

    public function tuesdayteachers()
    {
        return $this->belongsTo(Teacher::class,'tuesday_teacher_id');
    }

    public function wednesdaysubjects()
    {
        return $this->belongsTo(Subject::class,'wednesday_subject_id');
    }

    public function wednesdayteachers()
    {
        return $this->belongsTo(Teacher::class,'wednesday_teacher_id');
    }

    public function thursdaysubjects()
    {
        return $this->belongsTo(Subject::class,'thursday_subject_id');
    }

    public function thursdayteachers()
    {
        return $this->belongsTo(Teacher::class,'thursday_teacher_id');
    }

    public function fridaysubjects()
    {
        return $this->belongsTo(Subject::class,'friday_subject_id');
    }

    public function fridayteachers()
    {
        return $this->belongsTo(Teacher::class,'friday_teacher_id');
    }

    public function saturdaysubjects()
    {
        return $this->belongsTo(Subject::class,'saturday_subject_id');
    }

    public function saturdayteachers()
    {
        return $this->belongsTo(Teacher::class,'saturday_teacher_id');
    }



    public function sections()
    {
        return $this->belongsTo(Section::class,'section_id');
    }

    public function courses()
    {
        return $this->belongsTo(Course::class,'course_id');
    }

    public function asessions()
    {
        return $this->belongsTo(Asession::class,'asession_id');
    }

     public function users()
    {
        return $this->belongsTo(User::class,'user_id');
    }
}

5th July, 2017

vipin93 started a new conversation How Can I Generate Unique And Random Combination? • 4 months ago

I'm try to generate time table of school which should random and unique combination of some value like I have value in database combination of teacher, class, section,subject now i want time table will generate combination of

day time teacher subject

for particular class and section

please give some guide, I'have no clue thanks

3rd July, 2017

vipin93 started a new conversation CURL Error 7: Failed To Connect To Api.mailgun.net • 4 months ago

I'm try to use Bogardo/Mailgun to use for my newsletter email sending but when I try to send simple email its throwing error

cURL error 7: Failed to connect to api.mailgun.net port 80: Timed out (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

23rd June, 2017

vipin93 started a new conversation Dropdown Not Working? • 5 months ago

I'm using datatables for my database record but when i'm added js file of datatables my menu dropdown not working when i removed my dropdown file my dropdown working .

like my main layout file

<script src="/js/app.js"></script> 
      @yield('script')
  </body>

and my page where i'm using script

@section('script')
<script type="text/javascript" src="{{asset('/js/datatables.min.js')}}" ></script>
<script src="{{asset('/vendor/datatables/buttons.server-side.js')}}"></script>
.....
...
@stop 

here when i removed

<script type="text/javascript" src="{{asset('/js/datatables.min.js')}}" ></script>
<script src="{{asset('/vendor/datatables/buttons.server-side.js')}}"></script>

my dropdown working thanks

19th June, 2017

vipin93 left a reply on How To Order By In Eloquent Relationships? • 5 months ago

use eager load with where clause

14th June, 2017

vipin93 started a new conversation How Can I Combine This Query? • 5 months ago

 $hostel_fee = HostelFeeCollection::whereHas('asessions',function($q) use($activesession){
                                      $q->where('user_id',Auth::id())
                                      ->where('id',$activesession->id);
                                    })->sum('hostel_fee'); 
 $hostel_fee_late = HostelFeeCollection::whereHas('asessions',function($q) use($activesession){
                                      $q->where('user_id',Auth::id())
                                      ->where('id',$activesession->id);
                                    })->sum('late_fee');

$hostel_fee_other = HostelFeeCollection::whereHas('asessions',function($q) use($activesession){
                                      $q->where('user_id',Auth::id())
                                      ->where('id',$activesession->id);
                                    })->sum('other_fee');

10th June, 2017

vipin93 left a reply on Why I'm Not Getting Expected Value? • 5 months ago

@mushood problem solved its about order first AND Then OR

@Snapey

Can you see the mysql log?

I did not get this

vipin93 started a new conversation Why I'm Not Getting Expected Value? • 5 months ago

I try to fetch users who have subscription created month is equal to current last month but its giving all users here is my function (I have to user only id 1, and 2


        //$lastmonth = Carbon::now()->subMonth(1)->month; 

        $users = User::where('active',1)->where('plan','!=',0)->orWhere('plan',1)
                        ->orWhere('plan',2)->whereHas('subscriptions',function($q){
                            $q->whereMonth('created_at',5');
                        })->select('id')->get();
       return $users;

and output

[
{
"id": 1
},
{
"id": 2
}
]

and here is my subscriptions table ( https://ibb.co/jKFGtF)

vipin93 left a reply on How To Show Data Of Other Table For Current Auth User..? • 5 months ago

if ur problem solved then marked best answer so that it help to other

vipin93 left a reply on Help Me With Working Flow For My Dedicated Server. • 5 months ago

use git work flow

8th June, 2017

vipin93 left a reply on It Is Ok To Use LetsEncrypt Free SSL? • 5 months ago

I comparing Ssl price from different different website and i see what, its very price different some website. for combo some webs

vipin93 left a reply on It Is Ok To Use LetsEncrypt Free SSL? • 5 months ago

yaa i think so its all about warranty but, if i using free ssl it's common perception in user mind that we are not concerned about security because we not spend some $$ on certificate in simple word if something is free then that's not good

vipin93 left a reply on It Is Ok To Use LetsEncrypt Free SSL? • 5 months ago

@Snapey yes i don't have wildcard url and I'm also using certbot maintain my certificate

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.