kuns25

kuns25

Member Since 8 Months Ago

Pune

Laravel Developer at Drogenide Softwares Pvt Ltd

Experience Points 10,270
Experience Level 3

4,730 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 89
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

02 Mar
2 weeks ago

kuns25 left a reply on Method Illuminate\Database\Eloquent\Collection::orderBy Does Not Exist.

@SNAPEY - @snapey please tell me that we don't have to use get() in collection methods and it will still work, like we use get() / First () in queries , now I get the difference between query get & collection get method.

01 Mar
2 weeks ago

kuns25 left a reply on How Do I Display Only Eloquent Related Data In Blade File

@D9705996 - Yeh thanks man this was simple solution , i was so naive back then, now after few months i can understand what everyone was trying to tell.

26 Feb
2 weeks ago

kuns25 left a reply on Method Illuminate\Database\Eloquent\Collection::orderBy Does Not Exist.

@SNAPEY - ya actually im adding show more button , thats why also loading all posts

23 Feb
3 weeks ago

kuns25 left a reply on Method Illuminate\Database\Eloquent\Collection::orderBy Does Not Exist.

Thanks for replying ,I'm getting this error now ,

Too few arguments to function Illuminate\Support\Collection::get(), 0 passed in C:\xampp\htdocs\laravel\twitter\app\Http\Controllers\HomeController.php on line 26 and at least 1 expected
 return $posts = $allposts->take($request->get('limit', 20))->sortByDesc('created_at')->get(); 

kuns25 started a new conversation Method Illuminate\Database\Eloquent\Collection::orderBy Does Not Exist.

This Query Giving me above error


$allposts =  Post::whereIn('user_id',$request->user()->following()->pluck('follower_id')->push($request->user()->id)) ->with('user')->get();

 return $posts = $allposts->take($request->get('limit', 20))->orderBy('created_at', 'desc')->get();

Thanks in advance

21 Feb
3 weeks ago

kuns25 started a new conversation How Do You Guys Create Admin Panel In Laravel

