kaushal

kaushal

php web devloper at Rajkot

Member Since 6 Months Ago

Rajkot

Experience Points
1,120
Total
Experience

3,880 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 1
1,120 XP
14 Sep
1 week ago

kaushal left a reply on Laravel 6 Which Is The Best Alternate Method Of Laravel Pluck??

Pluck is depricated for laravel new version

13 Sep
1 week ago

kaushal left a reply on Laravel 6 Which Is The Best Alternate Method Of Laravel Pluck??

I need following type of array result for dropdown. so need following type of array result

[ 1 => "name1", 2 => "name2", . . . 100 => "name100" ]

kaushal started a new conversation Laravel 6 Which Is The Best Alternate Method Of Laravel Pluck??

How can i get following result without pluck method or alternate of pluck method $arr= DB::table('users')->where('name', 'John')->pluck('name','id');

kaushal started a new conversation Laravel 6 Custom Validation Is Not Called For File Control Only And For Other Controls Working Fine

Following is the custom validation "file_required"

class AppServiceProvider extends ServiceProvider
{
    public function boot(Request $request)
    {
        $arr_files = $_FILES;
        $arr_post_data = $request->all();

        echo "here1";

        Validator::extend('file_required', function($attribute, $value, $parameters) use ($arr_files,$arr_post_data) {

            echo "here2";  die;

    });
   }
}
Following is my html element :
<input type="file" name="photo" id="photo">
Following is  my validatin rule:

"photos" =>"file_required",
"photos.file_required" =>  "Please Select Photos",
Now when i try to submit the form then validation rule is not called means control not comes to on heres2 but comes on here1 in boot method. But when i change input type ="text" then that rule is fired. But i need to fire that custom validation on input type ="file" control.

Can anyone give answer about this what i need to do to work with file control
12 Sep
1 week ago

kaushal started a new conversation Larvel 6 Generates Dropdown With "optgroup" Auomatically. How To Remove "optgroup" In Following Method

