Van1310

Van1310

Member Since 10 Months Ago

Laravel Developer at Byte and Bits At Ahmedabad

Experience Points 21,300
Experience Level 5

3,700 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 107
Lessons
Completed
Best Reply Awards 8
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.

15 May
4 days ago

Van1310 started a new conversation Auth Data Empty

i try to authenticate data get pin number but when user register redirect to pin number page error like

Trying to get property of non-object

here is my pin number controller public function pin_view() { $id=\Auth::user()->id; //error in this line Trying to get property of non-object $pin=$user; return view('otp',compact('pin')); }

when i check return value is empty

public function pin_view()
    {   
        $id=\Auth::user()->id;  //error in this line  Trying to get property of non-object 
        //$pin=$user;
    return $id;
    }

how to fix it thank you

14 May
5 days ago

Van1310 left a reply on Why I Am Getting Error?

try this

$user=Auth::user();
echo "Welcome" . $user->name;

Van1310 left a reply on Incorrect Request

@MOUZAK - i can send code first copy and paste or give full code

Van1310 left a reply on Trying To Get Property 'id' Of Non-object

try this

$user=Auth::user();
$this->currentuser = $user()->id;

Van1310 left a reply on Incorrect Request

May be you cannot define Request in controller

public function demo(Request $request)
{
    $im=salaries::selectRaw('(nombreparts) as total')
        ->where('salaries.id', $request->id)->first()->total;
        $data['impot']= DB::table('baremes') ->where('revenubrut','=',$d);
        if( $im == 1){ ->select('un'); } ->get();
}

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SNAPEY - sorry for inconiveinces

i sovled my self

adminmiddleware

public function handle($request, Closure $next)
    {
        if(\Auth::check() && \Auth::user()->isAdmin())
        {            
                return $next($request);             
        }
        elseif(\Auth::check() && \Auth::user()->isUser())
        {
                return $next($request);             
        }
        return \Redirect::route('login');
    }

login controller

public function loginstore(Request $request)
    {
        if(User::loginUser($request->email,$request->password))
        {
                $email=$request->get('email');
                $role=User::where('email','=',$email)->pluck('role')->first();
                if($role=='admin')
                {
                    $name=User::where('email','=',$email)->pluck('name')->first();
                    return \Redirect::route('dashboard',['name'=>$name]);
                }
                if($role=='2')
                {
                    $id=User::where('email','=',$email)->pluck('id')->first();
                    return \Redirect::route('job.view',['id'=>$id]);
                }
        }
        else
        {                   
                flash('Password Or Email Incorrect')->error();            
                return redirect()->back();            
        }
    }

i solved this thank you @sergiu17 @snapey @jlrdw @hjortur17 thank you everyone

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SNAPEY - yes sir authorise login as two-factor authentication

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@JLRDW - i am using mail to send otp help me out plz

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SNAPEY - i understand but i cant implement code please help me to give example code

13 May
6 days ago

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SERGIU17 - #41 D:\laragon\www\employeesystem\public\index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #42 {main}

can you please more realiable solution

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SERGIU17 - i cant understand here my code

Trying to get property of non-object

if(Auth::check() && Auth::signup()->verify())
    {            
        // return $next($request);
        return \Redirect::route('otp.view',auth()->id);
    }

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SERGIU17 - but i try this condtion false

if(\Auth::check() && \Auth::signup()->verify())
    {            
        // return $next($request);
        return \Redirect::route('otp.view',auth()->id);
    }
    return \Redirect::route('login');

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SERGIU17 - i cant understand please explain me

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SERGIU17 - ok thanks but still error

Undefined property: Illuminate\Auth\AuthManager::$id

Van1310 left a reply on How To Use Storage::download()

@JAY_CHAUHAN - can you help me bro my question

how to pass id into middleware in laravel in laracast

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SERGIU17 - i know but i want redirect page with id when verify user

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SNAPEY - wait i will send a code

middleware code

public function handle($request, Closure $next,$id)
    {
        if(\Auth::check() && \Auth::signup()->verify())
        {            
                // return $next($request);
                return \Redirect::route('login');
        }
        return \Redirect::route('otp.view',$id);
    }

here is my signup model

public function Verify($id)
    {
        $id = Signup::where('id','=',$id)->first();
        return($this->verify=='yes');
    }

here is my controller

public function otp_view($id)
    {   
        $otp=Signup::where('id','=',$id)->first();
    return view('otp',compact('otp'));
    }

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@SNAPEY - i try to use middleware

i have signup form which field like id,name,otp when user signup then get redirect to otp page and enter otp but whenever i try in url like

http://localhost/employeesystem/public/otp/1

so i change value like otp/2 so redirect id 2 page so i used middleware but i cant run it

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

@HJORTUR17 - i try this but error Missing argument 3 for App\Http\Middleware\SignupMiddleware::handle(), called in D:\laragon\www\employeesystem\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php on line 149 and defined

public function handle($request, Closure $next,$id)
    {
        if(\Auth::check()==$id && \Auth::signup()->verify())
        {            
                // return $next($request);
                return \Redirect::route('login');
        }
        return \Redirect::route('otp.view',$id);
    }

Van1310 left a reply on How To Pass Id Into Middleware In Laravel

i try but error Trying to get property of non-object

if(\Auth::check() && \Auth::signup()->verify())
    {         
            $request->route()->parameter('id');
            return $next($request);             
    }

Van1310 started a new conversation How To Pass Id Into Middleware In Laravel

here is my middleware

 public function handle($request, Closure $next)
    {
        if(\Auth::check() && \Auth::signup()->verify())
        {            
                return $next($request);             
        }
        return \Redirect::route('login');
    }

here is my route

Route::group(['middleware'=>'signup'],function()
{
    Route::get('otp/{id}',array('as'=>'otp.view','uses'=>'Signup\[email protected]_view'));
}

how to pass register id in my middleware thank you

11 May
1 week ago
10 May
1 week ago

Van1310 started a new conversation Dropdown Using Ajax Data Fetch

i have 2 tables

  1. job -> job,
  2. jobtitle -> city

i want to fetch citywise job in dropdown

here my blade file

<label for="exampleSelect1">City</label>
<select class="form-control m-input" id="city" name="city" onChange="getCity(this.value);">
    <option value="bhavnagar"> Bhavnagar </option>
            <option value="ahmedabad"> Ahmedabad </option>
</select>

<label for="exampleSelect1">Job Title</label>
<select class="form-control m-input" id="jobtitle" name="jobtitle" >
    @foreach($jobtitle as $job)
        <option value="{{$job->jobtitle}}"> {{$job->jobtitle}} </option>
    @endforeach
</select>

here is my ajax code

<script>
    function getCity(val) {
    $.ajax({
        type: "POST",
        foreach($jobtitle as $job)
            {
                url: "{{route('job.store',['id'=>$job->id])}}",
                data:'jobtitle_id='+val,
            }   
        success: function(data){
        $("#city").html(data);
        }
    });
}
</script>
08 May
1 week ago

Van1310 started a new conversation Illegal Offset Type While Mail Send

error in mail send

$mail=Registration::select('email')->first();
    $date=Carbon\Carbon::now();

$data = [
        
    'branch' => $request->branch,
            'student_name' => $request->student_name,
            'joining_date' => $request->joining_date,
            'reporting_time' => $request->reporting_time
      ];

 \Mail::send('email.confirmation', $data, function($message) use ($mail,$date,$data){
            $message->to($mail)->subject('Welcome to Byte and Bits Team.');
        });
07 May
1 week ago

Van1310 started a new conversation I Would To Upgrade To 5.0 To 5.5 ?

i try composer update and change version 5.5

but error like this

Your requirements could not be resolved to an installable set of packages.
06 May
1 week ago

Van1310 started a new conversation How To OTP Integration Using Email In Laravel ?

How to OTP integration using email in laravel ?

02 May
2 weeks ago

Van1310 left a reply on Where Are You All From?

i am from india

Van1310 left a reply on PHP Multiple Image Upload

@HIMANSHU_WKD - how can @devfrey best answer he did not any code write so how can you click best answer

Van1310 left a reply on Can Anyone Give Example Of Confirm Password Validation?? I Am Using Following Way But Not Working Properlly.

@KAUSHAL - try this

"password" => "required|confirmed",
    "password_confirmation" => "required|same:password",

Van1310 left a reply on PHP Multiple Image Upload

can you try this

<input type="file" name="myfile" multiple>

Van1310 left a reply on How To File Upload With Restriction ?

@JLRDW - i best answer click self beacuse many people search query like this so not waste your time then i was click best answer @jlrdw thanks for reply next time i be carefully question ask

Van1310 left a reply on How To File Upload With Restriction ?

i did this using javascript

var _validFileExtensions = [".jpg", ".jpeg", ".docx", ".xlsx", ".pdf"];    

function Validate(oForm) 
{
        var arrInputs = oForm.getElementsByTagName("input");
        for (var i = 0; i < arrInputs.length; i++) 
    {    
        var oInput = arrInputs[i];
            if (oInput.type == "file") {
                    var sFileName = oInput.value;
                    if (sFileName.length > 0) {
                        var blnValid = false;
                        for (var j = 0; j < _validFileExtensions.length; j++) 
                {
                                var sCurExtension = _validFileExtensions[j];
                                
                    if (sFileName.substr(sFileName.length - sCurExtension.length,                               sCurExtension.length).toLowerCase() == sCurExtension.toLowerCase()) 
                {
                                blnValid = true;
                                break;
                            }
                    }
            
                    if (!blnValid) 
            {
                            alert("Sorry, " + sFileName + " is invalid, allowed extensions are: " + _validFileExtensions.join(", "));
                            return false;
                    }
                }
        }
    }

return true;

}

Van1310 left a reply on How To File Upload With Restriction ?

@JLRDW - yes i read this but i click upload button and open a dialog box and open a dropdown list which is custom file and also all files when i click dropdown so i try to disable all file option only show a specifie file please suggest me

Van1310 left a reply on How To File Upload With Restriction ?

@TRAY2 - Thank for reply but i was try to disable all file option while file upload so please suggestion how to fix it

Van1310 started a new conversation How To File Upload With Restriction ?

i was try to upload file but when i click upload button to select custom file or all files now how to restrict all file option when i click upload button and only show in dialog box and choose specfic file when i was validate

please suggest thank you

01 May
2 weeks ago

Van1310 left a reply on Trying To Get Property Of Non-object

@PWPARSONS - already try this get but error

Undefined property: Illuminate\Database\Eloquent\Collection::$duedate

Van1310 started a new conversation Trying To Get Property Of Non-object

i try to fetch multiple record using foreach

Here is my controller file

public function view($id)
{
    $print=Pay::where('id','=',$id)->select('duedate','amount')->first();        
    return view('admin',compact('print'));
}

Blade file

<td>Payment Confirmed</td>                                                 
@foreach($print as $prints)                                                                                               
<td class="m--font-danger">{{$prints->amount}}</td>                                                
@endforeach
30 Apr
2 weeks ago

Van1310 left a reply on Call To A Member Function GetClientOriginalExtension() On Null

@SERGIU17 - @sergiu17 Thank You Very much Sir Its Working Once Again You Helping me Thank You

Van1310 started a new conversation Call To A Member Function GetClientOriginalExtension() On Null

when i try submit data but skip file upload option then show this error

Call to a member function getClientOriginalExtension() on null

how to fix it any suggestion ?

$files=Input::file('resume');
    
$picName=str_random(30) . '.' . $files->getClientOriginalExtension();
    
$files->move(base_path() . '/public/resume/',$picName);

$registration=new Registration(array(            
    
            'resume'=>base_path() . '/public/resume/'. $picName,
            
    'date_registration'=>$request->get('date_registration'),
            
    'status'=>'Recently Added',            
        
));                       
        
$registration->save();

Van1310 left a reply on How To Create A Password In Code?

@LUDO1960 - best way to thanks for @snapey its just click best answer

Van1310 left a reply on TollFree Number Of Redmi And Mi Mobile

This is not business site so don't write spam messages

Van1310 left a reply on How To Create A Password In Code?

can you try this your sign wrong

$password => bcrypt('mypassword'),