Hii , Just wanted to know what steps you guys follow to create Admin Panel (Multi Auth) in Laravel . Like do you use any admin panel Generator like voyager ,( I don't know how to use that yet) , or Use any admin related package or Create Seperate Auth Controller for admin overriding default auth methods .

Also do you Create Separate model for admin or just add isAdmin field in User Model / Database .

please give me tips for creating admin panel in laravel.

Thanks

17 Feb
1 month ago

kuns25 left a reply on Passing Data From Child Vue Component Via Events Is Giving Undefined

Sorry for trouble i don't know what happen but when i re run npm watch it solved it problem

kuns25 started a new conversation Undefined , Error In Emiting Event And Passing Value From One Component To Another

I'm very new to vue , i have 3 simple components in my laravel project , one PostForm to post a tweet , and others to show the post on timeline . I am using axios of post and get that from backend . When im posting a tweet its getting saved in my database , but when i pass data by event , its giving https://snag.gy/Cjlaw6.jpg error to me.

My Code is here .

PostForm component ` <form action="#" class="form-vertical" @submit.prevent="post"> Post it!

import eventhub from '../event' export default{ data(){ return{ body:null } }, methods:{ post(){ console.log(this.body) axios.post('posts',{ body:this.body }).then((response)=>{
        eventhub.$emit('post-added', response.body)
            this.body=null
        })
    }
}

}

` when i console.log(response.data) i am getting everything properly https://snag.gy/vNYL57.jpg , and then im emitting event named post-added to my timeline component.

Timeline Component ` Timeline

import eventhub from '../event' import Post from './Post.vue' import postform from './PostForm.vue'

export default { data(){ return{ posts:[] } } , components:{ Post,postform } , methods:{ addpost(record){

    }
},
mounted() {
    eventhub.$on('post-added',this.addpost)
    axios.get('/posts').then((response)=>{
        this.posts=response.data
        
    })
}

}

` I am catching that post-added event in mounted , and then passing the value to addpost method(record) .This is where i am getting the attached error https://snag.gy/Cjlaw6.jpg .

In addpost method when im trying to console/log(record) its giving me undefined , i think this is the error and i have no idea why its giving me undefined https://snag.gy/Hz1Xo3.jpg

Thanks in advance ,

16 Feb
1 month ago

kuns25 left a reply on How To Turn Off "build Sucess" Notifications From Laravel Mix?

ok if anyone is saying this isn't working you have to close / terminate and re run your npm run watch after adding mix.disableSuccessNotifications();

07 Feb
1 month ago

kuns25 left a reply on Forget Password

if you are saying you want to send otp about forget password to user , you can use twilio for that

27 Jan
1 month ago

kuns25 left a reply on Need Help In Twilio Sms API Integration

@BOBBYBOUWMANN - Hii Really Thanks for replying to my question , Actually i have never integrated a third party api without any packages , can you please guide me or share any tutorials where i can learn how to integrate api by reading simply documentation , i tried finding on youtube , but most of them are about using packages .

Also there is one more twilio package which dose not required notification https://github.com/aloha/laravel-twilio

i also successfully integrated this package in laravel 5.7 , but my current project is in laravel 5.3.

in aloha readme its written

And make these objects resolvable from the IoC container:

Aloha\Twilio\Manager (aliased as twilio) Aloha\Twilio\TwilioInterface (resolves a Twilio object, the default connection object created by the Manager).

i Can't understand this step for 5.3 .

Thanks in advance

kuns25 started a new conversation Need Help In Twilio Sms API Integration

Hii , Im using http://laravel-notification-channels.com/twilio/ package , for integration of twilio sms .

I am verifying user mobile number during registration . I did all the configuration given in the package , and luckily im getting sms as well , user is getting verified as well .

I want to change the flow of verification of user , currently im first saving user with mobile number in database , then sending sms .i want to verify mobile number before saving data in Database . in package its given we can we can send sms by using below function in notifiable model , but for request we dont use any model , how can i fix that ,i dont know how to send sms to input mobile no.,

// code to enter in notifiable user model
public function routeNotificationForTwilio()
{
    return '+1234567890';    // or we can say $this->mobile
}

Please Help me how can i pass my $request->mobile in my notification 

``
The Code is pretty simple .

you can check it 

My web.php
18 Jan
2 months ago

kuns25 left a reply on Cant Send Mail In Laravel 5.3

@REALRANDYALLEN - Broo Thanks.

Config:clear

This Helped

kuns25 left a reply on Cant Send Mail In Laravel 5.3

@MARTENVANURK - its fine im already aware of that , ill reset it , do you know the solution.

kuns25 left a reply on Cant Send Mail In Laravel 5.3

yes , heres my .env

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=a3f1dcf02c001e    
MAIL_PASSWORD=58fbbe5156119c
MAIL_ENCRYPTION=null

kuns25 started a new conversation Cant Send Mail In Laravel 5.3

Hii , Im trying to send mail in my laravel 5.3 project , but im not receiving any mail , neither im getting any error , also mail code when i use in laravel 5.7 im receiving mail on my mailtrap .

please guide me if there is any difference in laravel 5.3 & 5.7 mail.

code is quite simple , please help

My Route


Route::get('contacts','[email protected]');


My Controller

<?php

namespace App\Http\Controllers;

use App\Mail\mailtrap;
use Illuminate\Support\Facades\Mail;

  
class MailController extends Controller
{
    public function index(){
    
    Mail::to('[email protected]')->send(new mailtrap());
         
    }
}
 

my mailable

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class mailtrap extends Mailable
{
    use Queueable, SerializesModels;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('email');
    }
}

my view

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Mail Send</title>
</head>
<body>

    <h3>You Have Received Enquiry From Website</h3>
    
    


</body>
</html> 

14 Jan
2 months ago

kuns25 left a reply on Paid Laracast Tutorials?

@shez1983 , I already have course code subscription lol .Alex is good but still i'll say jeffreyway is a lot better teacher in many ways.

kuns25 left a reply on Paid Laracast Tutorials?

@jeffreyway I am getting "Your card does not support this type of purchase" error. Can i pay with paypal or any other medium

25 Dec
2 months ago

kuns25 left a reply on Paid Laracast Tutorials?