{{Form::select('user[country_id]',$arr_country_id_list,$selected_country_id,['id'=>'country_id','class'=>'form-control' ]}}

I am passing following array in $arr_country_id_list from controller Array ( [0] => Array ( [country_id] => 1 [country_name] => india )

[1] => Array
    (
        [country_id] => 2
        [country_name] => pakistan

    )

[2] => Array
    (
        [country_id] => 3
        [country_name] => australia
    )

[3] => Array
    (
        [country_id] => 4
        [country_name] => america
    )
04 Sep
2 weeks ago

kaushal started a new conversation Can We Use Both Request Facade And Request Class Use As Function Argument??

use Illuminate\Http\Request;

use Request;

public function login(Request $request)
 {
     $arr_form_data  = $request->all();
     $arr_form_data2  = Request ::all();
}

kaushal started a new conversation Laravel 6 Error Class 'Illuminate\Support\Facades\Input' Not Found

I have added following line in app.php in alias section and have used in controll as "use input" 'Input' => Illuminate\Support\Facades\Input::class,

still it gives error input class not found

kaushal started a new conversation How To Install Illuminate/html Package By Composer In Laravel 6

I have tried following way

"require": { "php": "^7.2", "fideloper/proxy": "^4.0", "laravel/framework": "^6.0", "laravel/tinker": "^1.0", "illuminate/html": "6.*" },

But it gives error

01 May
4 months ago

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

@DEVFREY - I have entered same text in password and confirm password textbox though it is giving "Confirm password does not metch with password!" error message

kaushal started a new conversation Can Anyone Give Example Of Confirm Password Validation?? I Am Using Following Way But Not Working Properlly.

$arr_validation["rules"] = array(
    "password"              => "required|confirmed",
    "password_confirmation" => "required",
);
            
$arr_validation["rules_messages"] = array(
    "password.required"                 => "Please Enter password",
    "password_confirmation.required"    => "Please Enter Confirm Password",
    "password.confirmed"                => "Confirm password does not metch with password!",
);

$validator = validator::make($arr_form_data, $arr_validation["rules"], $arr_validation["rules_messages"]);
26 Apr
4 months ago

kaushal left a reply on How To Get Form Post Data In Custom Validation??

@DEVFREY - It will give the value of validated control only but I need the value of all the control of the form.

kaushal started a new conversation How To Get Form Post Data In Custom Validation??

Validator::extend('multiple_file_required', function($attribute, $value, $parameters) {
});
25 Apr
4 months ago

kaushal left a reply on For Multiple File Uploading I Am Using Following Validatin Rule But Whather I Am Uploading An Image Or Not It Is Giving Me 'Please Upload An Image Only' Error Message.

{!! Form::open(['enctype' =>'multipart/form-data']) !!}

<input type="file" value="" id="images1" name="images[]">
<input type="file" value="" id="images2" name="images[]">

@if($errors->has("images.*")) {{  $errors->first('images.*') }} @endif
{!! Form::close() !!}

kaushal started a new conversation For Multiple File Uploading I Am Using Following Validatin Rule But Whather I Am Uploading An Image Or Not It Is Giving Me 'Please Upload An Image Only' Error Message.

 public function store(Request $request)
{
    
    $this->validate($request, [
        'images.*' => 'required'
      ],[
        'images.*.required' => 'Please upload an image only'
    ]);
   
    // Write your code
}

{!! Form::open(['enctype' =>'multipart/form-data']) !!}

<input type="file" value="" id="images1" name="images[]">
<input type="file" value="" id="images2" name="images[]">

@if($errors->has("images.*")) {{  $errors->first('images.*') }} @endif
{!! Form::close() !!}
01 Apr
5 months ago

kaushal left a reply on Can Anyone Correct My Blade Syntax For Window.location='' Location?

@TRAY2 - i want to create button by laravel way not simple html button.

kaushal started a new conversation Can Anyone Correct My Blade Syntax For Window.location='' Location?

{!! Form::button('Back',['class' => 'btn_back','name'=>'btn_back','onclick' => 'window.location={{ url("/") } }']) !!}

18 Mar
6 months ago

kaushal started a new conversation Can Anyone Give Example Of Confirm Password Validation??

{!! Form::password("password",array("id"=>"password","class"=>"form-control")) !!} {!! Form::password("c_password",array("id"=>"c_password","class"=>"form-control")) !!}

kaushal left a reply on Can Anyone Suggest Remove Undefined Variable Error Without Issset Variable In Laravel??

@TYKUS - Is it possible by error_reporting(E_ALL); ?? So, we have nothing to do.

14 Mar
6 months ago

kaushal started a new conversation Can Anyone Suggest How We Can Use Config("constant.photo1_image_root") Helper Function In Following Line. Because That Is Not Working Properlly.

{!! Form::file('users[{{ config("constant.photo1_image_root") }}-photo1]', array("id"=>"photo1","class"=>"form-control")) !!}

kaushal left a reply on To Define Constant With Define() Function In Config/constant.php. Can We Say It Is Laravel Way??

@RESIN - Can you suggest how we can use config("constant.photo1_image_root") helper function in following line. Because that is not working properlly.

{!! Form::file('users[{{ config("constant.photo1_image_root") }}-photo1]', array("id"=>"photo1","class"=>"form-control")) !!}

13 Mar
6 months ago

kaushal started a new conversation To Define Constant With Define() Function In Config/constant.php. Can We Say It Is Laravel Way??

Exa : define('test_constat_name','test_constant_value')

12 Mar
6 months ago

kaushal left a reply on How Can I Change SetFetchMode Of Pdo Statement In Event Listener From Users Method Of UserController.

@JLRDW - Where I have to write that line?? How can i change from users method?

11 Mar
6 months ago

kaushal started a new conversation How Can I Change SetFetchMode Of Pdo Statement In Event Listener From Users Method Of UserController.

UserController .php

class UserController extends Controller {

public function users(Request $request)
{

    $users = DB::table('users')->select('name', 'email')->get();
}

}

EventServiceProvider.php

class EventServiceProvider extends ServiceProvider {

public function boot(DispatcherContract $events)
{
    Event::listen(StatementPrepared::class, function ($event) {
            $event->statement->setFetchMode(\PDO::FETCH_ASSOC);
        });
}

}