vipin93

Self Coder at home

Experience

56,280

57 Best Reply Awards

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

22nd September, 2017

vipin93 left a reply on How Can I Highlight Some Words From A Paragraph • 1 day 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 days 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? • 1 week 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? • 1 week ago

I'm not using blade

vipin93 started a new conversation How Can Print Index Value In V-text Or V-for? • 1 week 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? • 1 week 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 weeks 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 weeks ago

use pusher or socket.io

vipin93 left a reply on How Create Nested Relationship Over Three Models • 2 weeks 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 weeks 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 • 3 weeks 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? • 1 month 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? • 1 month ago

@Snapey thanks i'll ask to provider

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

I will use Identix-Biometric for this purpose

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

@topvillas I already but not found

vipin93 left a reply on Is It Possible To Integrate Biomatric Attedence System In Laravel? • 1 month 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? • 1 month 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? • 2 months ago

@lars6 instead of job should i use event?

vipin93 started a new conversation Serialization Of 'Closure' Is Not Allowed? • 2 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? • 2 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? • 2 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? • 2 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? • 2 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 • 2 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? • 3 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? • 3 months ago

use eager load with where clause

14th June, 2017

vipin93 started a new conversation How Can I Combine This Query? • 3 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? • 3 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? • 3 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..? • 3 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. • 3 months ago

use git work flow

8th June, 2017

vipin93 left a reply on It Is Ok To Use LetsEncrypt Free SSL? • 3 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? • 3 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? • 3 months ago

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

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

@bashy no i don't take payment via my server, just they will login and and see stuff

vipin93 started a new conversation It Is Ok To Use LetsEncrypt Free SSL? • 3 months ago

I have made web app for my startup a SaaS aap, and I'm using free letsencrypt (due to money problem). so it's ok if I'm using free ssl? i'll switch to paid if i got a customer. so my question is its safe to use free SSL? thanks

7th June, 2017

vipin93 left a reply on ErrorException In 80fce0be48ed3b2cd527007937305e5b3980a066.php Line 21: Undefined Variable: Data (View: C:\Project\resources\views\admin\account.blade.php) • 3 months ago

@dzthe u have to first just watched videos of laravel its free available on laracasts

vipin93 left a reply on Get Name Of Foreign Key • 3 months ago

@shakti bhai kya ulte sidhe answer likha hai yaar iska sidha saa answer hoga @shoulieheinds your questions answered is like

Your User Model look like

   public function religions()
    {
      return $this->belongsTo(Religion::Class,'religion_id');
    }

and in your controller use lazy loading like

$user = Auth::user();
$user->load('religions');

and in your view use like

$user->religions['name'];

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

Your relationship should looks like your User model

public function researchs(){

return $this->hasMany(Research::class);
}

your Research model

public function users(){

return $this->hasMany(User::class);
}

then u can call

$user = Auth::user();
$user->load('researchs')

vipin93 left a reply on Update User Profile • 3 months ago

vipin93 left a reply on Whoops, Looks Like Something Went Wrong. 1/1 FatalErrorException In ProfileController.php Line 117: Syntax Error, Unexpected 'public' (T_PUBLIC) In ProfileController.php Line 117 • 3 months ago

i think it's not good idea to use hidden field , why making your app complex and extra code if laravel already provide nice stuff with less code

vipin93 left a reply on HOW TO CRREATE A PROFILE UPDATE CODING ? IN LARAVEL PLS HELP • 3 months ago

dude thats very basic stuff, did u watched laracasts laravel 5.** any series

vipin93 left a reply on HOW TO CRREATE A PROFILE UPDATE CODING ? IN LARAVEL PLS HELP • 3 months ago

its seems like u have to follow laracasts laravel 5.4 series, no one will write code for u

vipin93 left a reply on Whoops, Looks Like Something Went Wrong. 1/1 FatalErrorException In ProfileController.php Line 117: Syntax Error, Unexpected 'public' (T_PUBLIC) In ProfileController.php Line 117 • 3 months ago

@tisuchi i think using hidden user id is not safe what if someone changed id just using chrome dev tool and not appropriate way to save instead he can use relationship in this case he just pass

Auth->user()->save($data) 

or

$user = Auth::user();  
$user->stuff = $request->stuff
...
..
..
$user->save()

6th June, 2017

vipin93 left a reply on How Can Deploy Two App Demo.example.com And Example.com? • 3 months ago

@tekmi that's not i want and my problem is solved i pointing my url instead i should point @

5th June, 2017

vipin93 left a reply on How Can Deploy Two App Demo.example.com And Example.com? • 3 months ago

i have checked its fine server_name demo.example.com

vipin93 started a new conversation How Can Deploy Two App Demo.example.com And Example.com? • 3 months ago

i tried t deploy my main app and my demo app on same LEMP server i have created two block one example.com and for demo.example.com but everytime when i tried to go demo.example.com its throw an errors "Server not found" and i checked my access log file and error log nothing find i'm using LEMP server and and my domain provider godaddy

4th June, 2017

vipin93 left a reply on Uploading File / Photo. • 3 months ago

why u confused in simple word u will upload your photo name along with other stuff

3rd June, 2017

vipin93 left a reply on Can Someone Explain How Can I Deploy More Than Two App LEMP Server? • 3 months ago

@fideloper

you may also have a bad Nginx configuration

what is the best Nginx configuration for multiple app , any reference thanks

Edit Your Profile
Update

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