@JEFFREYWAY - its showing 16 series for laravel , is that all .

17 Dec
3 months ago
12 Dec
3 months ago

kuns25 left a reply on Laravel Does Not Display Images In The View From Storage Folder

I Suggest you to link your storage folder to public folder by using php artisan storage:link command

then try

` <img src="{{ asset('storage/public/cover_images'. $book->image )}}"

`

kuns25 left a reply on Check If Input Value Before Update

while updating you dont need to check or validate anything Laravel Does this automatically for you yes if you are asking in case of user password update you can validate if user is entering same old password with below password comparison ` $user =Auth::id();

if(Hash::check($request->password, $finduser->password)) { return 'Old password and new password cant be same' } else { $user->password = bcrypt($request->password); $user->save(); } ` obviously you can return response with flash session , and many more things , its all up to you.

kuns25 left a reply on Check If Input Value Before Update

while updating you dont need to check or validate anything Laravel Does this automatically for you yes if you are asking in case of user password update you can validate if user is entering same old password with below password comparison

$user =Auth::id();

if(Hash::check($request->password, $finduser->password)) { return 'Old password and new password cant be same' } else { $user->password = bcrypt($request->password); $user->save(); }

obviously you can return response with flash session , and many more things , its all up to you.

06 Dec
3 months ago

kuns25 left a reply on UPGRADE TO LARAVEL 5.7 FROM 5.4

@PETRIT - tried to upgrade to 5.5 still showing the older version

kuns25 started a new conversation UPGRADE TO LARAVEL 5.7 FROM 5.4

Hii , So I have an old project in laravel 5.4 & wanted to upgrade it to 5.7 , all i did was change my "laravel/framework": "5.7.*"(composer.json) and run composer global update .when command executed successfully and i check php artisan --version , its showing laravel framework 5.4 .

where did i go wrong , please guide .

Thanks in Advance

kuns25 left a reply on Disable Updated_at Time Of Insert

In your model just add

$timestamps = false;

and we are good to go

27 Nov
3 months ago

kuns25 started a new conversation Paid Laracast Tutorials?

After 6 Months of experience in Laravel , Today I accidentally watched Some Videos of Laravel 5.7 from scratch on laracast, Videos were so awesome that it clears many basic concept that i was not aware of till date. so i was thinking to get Paid Subscription of Laracast .

Just Wanted to Know What im gowning to learn in Paid Version . Do They teach Entire Project Building From Strach , Can you Share list of some Series names,or How Many series are there to learn .

Thanks.

21 Nov
3 months ago

kuns25 left a reply on Check For A Specific Value In Validation Or Add Prefix In Login Controller

@SIRIK - Hii , Actully i checked , but couldnt understand ,how to validate if a particular character (+91) is added or not in the form field .

kuns25 started a new conversation Check For A Specific Value In Validation Or Add Prefix In Login Controller

Hii ,

       I have a simple login form , where user enters mobile number and password for login .

How can i validate in my logincontroller i.e authenticateusers , where it will check if user has added country code i.e "+91" in mobile number field or not .

or pls guide how can i directly pass +91 in my login credentials so user wont have to enter country code everytime. (i mean how to concatinate +91 with mobilenumber) .

31 Oct
4 months ago

kuns25 left a reply on Need To Learn Date Range Filter In Laravel

@bobbybouwmann Hey Really Thanks , Can share Blade File please.

kuns25 started a new conversation Need To Learn Date Range Filter In Laravel

Hii I have simple registered user table , i want to add Add Range Filter Where admin can select From & To Date From Date picker // Calendar . Is there any tutorials on youtube , laracast , or anywhere can i see some sample demo code . please suggest .

Thanks & Regards,

29 Oct
4 months ago

kuns25 started a new conversation SQLSTATE[42000]: Syntax Error Or Access Violation: 1071 Specified Key Was Too Long; Max Key Length Is 767 Bytes (SQL: Alter Table `users` Add Unique `users_email_unique`(`email`))

Every Time while migrating in a new project , i get this error SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter tableusersadd uniqueusers_email_unique(email))

, i know we can resolve this issue by adding default string length in app service provider .

My Question is that why laravel don't dosen't provide it as by default . this irritates sometimes.

27 Oct
4 months ago

kuns25 left a reply on [Vue Warn]: Error In Mounted Hook

@tomasz.r @Mantey where did you put cdn file in laravel , in app.js or app.blade.php or in your example.vue file .please guide

09 Oct
5 months ago

kuns25 started a new conversation How To Create Virtual Balance / Money In Laravel

Hii Im trying to integrate third-party api for Mobile & DTH Recharge , I Want to create virtual money , where i transfer balance/amount from admin to my retailers and they can do transactions.

pls guide thanks.

kuns25 started a new conversation Will Laravel Upgrate To 5.7 Affect My Register Controller

Hii Im currently using laravel 5.6 , was going to upgrate to 5.7 , Actually im already registering users in 5.6 by default auth register , will update affect my user and admin register controller , also can i use verify email by maulally creating new column in table i.e email_verified_at .

Sounds stupid question .sorry for that , just want to make sure.

01 Oct
5 months ago

kuns25 started a new conversation "This Page Can't Load Google Maps Correctly." Error In Admin Panel Form Field

Hii Im trying to get address from google maps in form field found below code on stack overflow . When i run below code saved in .html format and also in simple blade file

Route::get('google',function(){

return view('google');

}); Its working good .

but again same code when pasted in my admin module its giving me error "This page can't load Google Maps correctly." Error in Admin Panel Form Field" I haven't added my google api key anywhere as it was working fine in .html , is it not working because im applying guards and middleware in code. please help

code is as below :

    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places&language=en-AU"></script>
    <script>
        var autocomplete = new google.maps.places.Autocomplete($("#address")[0], {});

        google.maps.event.addListener(autocomplete, 'place_changed', function() {
            var place = autocomplete.getPlace();
            console.log(place.address_components);
        });
    </script>
</body>

28 Sep
5 months ago

kuns25 left a reply on How Do I Display Only Eloquent Related Data In Blade File

@Snapey just passed get() ,and it resolved my error

,

$healthpackages = healthpackage::whereHas('categories',function($query){ $query->where('category','popular'); })->get();

27 Sep
5 months ago

kuns25 left a reply on API Not Working On Web Server

also in header i'm providing header

kuns25 started a new conversation API Not Working On Web Server

Hii ,

         I've Created a api to update user profile.  my Api is working perfectly on localhost , 

but when i uploaded it on my server.and test it on postman , i am able to generate o auth token , and create environment . but when i try to update profile , its giving me error { "message": "Unauthenticated." }.

do we have to change anything on webhost , because api working fine with localhost

My Route is

Route::group(['middleware' => ['auth:api']], function () {

    Route::post('/update/profile' ,'API\[email protected]_profile');


    });

& My Controller is

public function update_profile(Request $request)
    {

         
           $user = User::findOrFail(Auth::user()->id);
    
                                                   
             if($request->has('email')){
                $user->email = $request->email;
            }
            if($request->has('mobile')){
                $user->mobile = $request->mobile;
            }
            
            if($request->has('gender')){
                $user->gender = $request->gender;
            }
            if($request->has('dob')){
                $user->dob = $request->dob;
            }
            if($request->has('bloodgroup')){
                $user->bloodgroup = $request->bloodgroup;
            }
            if($request->has('maritalstatus')){
                $user->maritalstatus = $request->maritalstatus;
            }
            if($request->has('height')){
                $user->height = $request->height;
            }
            if($request->has('emergencycontact')){
                $user->emergencycontact = $request->emergencycontact;
            }
            if($request->has('photo')){
                $user->photo = $request->file('photo')->store('testing');
            }
            if($request->has('city')){
                $user->city = $request->city;
            }
            if($request->has('address')){
                $user->address = $request->address;
            }
            if($request->has('pincode')){
                $user->pincode = $request->pincode;
            } 

            $user->save();

              return response()->json(['msg'=>'User Updated Successfully'],200);

 }
26 Sep
5 months ago

kuns25 left a reply on Error : Missing Required Parameters For [Route: Admin.password.reset]

Resolved The Error , by Changing Route Name .

Thanks for your help

kuns25 left a reply on Error : Missing Required Parameters For [Route: Admin.password.reset]

@vilfago It Didin't Help , Sorry.

Here's the thing when i pass

<form method="POST" action="{{ route('admin.password.reset',['token' =>$token]) }}">

$token in my blade file its show me the reset blade file .

but again new error after submitting email id , password and confirm_password

im getting Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message

kuns25 left a reply on Error : Missing Required Parameters For [Route: Admin.password.reset]

@Dhaval_patel dd( $request->email) is giving me null .

@snapey no Sir .

kuns25 left a reply on Error : Missing Required Parameters For [Route: Admin.password.reset]

@Dhaval_patel how do i check that , please guide .

@Vilfago no i didn't use regex constraint

kuns25 started a new conversation Error : Missing Required Parameters For [Route: Admin.password.reset]

Hii I'm Trying to Reset Password of Admin Module .

After sending email from reset password form I'm Receiving Email : and in Mail After Clicking Reset My Password Button Its taking to Url

http://localhost:8000/admin/password/reset/e44b4b5cd9add15252c61ec62c9ce6b2e0d26da868e7112a43034f1da7c7fe4a

But Then Instead of Showing Reset My password blade Im getting below error

Missing required parameters for [Route: admin.password.reset] [URI: admin/password/reset/{token}]. (View: C:\xampp\htdocs\laravel\OneVaidya\resources\views\admin\adminreset\reset.blade.php)

My Web File is as follows :

Route::post('admin/password/email', 'Auth\[email protected]')->name('admin.password.email');
Route::get('admin/password/reset', 'Auth\[email protected]')->name('admin.password.request');
Route::post('admin/password/reset', 'Auth\[email protected]');
Route::get('admin/password/reset/{token}', 'Auth\[email protected]')->name('admin.password.reset');

My Controller is as follows

public function showResetForm(Request $request, $token = null)
    {
        return view('admin.adminreset.reset')->with(
            ['token' => $token, 'email' => $request->email]
        );
    }

Below is the blade file im expecting to open


@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">{{ __('Reset Password') }}</div>

                <div class="card-body">
                    <form method="POST" action="{{ route('admin.password.reset') }}">
                        @csrf

                        <input type="hidden" name="token" value="{{ $token }}">

                        <div class="form-group row">
                            <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>

                            <div class="col-md-6">
                                <input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ $email ?? old('email') }}" required autofocus>

                                @if ($errors->has('email'))
                                    <span class="invalid-feedback" role="alert">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>

                            <div class="col-md-6">
                                <input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>

                                @if ($errors->has('password'))
                                    <span class="invalid-feedback" role="alert">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>

                            <div class="col-md-6">
                                <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
                            </div>
                        </div>

                        <div class="form-group row mb-0">
                            <div class="col-md-6 offset-md-4">
                                <button type="submit" class="btn btn-primary">
                                    {{ __('Reset Password') }}
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

kuns25 left a reply on How To Write Code In Laracast?


test

outside

kuns25 left a reply on How To Write Code In Laracast?

php artisan test


23 Sep
5 months ago

kuns25 left a reply on How Do I Display Only Eloquent Related Data In Blade File

Health Package model

public function categories() {

return $this->belongsToMany(category::class,'category_healthpackages')->withTimestamps();

}

category Model

public function healthpackages() {

return $this->belongsToMany(healthpackage::class,'category_healthpackages')->withTimestamps();

}

healthpackage migration

Schema::create('healthpackages', function (Blueprint $table) { $table->increments('id'); $table->string('name');

        $table->timestamps();

category migration

Schema::create('categories', function (Blueprint $table) { $table->increments('id'); $table->string('name');

        $table->timestamps();

category_healthpackage

Schema::create('category_healthpackages', function (Blueprint $table) {

    $table->integer('healthpackage_id')->unsigned()->index();
    $table->integer('category_id')->unsigned()->index();
     $table->foreign('healthpackage_id')->references('id')->on('healthpackages')->onDelete('cascade');
        $table->timestamps();
    });